Exercise 1.4 Build Action Graph to drive a robot
Documentation - Link
OmniGraph
Documentation - Link
OmniGraph is Omniverse's visual programming tool, enabling easy function integration from various systems and supporting custom nodes for personalized functionality, leveraging Omniverse's efficient computation. In Omniverse Isaac Sim, it powers Replicators, ROS bridges, sensor integration, and more, serving as a crucial component. This tutorial offers a quick introduction to OmniGraph, with a recommendation to explore the detailed documentation for a comprehensive understanding.
Cheat-file (course_env_4.usd)
You can access a pre-populated environment at /home/nvidia/Desktop/Isaac_ROS_Isaac_SIM_[DLIT61534]/Isaac Sim Assets Pack 1/Assets/Isaac/2023.1.1/Isaac/Environments/Simple_Warehouse/course_env_4.usd
Tip
How to navigate in the Visual Scripting graph editor:
- Middle Mouse Button and drag to pan the editor view left, right, up, and down
- Mouse Wheel to zoom toward or away from nodes in the editor
Step 1. Open Visual Scripting
Go to Window > Visual Scripting > Action Graph.
Step 2. Create new Action Graph
Click on the New Action Graph icon in the middle of the Action Graph window.
Step 3. Build graph
Search the relevant nodes in the search bar and build the graph shown below.
Action Graph nodes
- On Playback Tick Node: Generates a tick during simulation playback, ensuring nodes execute their functions every simulation step.
- ROS2 Context Node: Establishes a context with a specified Domain ID for ROS2 communication. It can import the ROS_DOMAIN_ID from the environment if enabled.
- ROS2 Subscribe Twist Node: Subscribes to Twist messages, typically used for controlling robotic motion. It triggers the Differential Node to calculate differential commands when a new Twist message is received.
- Break 3-Vector Node: Decomposes 3-dimensional vectors (such as linear and angular velocities from Twist messages) into individual components before feeding them into the Differential Controller node.
- Differential Controller Node: Receives desired vehicle speed and computes wheel speed based on wheel radius, wheel distance, and maximum linear speed parameters. It ensures proper motion control for the robot.
- Articulation Controller Node: Moves specified joints of the target robot using commands such as Position, Velocity, or Effort commands. It's often configured to control the movement of a robot's joints.
- Constant Token Node: Constant Token nodes are used to input the names of wheel joints, which are then combined into an array using a Make Array node. This array is used by the Articulation Controller node to control the robot's joints.
Step 4. Set the node properties
-
[Optional] Assign ROS DOMAIN ID if needed using ROS2 Context Node.
-
Specify the topicName (
cmd_vel
) to publish the ROS twist commands using the ROS2 Subscribe Twist Node. -
Specify the names of the wheel joints inside each of the Constant Token Nodes
-
In the Differential Controller node's property tab, input the wheel radius, wheel distance, and maximum linear speed to match the Turtlebot specifications.
-
Assign the Articulation Controller node's target to be the Turtlebot
Info
If you plan to continue working on the later exercise using the environment you have been working on, save the environment file by selecting File > Save As... or Ctrl+Shift+S.
Step 5. Play
Click "Play" icon
Step 6. Verification
Verify the ActionGraph by controlling the robot from ROS 2 side.
Open a terminal and source ros2
source /opt/ros/humble/setup.bash
Control the Turtlebot using the keyboard with teleop_twist_keyboard
package.
ros2 run teleop_twist_keyboard teleop_twist_keyboard
-
Start the Foxglove Bridge
ros2 launch foxglove_bridge foxglove_bridge_launch.xml
-
Then start the Foxglove Studio from GUI or CUI.
foxglove-studio
-
Click on "Open connection"
Select "Foxglove WebSocket", leave the WebSocket URL as
ws://localhost:8765
and click on "Open". -
Add teleop widget and set the topic to be
/cmd_vel
. -
Once Foxglove is ready, on Isaac Sim, hit "Play" button.
-
Perform teleop to verify Action Graph for driving robot