ROS environment of drag&bot¶
- Information about the ROS environment of drag&bot.
- Information how to use own ROS packages with drag&bot.
Advanced use case
This is a very advanced use case of drag&bot. It requires advanced knowledge of developing ROS packages.
ROS architecture of drag&bot¶
The drag&bot ROS system runs in a docker container, which is mounted by the drag&bot Runtime. At startup the docker container automatically builds and starts the drag&bot ROS environment inside.
Using own packages with drag&bot¶
To be able to run also external ROS packages, they need to be packed in the so called 'overlay'. This is a regular ROS catkin workspace at the following location:
All ROS packages placed here will automatically be built with the docker container. Further they have priority over ROS packages already packed in the docker container.
For accessing the ROS environment with known commands you have to switch into the docker container. This can be done with the following command.
In the docker container you can enter the known ROS environment commands, e.g.
Building ROS packages in the overlay¶
Building the rospackages in the overlay is possible in several ways.
The first approach is to restart the drag&bot Runtime. This will stop the ROS core and all running ROS nodes, rebuild the overlay and restart everything.
The second way is especially meant for ROS packages under development. To rebuild the ROS packages in the overlay, enter the docker container and call the following command, which will rebuild the overlay on the fly.
Running ROS packages in the overlay¶
Assuming that the docker container built the overlay successfully it will automatically start the drag&bot system.
If your ROS packages is already a drag&bot component with a correct component definition as described here, you can add it to your robot system in the Component Manager and use it like a regular component.
If your ROS packages is not yet a drag&bot component, because it is still under development, it has to be started manually. For this enter the docker container and start your ROS packages with one of the following known ROS commands:
rosrun <package_name> <node_name> roslaunch <package_name> <launchfile_name>
Installing additional dependencies¶
In the special case you need rosdep dependencies to run your ROS packages, enter the docker container and type the following commands:
source /root/dnb_catkin_ws/devel/setup.bash rosdep install -a -y -r --ignore-src --os=ubuntu:xenial
After this restart the drag&bot Runtime.
Please note, that these dependencies will get lost each time you update the drag&bot Runtime, as an update actually replaces the used docker container.
Modify the automatic catkin build sequence¶
Inside the docker container,
docker-entrypoint.sh script can be modified to change the automatic executed commands during drag&bot start-up. This is specially recommended if you don't wont to execute the clean command
catkin clean -y && catkin build on each start-up.