Install the ROS module
Chrono::ROS is an optional module that enables direct integration of Chrono with the Robot Operating System (ROS).
Features
The ROS module allows users to interface a ROS 2-based autonomy stack with autonomous agents in Chrono.
For more detail, read the Chrono::ROS section of the reference manual.
Requirements
- To build and run applications based on this module, the following are required:
- Linux OS (Windows OS support will be validated soon).
- Available shared memory (
/dev/shm) of at least 1 GB by default.- The Chrono::ROS Interface attempts to reserve (not necessarily use) at least 1 GB of
/dev/shmto support 4K Chrono::Sensor camera images. - If you are running on a memory-constrained system and do not require high-bandwidth sensor data (like 4K cameras), you can reduce the shared memory requirement by modifying
src/chrono_ros/ipc/ChROSIPCChannel.h. Change the defaultbuffer_sizeinCreateMainChannelfrom512 * 1024 * 1024(512 MB) to a smaller value (e.g.,16 * 1024 * 1024for 16 MB). 16 MB is sufficient for most non-visual sensors. Chrono::ROS creates a bi-directional shared memory channel; therefore, whatever value you set above, the maximum shared memory utilization is that value * 2.
- The Chrono::ROS Interface attempts to reserve (not necessarily use) at least 1 GB of
- All ROS 2 distributions and middleware variants are supported. However, since Humble is the LTS release, it has been most thoroughly tested with Chrono::ROS, so we recommend Humble for your projects. ROS 1 is not supported.
- ROS 2 Humble (see docs.ros.org for detailed installation instructions). Docker is recommended. A Docker image with Chrono::ROS built is available here.
- When using Docker, please make sure to override the default
shm_sizeof 64 MB; ashm_sizeof > 1 GB is required by default.
- When using Docker, please make sure to override the default
- NOTE: All ROS 2 packages required by Chrono::ROS are included in the base ROS 2 installation.
Optional Dependencies
- Some features (detailed in the reference manual) are conditionally built based on some optional dependencies. These dependencies include:
- To build URDF support for Chrono::ROS, you will also need to enable the Chrono::Parsers module.
NOTE: If you enable Chrono::Parsers with URDF support and you're using a ROS 2 distribution newer than Iron, ensure the
urdfdom_DIR is set not to the ROS 2 installation. The ChParserURDF class uses a newer version of urdfdom. Building instructions
- To build Chrono::ROS, after installing the above dependencies, ensure you have sourced your ROS 2 installation (e.g.
source /opt/ros/humble/setup.bash). - Repeat the instructions for the full installation.
- Set
CH_ENABLE_MODULE_ROSto 'on' in CMake config arguments or the GUI equivalent. - As mentioned above, to enable URDF support, you must also enable the Chrono::Parsers module.
- Press 'Configure' again, then 'Generate', and proceed as usual in the installation instructions.
How to use it
- Consult the reference manual.
- Look at the API section of this module for documentation about classes and functions.
- Look at the C++ and Python source of demos to learn how to use the functions of this module.