Tank Tutorial for ROS¶
This tutorial explains how to use ROS for input/output in simulations for the “Tank” model, which is one of the sample models of Choreonoid. This tutorial is an extension of the Tank tutorial , which is based on the basic functions of Choreonoid, for ROS, and this tutorial is structured so that you can refer to the related pages as necessary. If you have not yet learned the basics of simulations using Choreonoid, it is recommended that you go through the basic Tank tutorial first, and then move on to this tutorial.
This tutorial uses C++ to implement the control programs, and uses ROS functions with the roscpp library. Once you learn this method, you will be able to utilize various functions and assets of ROS by coding using the roscpp library. For more information on the roscpp library, please refer to the roscpp manual and other explanatory documents separately.
- Preparation
- Step 1: Control Tank by subscribing to Joy topic
- Starting the Choreonoid node
- Creating a simulation project
- Preparing the gamepad
- Sending gamepad status by joy node
- Choreonoid version joy node
- Building the controller
- Introducing the controller
- Running the simulation and controlling the Tank robot with the gamepad
- Checking the Joytopic connection status
- Introducing a launch file
- Source code description
- Tip: Make sure you are running in a ROS environment.
- Step 2: Publish the JointState topic to output the state of Tank
- Step 3: Subscribe to the JointState topic to display the state of Tank
- Step 4: Output the state of the acceleration sensor and rate gyro
- Step 5: Enhance the Tank state display by subscribing to sensor information topic