Abstract
Developing production-grade robotic applications is a critical component of building a robotic product. However, those techniques, best practices, and patterns are often tribal knowledge, learned on the job, but infrequently documented. This chapter covers some of these topics, such as: how to compile ROS software for a non-native architecture (such as ARM), how to tune a software stack using Quality of Service (QOS) settings, how to build a robust CI system for your packages, how to maintain and release ROS 2 software packages, how to monitor ROS 2 nodes running on a fleet of robots in production? This chapter presents step-by-step tutorials, and workflows adopted by the ROS Tooling Working Group.
Keywords
- ROS 2
- Best practices
- Cross-compilation
- DevOps
- QoS
- Monitoring
- Continuous integration
- Release management
This is a preview of subscription content, access via your institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsNotes
- 1.
Source code: https://github.com/ros-tooling/cross_compile Release: https://pypi.org/project/ros-cross-compile/.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
- 14.
- 15.
docker save (https://docs.docker.com/engine/reference/commandline/save/), send the image, and docker load (https://docs.docker.com/engine/reference/commandline/load/) on the other side.
- 16.
For development, you may want to try a local insecure registry by using the instructions at https://docs.docker.com/registry/deploying/#run-a-local-registry and https://docs.docker.com/registry/insecure/. Please note that this is not acceptable for production environments, but can be set up very quickly to demonstrate this workflow, and has the benefit of only passing data over the LAN.
- 17.
- 18.
- 19.
Early versions of the tool performed an emulated build here by installing build tools and sysroot dependencies into the same environment, which has the same result but is slower than true cross-compilation.
- 20.
The ROS 2 default communication implementations use DDS, and many of the concepts in ROS 2 closely match with DDS concepts, but there is an intentional abstraction into “ROS 2 concepts.” See this original design article https://design.ros2.org/articles/ros_on_dds.html for the rationale, and the DDS Spec https://www.omg.org/spec/DDS/About-DDS/ for more information about DDS.
- 21.
- 22.
- 23.
- 24.
- 25.
- 26.
- 27.
References
ROS2 Logging Tutorial, https://index.ros.org/doc/ros2/Tutorials/Logging-and-logger-configuration/, https://github.com/ros2/rosbag2. Accessed 12 May 2020
ROS 2 Concepts, https://index.ros.org/doc/ros2/Concepts/. Accessed 16 Sept 2020
Foxy Fitzroy Release Details, https://index.ros.org/doc/ros2/Releases/Release-Foxy-Fitzroy/. Accessed 16 Sept 2020
ROSBag2 Source Code, https://github.com/ros2/rosbag2. Accessed 12 May 2020
Amazon Cloudwatch Overview, https://aws.amazon.com/cloudwatch/. Accessed 12 May 2020
Libstatistics Collector ROS2 Source Code, https://github.com/ros-tooling/libstatistics_collector. Accessed 12 May 2020
Moving Average Definition, https://en.wikipedia.org/wiki/Moving_average. Accessed 12 May 2020
Welford’s Algorithm Definition, https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#Welford’s_online_algorithm. Accessed 12 May 2020
System Metrics Collector ROS2 Source Code, https://github.com/ros-tooling/system_metrics_collector. Accessed 12 May 2020
ROS2 Subscriber Tutorial, https://index.ros.org/doc/ros2/Tutorials/Writing-A-Simple-Cpp-Publisher-And-Subscriber/#write-the-subscriber-node. Accessed 12 May 2020
Statistics Message Definition, https://github.com/ros2/rcl_interfaces/tree/master/statistics_msgs. Accessed 12 May 2020
Statistics Message Generation Method, https://github.com/ros-tooling/libstatistics_collector/blob/master/include/libstatistics_collector/collector/generate_statistics_message.hpp. Accessed 12 May 2020
ROS2 Launch File Tutorial, https://index.ros.org/doc/ros2/Tutorials/Launch-Files/Creating-Launch-Files/. Accessed 12 May 2020
ROS2 Topic Source Code, https://github.com/ros2/ros2cli/tree/master/ros2topic. Accessed 12 May 2020
Statistics Data Type Definition, https://github.com/ros2/rcl_interfaces/blob/master/statistics_msgs/msg/StatisticDataType.msg. Accessed 12 May 2020
ROS2 Lifecycle Source Code and Tutorials, https://github.com/ros2/demos/blob/master/lifecycle/README.rst. Accessed 12 May 2020
System Metrics Collector Lifecycle Node Example, https://github.com/ros-tooling/system_metrics_collector/tree/master/system_metrics_collector#inspect-and-change-lifecycle-state. Accessed 12 May 2020
ROS2 Composition Tutorial, https://index.ros.org/doc/ros2/Tutorials/Composition/. Accessed 12 May 2020
System Metrics Collector Instrument Nodes Example, https://github.com/ros-tooling/system_metrics_collector/blob/master/system_metrics_collector/share/system_metrics_collector/examples/talker_listener_example.launch.py. Accessed 12 May 2020
Launch Actions Tutorial, https://index.ros.org/doc/ros2/Tutorials/Composition/#composition-using-launch-actions. Accessed 12 May 2020
Laser Scan Message Definition, https://github.com/ros2/common_interfaces/blob/master/sensor_msgs/msg/LaserScan.msg. Accessed 12 May 2020
GitHub Pricing, https://github.com/pricing. Accessed 15 May 2020
GitHub Actions, https://github.com/features/actions. Accessed 15 May 2020
GitHub Actions Marketplace, https://github.com/marketplace?type=actions. Accessed 15 May 2020
GitHub Actions starter workflows, https://github.com/actions/starter-workflows
GitHub Actions documentation, https://help.github.com/en/actions. Accessed 15 May 2020
Colcon tool documentation, https://colcon.readthedocs.io/en/released/. Accessed 15 May 2020
ROS Tooling Working Group’s GitHub organization, https://github.com/ros-tooling/. Accessed 15 May 2020
colcon-mixin-repository Git repository, https://github.com/colcon/colcon-mixin-repository. Accessed 15 May 2020
colcon mixin verb documentation, https://colcon.readthedocs.io/en/released/reference/verb/mixin.html. Accessed 15 May 2020
ROS 2 Quality Guide, https://index.ros.org/doc/ros2/Contributing/Quality-Guide/. Accessed 15 May 2020
ROS 2 Developer Guide, https://index.ros.org/doc/ros2/Contributing/Developer-Guide/. Accessed 15 May 2020
colcon-lcov-result Git repository URL, https://github.com/colcon/colcon-lcov-result. Accessed 15 May 2020
lcov Git repository, https://github.com/linux-test-project/lcov. Accessed 15 May 2020
CodeCov.io GitHub Action, https://github.com/marketplace/actions/codecov. Accessed 15 May 2020
Codecov.io website, https://codecov.io/. Accessed 15 May 2020
AddressSanitizer documentation, https://github.com/google/sanitizers/wiki/AddressSanitizer. Accessed 15 May 2020
ThreadSanitizer documentation on GitHub, https://github.com/google/sanitizers. Accessed 15 May 2020
Ament Linters GitHub source package, https://github.com/ament/ament_lint. Accessed 16 Sep 2020
Ament Lint Auto GitHub source package, https://github.com/ament/ament_lint/tree/master/ament_lint_auto. Accessed 16 Sep 2020
GCC instrumentation options, https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.html. Accessed 15 May 2020
Coverage.py Python module, https://coverage.readthedocs.io/en/coverage-5.1/. Accessed 15 May 2020
AWS Robotics: Springer ROS Book Sample Code, https://github.com/aws-robotics/ros-book-sample-code. Accessed 15 May 2020
Official Bloom Documentation, https://bloom.readthedocs.io/en/0.5.10. Accessed 15 May 2020
Bloom Tutorials: Releasing a Package for the First Time, http://wiki.ros.org/bloom/Tutorials/FirstTimeRelease. Accessed 15 May 2020
ROS Discourse, https://discourse.ros.org. Accessed 15 May 2020
REP-149: Package Manifest Format Three Specification, https://ros.org/reps/rep-0149.html. Accessed 18 May 2020
Semantic Versioning 2.0.0, https://semver.org. Accessed 15 May 2020
ROS2 CloudWatch Metrics Source Code and Documentation, https://github.com/aws-robotics/cloudwatchmetrics-ros2. Accessed 15 May 2020
CloudWatch Metrics Alarms, https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html. Accessed 15 May 2020
B. Kehoe, S. Patil, P. Abbeel, K. Goldberg, A survey of research on cloud robotics and automation. IEEE Trans. Autom. Sci. Eng. 12(2), 398–409 (2015). https://doi.org/10.1109/TASE.2014.2376492
ROS2 Monitoring Message Definition, https://github.com/aws-robotics/monitoringmessages-ros2. Accessed 15 May 2020
CloudWatch Metrics Offline Blog Post and Setup Information, https://aws.amazon.com/blogs/opensource/robomaker-cloudwatch-ros-nodes-offline-support/. Accessed 15 May 2020
Debian Deboostrap Tool, https://wiki.debian.org/Debootstrap. Accessed 16 Sept 2020
ROS 2 Cross Compile Legacy Instructions, https://index.ros.org/doc/ros2/Tutorials/Cross-compilation/#legacy-tool-instructions. Accessed 30 Sept 2020
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2021 The Author(s), under exclusive license to Springer Nature Switzerland AG
About this chapter
Cite this chapter
Allaban, A.A., Bonnie, D., Knapp, E., Gokhale, P., Moulard, T. (2021). Developing Production-Grade Applications with ROS 2. In: Koubaa, A. (eds) Robot Operating System (ROS). Studies in Computational Intelligence, vol 962. Springer, Cham. https://doi.org/10.1007/978-3-030-75472-3_1
Download citation
DOI: https://doi.org/10.1007/978-3-030-75472-3_1
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-030-75471-6
Online ISBN: 978-3-030-75472-3
eBook Packages: Intelligent Technologies and RoboticsIntelligent Technologies and Robotics (R0)