Tesseract Scene Graph Package¶
Background¶
This package contains the scene graph and parsers. The scene graph is used to manage the connectivity of the environment. The scene graph inherits from boost graph so you are able to leverage boost graph utilities for searching.
Scene Graph (Tree)¶
Scene Graph (Acyclic)¶
Features¶
Links - Get, Add, Remove, Modify, Show/Hide, and Enable/Disable Collision
Joints - Get, Add, Remove, Move and Modify
Allowed Collision Matrix - Get, Add, Remove
Graph Functions
Get Inbound/Outbound Joints for Link
Check if acyclic
Check if tree
Get Adjacent/InvAdjacent Links for Joint
Utility Functions
Save to Graph to Graph Description Language (DOT)
Get shortest path between two Links
Parsers
URDF Parser
SRDF Parser
KDL Parser
Mesh Parser
Examples¶
Building A Scene Graph¶
#include <tesseract_common/macros.h>
TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
#include <console_bridge/console.h>
#include <iostream>
TESSERACT_COMMON_IGNORE_WARNINGS_POP
#include <tesseract_scene_graph/graph.h>
#include <tesseract_common/utils.h>
using namespace tesseract_scene_graph;
std::string toString(const ShortestPath& path)
{
std::stringstream ss;
ss << path;
return ss.str();
}
std::string toString(bool b) { return b ? "true" : "false"; }
int main(int /*argc*/, char** /*argv*/)
{
console_bridge::setLogLevel(console_bridge::LogLevel::CONSOLE_BRIDGE_LOG_INFO);
// documentation:start:1: Create scene graph
SceneGraph g;
// documentation:end:1: Create scene graph
// documentation:start:2: Create links
Link link_1("link_1");
Link link_2("link_2");
Link link_3("link_3");
Link link_4("link_4");
Link link_5("link_5");
// documentation:end:2: Create links
// documentation:start:3: Add links
g.addLink(link_1);
g.addLink(link_2);
g.addLink(link_3);
g.addLink(link_4);
g.addLink(link_5);
// documentation:end:3: Add links
// documentation:start:4: Create joints
Joint joint_1("joint_1");
joint_1.parent_to_joint_origin_transform.translation()(0) = 1.25;
joint_1.parent_link_name = "link_1";
joint_1.child_link_name = "link_2";
joint_1.type = JointType::FIXED;
Joint joint_2("joint_2");
joint_2.parent_to_joint_origin_transform.translation()(0) = 1.25;
joint_2.parent_link_name = "link_2";
joint_2.child_link_name = "link_3";
joint_2.type = JointType::PLANAR;
Joint joint_3("joint_3");
joint_3.parent_to_joint_origin_transform.translation()(0) = 1.25;
joint_3.parent_link_name = "link_3";
joint_3.child_link_name = "link_4";
joint_3.type = JointType::FLOATING;
Joint joint_4("joint_4");
joint_4.parent_to_joint_origin_transform.translation()(1) = 1.25;
joint_4.parent_link_name = "link_2";
joint_4.child_link_name = "link_5";
joint_4.type = JointType::REVOLUTE;
// documentation:end:4: Create joints
// documentation:start:5: Add joints
g.addJoint(joint_1);
g.addJoint(joint_2);
g.addJoint(joint_3);
g.addJoint(joint_4);
// documentation:end:5: Add joints
// documentation:start:6: Check getAdjacentLinkNames Method
std::vector<std::string> adjacent_links = g.getAdjacentLinkNames("link_3");
for (const auto& adj : adjacent_links)
CONSOLE_BRIDGE_logInform(adj.c_str());
// documentation:end:6: Check getAdjacentLinkNames Method
// documentation:start:7: Check getInvAdjacentLinkNames Method
std::vector<std::string> inv_adjacent_links = g.getInvAdjacentLinkNames("link_3");
for (const auto& inv_adj : inv_adjacent_links)
CONSOLE_BRIDGE_logInform(inv_adj.c_str());
// documentation:end:7: Check getInvAdjacentLinkNames Method
// documentation:start:8: Check getLinkChildrenNames
std::vector<std::string> child_link_names = g.getLinkChildrenNames("link_2");
for (const auto& child_link : child_link_names)
CONSOLE_BRIDGE_logInform(child_link.c_str());
// documentation:end:8: Check getLinkChildrenNames
// documentation:start:9: Check getJointChildrenNames
child_link_names = g.getJointChildrenNames("joint_1");
for (const auto& child_link : child_link_names)
CONSOLE_BRIDGE_logInform(child_link.c_str());
// documentation:end:9: Check getJointChildrenNames
// documentation:start:10: Save Graph
g.saveDOT(tesseract_common::getTempPath() + "graph_acyclic_tree_example.dot");
// documentation:end:10: Save Graph
// documentation:start:11: Test if the graph is Acyclic
bool is_acyclic = g.isAcyclic();
CONSOLE_BRIDGE_logInform(toString(is_acyclic).c_str());
// documentation:end:11: Test if the graph is Acyclic
// documentation:start:12: Test if the graph is Tree
bool is_tree = g.isTree();
CONSOLE_BRIDGE_logInform(toString(is_tree).c_str());
// documentation:end:12: Test if the graph is Tree
// documentation:start:13: Test for unused links
Link link_6("link_6");
g.addLink(link_6);
is_tree = g.isTree();
CONSOLE_BRIDGE_logInform(toString(is_tree).c_str());
// documentation:end:13: Test for unused links
// documentation:start:14: Remove unused link
g.removeLink("link_6");
is_tree = g.isTree();
CONSOLE_BRIDGE_logInform(toString(is_tree).c_str());
// documentation:end:14: Remove unused link
// documentation:start:15: Add new joint
Joint joint_5("joint_5");
joint_5.parent_to_joint_origin_transform.translation()(1) = 1.25;
joint_5.parent_link_name = "link_5";
joint_5.child_link_name = "link_4";
joint_5.type = JointType::CONTINUOUS;
g.addJoint(joint_5);
// documentation:end:15: Add new joint
// documentation:start:16: Save new graph
g.saveDOT(tesseract_common::getTempPath() + "graph_acyclic_not_tree_example.dot");
// documentation:end:16: Save new graph
// documentation:start:17: Test again if the graph is Acyclic
is_acyclic = g.isAcyclic();
CONSOLE_BRIDGE_logInform(toString(is_acyclic).c_str());
// documentation:end:17: Test again if the graph is Acyclic
// documentation:start:18: Test again if the graph is Tree
is_tree = g.isTree();
CONSOLE_BRIDGE_logInform(toString(is_tree).c_str());
// documentation:end:18: Test again if the graph is Tree
// documentation:start:19: Get Shortest Path
ShortestPath path = g.getShortestPath("link_1", "link_4");
CONSOLE_BRIDGE_logInform(toString(path).c_str());
// documentation:end:19: Get Shortest Path
}
You can find this example https://github.com/tesseract-robotics/tesseract/blob/master/tesseract_scene_graph/examples/build_scene_graph_example.cpp
Example Explanation¶
Create Scene Graph¶
SceneGraph g;
Add Links¶
Create the links. The links are able to be configured see Link documentation.
Link link_1("link_1");
Link link_2("link_2");
Link link_3("link_3");
Link link_4("link_4");
Link link_5("link_5");
Add the links to the scene graph
g.addLink(link_1);
g.addLink(link_2);
g.addLink(link_3);
g.addLink(link_4);
g.addLink(link_5);
Add Joints¶
Create the joints. The links are able to be configured see Joint documentation.
Joint joint_1("joint_1");
joint_1.parent_to_joint_origin_transform.translation()(0) = 1.25;
joint_1.parent_link_name = "link_1";
joint_1.child_link_name = "link_2";
joint_1.type = JointType::FIXED;
Joint joint_2("joint_2");
joint_2.parent_to_joint_origin_transform.translation()(0) = 1.25;
joint_2.parent_link_name = "link_2";
joint_2.child_link_name = "link_3";
joint_2.type = JointType::PLANAR;
Joint joint_3("joint_3");
joint_3.parent_to_joint_origin_transform.translation()(0) = 1.25;
joint_3.parent_link_name = "link_3";
joint_3.child_link_name = "link_4";
joint_3.type = JointType::FLOATING;
Joint joint_4("joint_4");
joint_4.parent_to_joint_origin_transform.translation()(1) = 1.25;
joint_4.parent_link_name = "link_2";
joint_4.child_link_name = "link_5";
joint_4.type = JointType::REVOLUTE;
Add the joints to the scene graph_acyclic_tree_example
g.addJoint(joint_1);
g.addJoint(joint_2);
g.addJoint(joint_3);
g.addJoint(joint_4);
Inspect Scene Graph¶
Get the adjacent links for link_3 and print to terminal
std::vector<std::string> adjacent_links = g.getAdjacentLinkNames("link_3");
for (const auto& adj : adjacent_links)
CONSOLE_BRIDGE_logInform(adj.c_str());
Get the inverse adjacent links for link_3 and print to terminal
std::vector<std::string> inv_adjacent_links = g.getInvAdjacentLinkNames("link_3");
for (const auto& inv_adj : inv_adjacent_links)
CONSOLE_BRIDGE_logInform(inv_adj.c_str());
Get child link names for link link_3 and print to terminal
std::vector<std::string> child_link_names = g.getLinkChildrenNames("link_2");
for (const auto& child_link : child_link_names)
CONSOLE_BRIDGE_logInform(child_link.c_str());
Get child link names for joint joint_1 and print to terminal
child_link_names = g.getJointChildrenNames("joint_1");
for (const auto& child_link : child_link_names)
CONSOLE_BRIDGE_logInform(child_link.c_str());
Save the graph to a file for visualization
g.saveDOT(tesseract_common::getTempPath() + "graph_acyclic_tree_example.dot");
Test if the graph is Acyclic and print to terminal
bool is_acyclic = g.isAcyclic();
CONSOLE_BRIDGE_logInform(toString(is_acyclic).c_str());
Test if the graph is a tree and print to terminal
bool is_tree = g.isTree();
CONSOLE_BRIDGE_logInform(toString(is_tree).c_str());
Detect Unused Links¶
First add a link but do not create joint and check if it is a tree. It should return false because the link is not associated with a joint.
Link link_6("link_6");
g.addLink(link_6);
is_tree = g.isTree();
CONSOLE_BRIDGE_logInform(toString(is_tree).c_str());
Remove link and check if it is a tree. It should return true.
g.removeLink("link_6");
is_tree = g.isTree();
CONSOLE_BRIDGE_logInform(toString(is_tree).c_str());
Create Acyclic Graph¶
Add joint connecting link_5 and link_4 to create an Acyclic graph_acyclic_tree_example
Joint joint_5("joint_5");
joint_5.parent_to_joint_origin_transform.translation()(1) = 1.25;
joint_5.parent_link_name = "link_5";
joint_5.child_link_name = "link_4";
joint_5.type = JointType::CONTINUOUS;
g.addJoint(joint_5);
Save the Acyclic graph
g.saveDOT(tesseract_common::getTempPath() + "graph_acyclic_not_tree_example.dot");
Test to confirm it is acyclic, should return true.
is_acyclic = g.isAcyclic();
CONSOLE_BRIDGE_logInform(toString(is_acyclic).c_str());
Test if it is a tree, should return false.
is_tree = g.isTree();
CONSOLE_BRIDGE_logInform(toString(is_tree).c_str());
Get Shortest Path¶
ShortestPath path = g.getShortestPath("link_1", "link_4");
CONSOLE_BRIDGE_logInform(toString(path).c_str());
Running the Example¶
Build the Tesseract Workspace:
catkin build
Navigate to the build folder containing the executable:
cd build/tesseract_scene_graph/examples
Run the executable:
./tesseract_scene_graph_build_graph_example
Create Scene Graph from URDF¶
#include <tesseract_common/macros.h>
TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
#include <iostream>
#include <console_bridge/console.h>
#include <tesseract_scene_graph/graph.h>
#include <tesseract_common/utils.h>
TESSERACT_COMMON_IGNORE_WARNINGS_POP
#include <tesseract_urdf/urdf_parser.h>
#include <tesseract_support/tesseract_support_resource_locator.h>
using namespace tesseract_scene_graph;
using namespace tesseract_urdf;
std::string toString(const ShortestPath& path)
{
std::stringstream ss;
ss << path;
return ss.str();
}
std::string toString(bool b) { return b ? "true" : "false"; }
int main(int /*argc*/, char** /*argv*/)
{
// documentation:start:2: Get the urdf file path
std::string urdf_file = std::string(TESSERACT_SUPPORT_DIR) + "/urdf/lbr_iiwa_14_r820.urdf";
// documentation:end:2: Get the urdf file path
// documentation:start:3: Create scene graph
tesseract_common::TesseractSupportResourceLocator locator;
SceneGraph::Ptr g = parseURDFFile(urdf_file, locator);
// documentation:end:3: Create scene graph
// documentation:start:4: Print information
CONSOLE_BRIDGE_logInform(std::to_string(g->getJoints().size()).c_str());
CONSOLE_BRIDGE_logInform(std::to_string(g->getLinks().size()).c_str());
CONSOLE_BRIDGE_logInform(toString(g->isTree()).c_str());
CONSOLE_BRIDGE_logInform(toString(g->isAcyclic()).c_str());
// documentation:end:4: Print information
// documentation:start:5: Save graph
g->saveDOT(tesseract_common::getTempPath() + "tesseract_urdf_import.dot");
// documentation:end:5: Save graph
}
You can find this example https://github.com/tesseract-robotics/tesseract/blob/master/tesseract_urdf/examples/load_urdf_example.cpp
Example Explanation¶
Create Resource Locator¶
Because this is ROS agnostic you need to provide a resource locator for interpreting package:/.
Load URDF¶
Get the file path to the urdf file
std::string urdf_file = std::string(TESSERACT_SUPPORT_DIR) + "/urdf/lbr_iiwa_14_r820.urdf";
Create scene graph from urdf
tesseract_common::TesseractSupportResourceLocator locator;
SceneGraph::Ptr g = parseURDFFile(urdf_file, locator);
Print information about the scene graph to the terminal
CONSOLE_BRIDGE_logInform(std::to_string(g->getJoints().size()).c_str());
CONSOLE_BRIDGE_logInform(std::to_string(g->getLinks().size()).c_str());
CONSOLE_BRIDGE_logInform(toString(g->isTree()).c_str());
CONSOLE_BRIDGE_logInform(toString(g->isAcyclic()).c_str());
Save the graph to a file.
g->saveDOT(tesseract_common::getTempPath() + "tesseract_urdf_import.dot");
Running the Example¶
Build the Tesseract Workspace:
catkin build
Navigate to the build folder containing the executable:
cd build/tesseract_urdf/examples
Run the executable:
./tesseract_urdf_load_urdf_example
Parse SRDF adding Allowed Collision Matrix to Graph¶
#include <console_bridge/console.h>
#include <tesseract_scene_graph/graph.h>
#include <tesseract_common/allowed_collision_matrix.h>
#include <tesseract_common/resource_locator.h>
#include <tesseract_srdf/srdf_model.h>
#include <tesseract_srdf/utils.h>
#include <iostream>
#include <tesseract_support/tesseract_support_resource_locator.h>
using namespace tesseract_scene_graph;
using namespace tesseract_srdf;
std::string toString(const ShortestPath& path)
{
std::stringstream ss;
ss << path;
return ss.str();
}
std::string toString(bool b) { return b ? "true" : "false"; }
int main(int /*argc*/, char** /*argv*/)
{
// documentation:start:1: Create scene graph
SceneGraph g;
g.setName("kuka_lbr_iiwa_14_r820");
Link base_link("base_link");
Link link_1("link_1");
Link link_2("link_2");
Link link_3("link_3");
Link link_4("link_4");
Link link_5("link_5");
Link link_6("link_6");
Link link_7("link_7");
Link tool0("tool0");
g.addLink(base_link);
g.addLink(link_1);
g.addLink(link_2);
g.addLink(link_3);
g.addLink(link_4);
g.addLink(link_5);
g.addLink(link_6);
g.addLink(link_7);
g.addLink(tool0);
Joint base_joint("base_joint");
base_joint.parent_link_name = "base_link";
base_joint.child_link_name = "link_1";
base_joint.type = JointType::FIXED;
g.addJoint(base_joint);
Joint joint_1("joint_1");
joint_1.parent_link_name = "link_1";
joint_1.child_link_name = "link_2";
joint_1.type = JointType::REVOLUTE;
g.addJoint(joint_1);
Joint joint_2("joint_2");
joint_2.parent_to_joint_origin_transform.translation()(0) = 1.25;
joint_2.parent_link_name = "link_2";
joint_2.child_link_name = "link_3";
joint_2.type = JointType::REVOLUTE;
g.addJoint(joint_2);
Joint joint_3("joint_3");
joint_3.parent_to_joint_origin_transform.translation()(0) = 1.25;
joint_3.parent_link_name = "link_3";
joint_3.child_link_name = "link_4";
joint_3.type = JointType::REVOLUTE;
g.addJoint(joint_3);
Joint joint_4("joint_4");
joint_4.parent_to_joint_origin_transform.translation()(1) = 1.25;
joint_4.parent_link_name = "link_4";
joint_4.child_link_name = "link_5";
joint_4.type = JointType::REVOLUTE;
g.addJoint(joint_4);
Joint joint_5("joint_5");
joint_5.parent_to_joint_origin_transform.translation()(1) = 1.25;
joint_5.parent_link_name = "link_5";
joint_5.child_link_name = "link_6";
joint_5.type = JointType::REVOLUTE;
g.addJoint(joint_5);
Joint joint_6("joint_6");
joint_6.parent_to_joint_origin_transform.translation()(1) = 1.25;
joint_6.parent_link_name = "link_6";
joint_6.child_link_name = "link_7";
joint_6.type = JointType::REVOLUTE;
g.addJoint(joint_6);
Joint joint_tool0("joint_tool0");
joint_tool0.parent_link_name = "link_7";
joint_tool0.child_link_name = "tool0";
joint_tool0.type = JointType::FIXED;
g.addJoint(joint_tool0);
// documentation:end:1: Create scene graph
// documentation:start:2: Get the srdf file path
tesseract_common::TesseractSupportResourceLocator locator;
std::string srdf_file =
locator.locateResource("package://tesseract_support/urdf/lbr_iiwa_14_r820.srdf")->getFilePath();
// documentation:end:2: Get the srdf file path
// documentation:start:3: Parse the srdf
SRDFModel srdf;
try
{
srdf.initFile(g, srdf_file, locator);
}
catch (const std::exception& e)
{
CONSOLE_BRIDGE_logError("Failed to parse SRDF.");
tesseract_common::printNestedException(e);
return 1;
}
// documentation:end:3: Parse the srdf
// documentation:start:4: Add allowed collision matrix to scene graph
g.addAllowedCollision("link_1", "link_2", "adjacent");
processSRDFAllowedCollisions(g, srdf);
// documentation:end:4: Add allowed collision matrix to scene graph
// documentation:start:5: Get info about allowed collision matrix
tesseract_common::AllowedCollisionMatrix::ConstPtr acm = g.getAllowedCollisionMatrix();
const tesseract_common::AllowedCollisionEntries& acm_entries = acm->getAllAllowedCollisions();
CONSOLE_BRIDGE_logInform("ACM Number of entries: %d", acm_entries.size());
// documentation:end:5: Get info about allowed collision matrix
}
You can find this example at https://github.com/tesseract-robotics/tesseract/blob/master/tesseract_srdf/examples/parse_srdf_example.cpp
Example Explanation¶
Create Scene Graph¶
SceneGraph g;
g.setName("kuka_lbr_iiwa_14_r820");
Link base_link("base_link");
Link link_1("link_1");
Link link_2("link_2");
Link link_3("link_3");
Link link_4("link_4");
Link link_5("link_5");
Link link_6("link_6");
Link link_7("link_7");
Link tool0("tool0");
g.addLink(base_link);
g.addLink(link_1);
g.addLink(link_2);
g.addLink(link_3);
g.addLink(link_4);
g.addLink(link_5);
g.addLink(link_6);
g.addLink(link_7);
g.addLink(tool0);
Joint base_joint("base_joint");
base_joint.parent_link_name = "base_link";
base_joint.child_link_name = "link_1";
base_joint.type = JointType::FIXED;
g.addJoint(base_joint);
Joint joint_1("joint_1");
joint_1.parent_link_name = "link_1";
joint_1.child_link_name = "link_2";
joint_1.type = JointType::REVOLUTE;
g.addJoint(joint_1);
Joint joint_2("joint_2");
joint_2.parent_to_joint_origin_transform.translation()(0) = 1.25;
joint_2.parent_link_name = "link_2";
joint_2.child_link_name = "link_3";
joint_2.type = JointType::REVOLUTE;
g.addJoint(joint_2);
Joint joint_3("joint_3");
joint_3.parent_to_joint_origin_transform.translation()(0) = 1.25;
joint_3.parent_link_name = "link_3";
joint_3.child_link_name = "link_4";
joint_3.type = JointType::REVOLUTE;
g.addJoint(joint_3);
Joint joint_4("joint_4");
joint_4.parent_to_joint_origin_transform.translation()(1) = 1.25;
joint_4.parent_link_name = "link_4";
joint_4.child_link_name = "link_5";
joint_4.type = JointType::REVOLUTE;
g.addJoint(joint_4);
Joint joint_5("joint_5");
joint_5.parent_to_joint_origin_transform.translation()(1) = 1.25;
joint_5.parent_link_name = "link_5";
joint_5.child_link_name = "link_6";
joint_5.type = JointType::REVOLUTE;
g.addJoint(joint_5);
Joint joint_6("joint_6");
joint_6.parent_to_joint_origin_transform.translation()(1) = 1.25;
joint_6.parent_link_name = "link_6";
joint_6.child_link_name = "link_7";
joint_6.type = JointType::REVOLUTE;
g.addJoint(joint_6);
Joint joint_tool0("joint_tool0");
joint_tool0.parent_link_name = "link_7";
joint_tool0.child_link_name = "tool0";
joint_tool0.type = JointType::FIXED;
g.addJoint(joint_tool0);
Load SRDF¶
Get the file path to the SRDF file
tesseract_common::TesseractSupportResourceLocator locator;
std::string srdf_file =
locator.locateResource("package://tesseract_support/urdf/lbr_iiwa_14_r820.srdf")->getFilePath();
Parse SRDF
SRDFModel srdf;
try
{
srdf.initFile(g, srdf_file, locator);
}
catch (const std::exception& e)
{
CONSOLE_BRIDGE_logError("Failed to parse SRDF.");
tesseract_common::printNestedException(e);
return 1;
}
Add Allowed Collision Matrix to Scene Graph
g.addAllowedCollision("link_1", "link_2", "adjacent");
processSRDFAllowedCollisions(g, srdf);
Methods for getting Allowed Collision Matrix from Scene Graph
tesseract_common::AllowedCollisionMatrix::ConstPtr acm = g.getAllowedCollisionMatrix();
const tesseract_common::AllowedCollisionEntries& acm_entries = acm->getAllAllowedCollisions();
CONSOLE_BRIDGE_logInform("ACM Number of entries: %d", acm_entries.size());
Parse Mesh from file¶
#include <console_bridge/console.h>
#include <tesseract_geometry/impl/mesh.h>
#include <tesseract_geometry/mesh_parser.h>
#include <iostream>
using namespace tesseract_geometry;
int main(int /*argc*/, char** /*argv*/)
{
// documentation:start:1: Create meshes
std::string mesh_file = std::string(TESSERACT_SUPPORT_DIR) + "/meshes/sphere_p25m.dae";
std::vector<Mesh::Ptr> meshes = createMeshFromPath<Mesh>(mesh_file);
// documentation:end:1: Create meshes
// documentation:start:2: Print mesh information
CONSOLE_BRIDGE_logInform("Number of meshes: %f", meshes.size());
CONSOLE_BRIDGE_logInform("Mesh #1 Triangle Count: %f", meshes[0]->getFaceCount());
CONSOLE_BRIDGE_logInform("Mesh #1 Triangle Count: %f", meshes[0]->getVertexCount());
CONSOLE_BRIDGE_logInform("Mesh #2 Triangle Count: %f", meshes[1]->getFaceCount());
CONSOLE_BRIDGE_logInform("Mesh #2 Triangle Count: %f", meshes[1]->getVertexCount());
// documentation:end:2: Print mesh information
}
Example Explanation¶
Parse Mesh from File¶
Mesh files can contain multiple meshes. This is a critical difference between MoveIt! which merges all shapes in to a single triangle list for collision checking. By keeping each mesh independent, each will have its own bounding box and if you want to convert to a convex hull you will get a closer representation of the geometry.
std::string mesh_file = std::string(TESSERACT_SUPPORT_DIR) + "/meshes/sphere_p25m.dae";
std::vector<Mesh::Ptr> meshes = createMeshFromPath<Mesh>(mesh_file);
Print Mesh Information to Terminal¶
CONSOLE_BRIDGE_logInform("Number of meshes: %f", meshes.size());
CONSOLE_BRIDGE_logInform("Mesh #1 Triangle Count: %f", meshes[0]->getFaceCount());
CONSOLE_BRIDGE_logInform("Mesh #1 Triangle Count: %f", meshes[0]->getVertexCount());
CONSOLE_BRIDGE_logInform("Mesh #2 Triangle Count: %f", meshes[1]->getFaceCount());
CONSOLE_BRIDGE_logInform("Mesh #2 Triangle Count: %f", meshes[1]->getVertexCount());
Running the Example¶
Build the Tesseract Workspace:
catkin build
Navigate to the build folder containing the executable:
cd build/tesseract_geometry/examples
Run the executable:
./tesseract_geometry_parse_mesh_example