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¶
Example Explanation¶
Create Scene Graph¶
Add Links¶
Create the links. The links are able to be configured see Link documentation.
Add the links to the scene graph
Add Joints¶
Create the joints. The links are able to be configured see Joint documentation.
Add the joints to the scene graph_acyclic_tree_example
Inspect Scene Graph¶
Get the adjacent links for link_3 and print to terminal
Get the inverse adjacent links for link_3 and print to terminal
Get child link names for link link_3 and print to terminal
Get child link names for joint joint_1 and print to terminal
Save the graph to a file for visualization
Test if the graph is Acyclic and print to terminal
Test if the graph is a tree and print to terminal
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.
Remove link and check if it is a tree. It should return true.
Create Acyclic Graph¶
Add joint connecting link_5 and link_4 to create an Acyclic graph_acyclic_tree_example
Save the Acyclic graph
Test to confirm it is acyclic, should return true.
Test if it is a tree, should return false.
Get Shortest Path¶
Create Scene Graph from URDF¶
Parse SRDF adding Allowed Collision Matrix to Graph¶
Example Explanation¶
Create Resource Locator¶
Because this is ROS agnostic you need to provide a resource locator for interpreting package:/.
Load URDF and SRDF¶
Get the file path to the URDF and SRDF file
Create Scene Graph from URDF
Parse SRDF
Add Allowed Collision Matrix to Scene Graph
Methods for getting Allowed Collision Matrix from Scene Graph
Parse Mesh from file¶
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.