Skip to main content

Developing Production-Grade Applications with ROS 2

  • Chapter
  • First Online:
Robot Operating System (ROS)

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

eBook
USD 16.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 139.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info
Hardcover Book
USD 199.99
Price excludes VAT (USA)
  • Durable hardcover edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    Source code: https://github.com/ros-tooling/cross_compile Release: https://pypi.org/project/ros-cross-compile/.

  2. 2.

    https://github.com/ros2/ros2/issues/988.

  3. 3.

    https://github.com/ros/meta-ros.

  4. 4.

    https://index.ros.org/doc/ros2/Installation/Foxy/Linux-Install-Binary.

  5. 5.

    https://index.ros.org/doc/ros2/Tutorials/Colcon-Tutorial/.

  6. 6.

    https://www.yoctoproject.org/.

  7. 7.

    https://buildroot.org/.

  8. 8.

    https://colcon.readthedocs.io/en/released/user/configuration.html#defaults-yaml.

  9. 9.

    https://www.raspberrypi.org/downloads/raspbian/.

  10. 10.

    https://www.balena.io/os/.

  11. 11.

    https://hub.docker.com/.

  12. 12.

    https://aws.amazon.com/ecr.

  13. 13.

    https://cloud.google.com/container-registry.

  14. 14.

    https://docs.docker.com/registry/deploying/.

  15. 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. 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. 17.

    https://github.com/osrf/rocker.

  18. 18.

    https://github.com/NVIDIA/nvidia-docker.

  19. 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. 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. 21.

    https://index.ros.org/doc/ros2/Concepts/About-Quality-of-Service-Settings/.

  22. 22.

    https://github.com/ros2/rosbag2.

  23. 23.

    https://github.com/ros2/demos/tree/master/quality_of_service_demo.

  24. 24.

    https://index.ros.org/doc/ros2/Concepts/About-Quality-of-Service-Settings/#qos-profiles.

  25. 25.

    https://github.com/ros2/demos/tree/master/quality_of_service_demo#lifespan.

  26. 26.

    http://wiki.ros.org/diagnostics.

  27. 27.

    https://github.com/ros-industrial/industrial_ci.

References

  1. ROS2 Logging Tutorial, https://index.ros.org/doc/ros2/Tutorials/Logging-and-logger-configuration/, https://github.com/ros2/rosbag2. Accessed 12 May 2020

  2. ROS 2 Concepts, https://index.ros.org/doc/ros2/Concepts/. Accessed 16 Sept 2020

  3. Foxy Fitzroy Release Details, https://index.ros.org/doc/ros2/Releases/Release-Foxy-Fitzroy/. Accessed 16 Sept 2020

  4. ROSBag2 Source Code, https://github.com/ros2/rosbag2. Accessed 12 May 2020

  5. Amazon Cloudwatch Overview, https://aws.amazon.com/cloudwatch/. Accessed 12 May 2020

  6. Libstatistics Collector ROS2 Source Code, https://github.com/ros-tooling/libstatistics_collector. Accessed 12 May 2020

  7. Moving Average Definition, https://en.wikipedia.org/wiki/Moving_average. Accessed 12 May 2020

  8. Welford’s Algorithm Definition, https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#Welford’s_online_algorithm. Accessed 12 May 2020

  9. System Metrics Collector ROS2 Source Code, https://github.com/ros-tooling/system_metrics_collector. Accessed 12 May 2020

  10. 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

  11. Statistics Message Definition, https://github.com/ros2/rcl_interfaces/tree/master/statistics_msgs. Accessed 12 May 2020

  12. 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

  13. ROS2 Launch File Tutorial, https://index.ros.org/doc/ros2/Tutorials/Launch-Files/Creating-Launch-Files/. Accessed 12 May 2020

  14. ROS2 Topic Source Code, https://github.com/ros2/ros2cli/tree/master/ros2topic. Accessed 12 May 2020

  15. Statistics Data Type Definition, https://github.com/ros2/rcl_interfaces/blob/master/statistics_msgs/msg/StatisticDataType.msg. Accessed 12 May 2020

  16. ROS2 Lifecycle Source Code and Tutorials, https://github.com/ros2/demos/blob/master/lifecycle/README.rst. Accessed 12 May 2020

  17. 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

  18. ROS2 Composition Tutorial, https://index.ros.org/doc/ros2/Tutorials/Composition/. Accessed 12 May 2020

  19. 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

  20. Launch Actions Tutorial, https://index.ros.org/doc/ros2/Tutorials/Composition/#composition-using-launch-actions. Accessed 12 May 2020

  21. Laser Scan Message Definition, https://github.com/ros2/common_interfaces/blob/master/sensor_msgs/msg/LaserScan.msg. Accessed 12 May 2020

  22. GitHub Pricing, https://github.com/pricing. Accessed 15 May 2020

  23. GitHub Actions, https://github.com/features/actions. Accessed 15 May 2020

  24. GitHub Actions Marketplace, https://github.com/marketplace?type=actions. Accessed 15 May 2020

  25. GitHub Actions starter workflows, https://github.com/actions/starter-workflows

  26. GitHub Actions documentation, https://help.github.com/en/actions. Accessed 15 May 2020

  27. Colcon tool documentation, https://colcon.readthedocs.io/en/released/. Accessed 15 May 2020

  28. ROS Tooling Working Group’s GitHub organization, https://github.com/ros-tooling/. Accessed 15 May 2020

  29. colcon-mixin-repository Git repository, https://github.com/colcon/colcon-mixin-repository. Accessed 15 May 2020

  30. colcon mixin verb documentation, https://colcon.readthedocs.io/en/released/reference/verb/mixin.html. Accessed 15 May 2020

  31. ROS 2 Quality Guide, https://index.ros.org/doc/ros2/Contributing/Quality-Guide/. Accessed 15 May 2020

  32. ROS 2 Developer Guide, https://index.ros.org/doc/ros2/Contributing/Developer-Guide/. Accessed 15 May 2020

  33. colcon-lcov-result Git repository URL, https://github.com/colcon/colcon-lcov-result. Accessed 15 May 2020

  34. lcov Git repository, https://github.com/linux-test-project/lcov. Accessed 15 May 2020

  35. CodeCov.io GitHub Action, https://github.com/marketplace/actions/codecov. Accessed 15 May 2020

  36. Codecov.io website, https://codecov.io/. Accessed 15 May 2020

  37. AddressSanitizer documentation, https://github.com/google/sanitizers/wiki/AddressSanitizer. Accessed 15 May 2020

  38. ThreadSanitizer documentation on GitHub, https://github.com/google/sanitizers. Accessed 15 May 2020

  39. Ament Linters GitHub source package, https://github.com/ament/ament_lint. Accessed 16 Sep 2020

  40. Ament Lint Auto GitHub source package, https://github.com/ament/ament_lint/tree/master/ament_lint_auto. Accessed 16 Sep 2020

  41. GCC instrumentation options, https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.html. Accessed 15 May 2020

  42. Coverage.py Python module, https://coverage.readthedocs.io/en/coverage-5.1/. Accessed 15 May 2020

  43. AWS Robotics: Springer ROS Book Sample Code, https://github.com/aws-robotics/ros-book-sample-code. Accessed 15 May 2020

  44. Official Bloom Documentation, https://bloom.readthedocs.io/en/0.5.10. Accessed 15 May 2020

  45. Bloom Tutorials: Releasing a Package for the First Time, http://wiki.ros.org/bloom/Tutorials/FirstTimeRelease. Accessed 15 May 2020

  46. ROS Discourse, https://discourse.ros.org. Accessed 15 May 2020

  47. REP-149: Package Manifest Format Three Specification, https://ros.org/reps/rep-0149.html. Accessed 18 May 2020

  48. Semantic Versioning 2.0.0, https://semver.org. Accessed 15 May 2020

  49. ROS2 CloudWatch Metrics Source Code and Documentation, https://github.com/aws-robotics/cloudwatchmetrics-ros2. Accessed 15 May 2020

  50. CloudWatch Metrics Alarms, https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html. Accessed 15 May 2020

  51. 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

  52. ROS2 Monitoring Message Definition, https://github.com/aws-robotics/monitoringmessages-ros2. Accessed 15 May 2020

  53. CloudWatch Metrics Offline Blog Post and Setup Information, https://aws.amazon.com/blogs/opensource/robomaker-cloudwatch-ros-nodes-offline-support/. Accessed 15 May 2020

  54. Debian Deboostrap Tool, https://wiki.debian.org/Debootstrap. Accessed 16 Sept 2020

  55. ROS 2 Cross Compile Legacy Instructions, https://index.ros.org/doc/ros2/Tutorials/Cross-compilation/#legacy-tool-instructions. Accessed 30 Sept 2020

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Emerson Knapp .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2021 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

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

Publish with us

Policies and ethics