Skip to content

Commit

Permalink
feat(turtlebot3_ws): Publish joint state info through OmniGraph
Browse files Browse the repository at this point in the history
  • Loading branch information
j3soon committed Nov 6, 2024
1 parent fd528f6 commit 7ef0a6a
Showing 1 changed file with 21 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ def create_turtlebot3_burger_with_omnigraph():

# Create OmniGraph
# Refs:
# - https://docs.omniverse.nvidia.com/isaacsim/latest/ros2_tutorials/tutorial_ros2_manipulation.html#add-joint-states-in-extension
# - https://docs.omniverse.nvidia.com/isaacsim/latest/advanced_tutorials/tutorial_advanced_omnigraph_scripting.html
# - https://docs.omniverse.nvidia.com/kit/docs/omni.graph.docs/latest/howto/Controller.html
# OmniGraph for Articulation Controller
Expand Down Expand Up @@ -133,6 +132,27 @@ def create_turtlebot3_burger_with_omnigraph():
],
},
)
# OmniGraph for Publishing Joint State
# Ref: https://docs.omniverse.nvidia.com/isaacsim/latest/ros2_tutorials/tutorial_ros2_manipulation.html
og.Controller.edit(
{"graph_path": "/ActionGraphPublishJointState", "evaluator_name": "execution"},
{
og.Controller.Keys.CREATE_NODES: [
("Context", "omni.isaac.ros2_bridge.ROS2Context"),
("OnPlaybackTick", "omni.graph.action.OnPlaybackTick"),
("ReadSimTime", "omni.isaac.core_nodes.IsaacReadSimulationTime"),
("PublishJointState", "omni.isaac.ros2_bridge.ROS2PublishJointState"),
],
og.Controller.Keys.CONNECT: [
("OnPlaybackTick.outputs:tick", "PublishJointState.inputs:execIn"),
("ReadSimTime.outputs:simulationTime", "PublishJointState.inputs:timeStamp"),
("Context.outputs:context", "PublishJointState.inputs:context"),
],
og.Controller.Keys.SET_VALUES: [
("PublishJointState.inputs:targetPrim", turtlebot3_burger_prim_path),
],
},
)

if __name__ == '__main__':
# Ref: https://docs.omniverse.nvidia.com/dev-guide/latest/programmer_ref/extensions/enable-kit-extension.html
Expand Down

0 comments on commit 7ef0a6a

Please sign in to comment.