Ackermann Controller#
Learning Objectives#
In this example, we will drive a forklift by subscribing to a AckermannDriveStamped message through the ROS network. We will learn to
Setup Articulation and Ackermann controllers to a forklift
Setup the robot to be driven by a ROS AckermannDriveStamped message
Getting Started#
Prerequisite
The ackermann_msgs ROS package is required to run this sample. To install this package run the following command:
sudo apt install ros-noetic-ackermann-msgs
This tutorial requires
isaac_tutorials
ROS package which is provided in IsaacSim-ros_workspaces repo. Complete ROS and ROS 2 Installation to make sure the ROS Noeitc workspace is built and the environment is setup correctly.ROS Bridge is enabled.
roscore
is running.
Ackermann Controller and Drive Setup#
In a new stage, create the Flat Grid environment by going to Create -> Isaac -> Environments -> Flat Grid.
Add the Forklift C robot by going to Create -> Isaac -> Robots -> Wheeled Robots -> Forklift -> Forklift C.
Create a new action graph by navigating to Window > Visual Scripting > Action Graph and then in the Action Graph panel, select New Action Graph.
Now add the following nodes to the graph and connect them as shown:
On Playback Tick node to execute other graph nodes every simulation frame.
Isaac Compute Odometry Node node to compute the robot’s current linear speed.
Ackermann Controller node to compute individual wheel steering angles and wheel speed.
ROS1 Subscribe AckermannDrive node to subscribe to Ackermann drive commands.
In the Property tab for the Isaac Compute Odometry Node:
Add the Forklift prim (ie.
/Forklift
) to its chassisPrim input field. This node calculates the position of the robot relative to its start location. Its linear velocity output will be fed into the Ackermann Controller node.
In the Property tab for the ROS1 Subscribe AckermannDrive node:
Ensure the topicName input field is set to
ackermann_cmd
.
In the Property tab for the Ackermann Controller node set inputs as shown in the table below:
Input Field
Value
invertSteeringAngle
True
maxWheelRotation
0.69813
maxWheelVelocity
20.0
trackWidth
0.82
turningWheelRadius
0.255
useAcceleration
True
wheelBase
1.65
Add the following nodes to the graph and modify them as explained:
Articulation Controller node to manipulate the wheels of the forklift. In the Property tab:
Add the Forklift prim (ie.
/Forklift
) to its targetPrim input field.For the jointNames input field:
Click the Add Element button and enter
left_back_wheel_joint
in the text field that appears.click the Add Element button again and enter
right_back_wheel_joint
in the text field that appears.
Make Array node to create an array of wheel rotation velocities to feed into the articulation controller. In the Property tab:
Under the input0 field click the plus icon to add a second input.
Now connect the nodes as shown:
Add another set of these nodes to the graph and modify them as explained:
Articulation Controller node to manipulate the steering angle of the forklift wheels. In the Property tab:
Add the Forklift prim (ie.
/Forklift
) to its targetPrim input field.For the jointNames input field:
Click the Add Element button and enter
left_rotator_joint
in the text field that appears.click the Add Element button again and enter
right_rotator_joint
in the text field that appears.
Make Array node to create an array of wheel angles to feed into the articulation controller. In the Property tab:
Under the input0 field click the plus icon to add a second input.
Now connect the nodes as shown:
Hit Play in Isaac Sim to start simulation.
In a new terminal, ensure your Isaac Sim ROS workspace is sourced and run the following node to start publishing Ackermann commands.
rosrun isaac_tutorials ros_ackermann_publisher.py
The forklift should move similarly to the one below:
Summary#
This tutorial covered
Creating and setting up Ackermann Controller node and with articulation controller nodes.
Adding a ROS1 AckermannDriveStamped subscriber node which feeds commands into the Ackermann Controller node.
Next Steps#
Continue on to the next tutorial in our ROS Tutorials series, ROS 1 to ROS 2 to learn how to interface with ROS2 nodes in Isaac Sim from ROS1.