ROS 2 Documentation

repository·rolling·Indexed 21 days ago

https://github.com/ros2/ros2_documentation

Source files for the official ROS 2 documentation hosted at docs.ros.org. This repository uses Sphinx to build HTML documentation and includes guides on real-time programming, URDF models, simulation demos like the dummy robot, and middleware features such as topic keys for Fast DDS and Connext.

Tokens
265.6K
Snippets
760
Records
1.1K
Agent score
75%

What's inside ros2_documentation

  1. Overview of MVSim for ROS 2

    rolling

    MVSim is a lightweight, open-source, multi-vehicle simulator designed for 2D and 3D visualization of mobile robots. It is optimized for testing navigation, SLAM, and multi-robot coordination with low computational overhead.

    Key Features:

    • Physics Engine: Uses Box2D for 2D rigid body physics.
    • Vehicle Dynamics: Supports realistic models including differential drive and Ackermann steering.
    • Sensor Simulation: Provides 2D/3D LiDARs, cameras, IMUs, and GPS.
    • Integration: Features native ROS 2 integration.
  2. Overview of ament_cmake build system

    rolling

    ament_cmake is the specialized build system used for CMake-based packages in ROS 2, primarily targeting C/C++ projects. It functions as a set of scripts that enhance standard CMake by adding convenience functionality and ROS 2-specific features for package authors.

    Prerequisite: It is highly recommended to have a foundational understanding of standard CMake before using ament_cmake.

  3. Overview of ROS 2 Core Features and Platform Support

    rolling

    ROS 2 provides a wide range of functionalities for robotics development. Unless otherwise specified, features are available across all supported platforms (Ubuntu 24.04 (Noble), Windows 10), supported DDS implementations (eProsima Fast DDS, RTI Connext DDS, and Eclipse Cyclone DDS), and programming language client libraries (C++ and Python).

    Core Communication & Middleware:

    • DDS-based Discovery & Transport: Uses DDS for discovery, transport, and serialization.
    • Multiple RMW Implementations: Supports choosing different Middleware (RMW) implementations at runtime (e.g., Eclipse Cyclone DDS, eProsima Fast DDS, RTI Connext DDS).
    • Communication Patterns: Supports Publish/Subscribe (Topics), Clients/Services, and Actions.
    • Quality of Service (QoS): Settings available to handle non-ideal network conditions.
    • Namespacing & Remapping: Supports namespaces for nodes/topics and static remapping of ROS names.

    Advanced Node & System Capabilities:

    • Lifecycle Management: Support for managed nodes (C++ only).
    • Node Composition: Ability to compose nodes at compile, link, load, or run time (C++ only).
    • Intra-process Communication: High-performance communication within the same process (C++ only).
    • Launch System: A dedicated system for coordinating multiple nodes.
    • Security: DDS-Security support via sros2.

    Specialized Support:

    • Real-time: Preliminary support for real-time code (Linux only; not available for Fast RTPS).
    • Microcontrollers: Preliminary support for "bare-metal" microcontrollers.
    • Pluggable Buffer Backends: Experimental support for uint8[] fields (e.g., GPU memory transport), currently supported in rmw_fastrtps_cpp and available via C++ APIs.
  4. Overview of ROS 2 Launch files

    rolling

    ROS 2 Launch files are used to start up and configure multiple executables containing ROS 2 nodes simultaneously. They provide a way to manage complex system startups by defining which nodes to run, their configurations, and how they interact.

    Key capabilities include:

    • Creating launch files: Starting up nodes and their configurations in a single file.
    • Launching and monitoring: Managing the lifecycle and monitoring of multiple nodes.
    • Substitutions: Using dynamic values to make launch files reusable.
    • Event Handlers: Monitoring process states or defining rules to dynamically modify the launch system based on events.
    • Large Project Management: Structuring launch files for scalability using parameters, YAML files, remappings, namespaces, and RViz configurations.
  5. Understand ROS 2 core terminology

    rolling

    This glossary defines key terms used throughout the ROS 2 documentation to ensure consistent understanding of the software architecture and development ecosystem.

    Software Units and Interfaces

    • API (Application Programming Interface): A contract between software using an interface and the software providing it. In ROS 2, these are typically C/C++ header files or Python files. Public interfaces are subject to versioning rules.
    • client_library: An API that provides access to the ROS graph using primitive middleware concepts like Topics, Services, and Actions.
    • package: The fundamental unit of ROS 2 software, containing source code, build system files, documentation, tests, and resources.
    • repository: A collection of packages managed by a Version Control System (VCS) like git.

    ROS Specific Standards

    • REP (Robotics Enhancement Proposal): Documents describing enhancements, standardizations, or conventions for the ROS community. Approved REPs become part of the official documentation. You can view the REP index.

    Language Specifics

    • rclcpp: The C++ client library for ROS, providing middleware APIs and message generation for C++ data structures.
  6. Identify ROS integrations and supported platforms

    rolling

    ROS integrates with several specialized platforms to enhance development:

    • Gazebo: Provides physics-based simulation for testing robots in virtual environments.
    • Open-RMF (Robotics Middleware Framework): Facilitates coordination between different robots and building systems (e.g., lifts, doors).
    • ros-controls: Enables real-time control of robotic hardware.

    Supported Operating Systems

    ROS runs on Ubuntu, Windows, and macOS.

    Note: It is strongly recommended to use a Tier 1 platform for your ROS distribution. While macOS is supported by the community, it is not recommended for new users. Ubuntu support is distribution-specific, with each ROS distribution requiring a specific Ubuntu LTS (Long-Term Support) release.

  7. Use topic keys with subscription filtering in ROS 2

    rolling
    ROS 2 supports subscription filtering using topic keys when using specific RMW (ROS Middleware) implementations like Fast DDS or Connext DDS. This feature allows a subscriber to filter incoming messages based on a specific key value defined in the topic's key field, reducing unnecessary data processing by filtering at the middleware level.
  8. Summary of using parameters in a Python class

    rolling

    In this tutorial, you learned how to create a ROS 2 node in Python that utilizes custom parameters. These parameters can be configured externally via launch files or the command line. The process involves:

    1. Defining custom parameters within a Python class.
    2. Adding necessary dependencies, executables, and launch files to the package configuration files.
    3. Building and running the package to verify parameter functionality.
  9. Use Ament Lint CLI Utilities for code quality

    rolling
    The ament_lint family of CLI tools are Python-based utilities used to identify and fix code quality issues in ROS 2 software. These tools help ensure that your code meets the official ROS project coding standards. While ament tools can be used with any build system, a specific subset called ament_cmake tools is optimized for CMake-based development. It is recommended to run these linting tools locally before submitting pull requests to ensure compliance with ROS 2 style and quality guidelines.
  10. Available DDS implementations for ROS 2

    rolling

    ROS 2 supports several Data Distribution Service (DDS) implementations. The following vendors are documented for use with ROS 2:

    • Eclipse Cyclone DDS
    • eProsima Fast DDS
    • RTI Connext DDS
    • GurumNetworks GurumDDS

    To use a vendor not listed above, you must install their software separately before building ROS 2. If the vendor software is installed and sourced correctly, the ROS 2 build process will automatically include support for it.

  11. What is rosdep and how does it work?

    rolling

    rosdep is a meta-package management utility used to identify and install system dependencies required to build or run ROS packages. It is not a package manager itself; instead, it maps "rosdep keys" found in a package's package.xml to the actual package names used by your system's package manager (such as apt on Ubuntu, dnf on Fedora, etc.).

    Key Workflow:

    1. rosdep scans package.xml files for dependency keys.
    2. It cross-references these keys against a central index called rosdistro.
    3. It invokes the system package manager to install the resolved dependencies.

    Note: rosdep currently supports Linux and macOS. Windows is not supported.

  12. What is tf2 and how does it work?

    rolling

    tf2 is the transform library in ROS 2. It allows users to track multiple coordinate frames over time by maintaining their relationships in a time-buffered tree structure.

    Key capabilities include:

    • Transforming points, vectors, and other data between any two coordinate frames at any desired point in time.
    • Operating in distributed systems, where transform information can be gathered by a central node or built locally by every component.
    • Answering spatial queries such as: "Where is the gripper relative to the base?" or "What was the pose of the head frame relative to the world 5 seconds ago?"

    Note that tf2 handles the mathematical inversion required when traversing the transform tree, but users must be aware of the distinction between transforming data and transforming frames.