ros2-common_interfaces

repository·rolling·Indexed 18 days ago

https://github.com/ros2/common_interfaces

A metapackage containing the standard set of ROS messages (.msg) and services (.srv) used across all ROS systems to ensure interoperability. It includes specialized packages such as diagnostic_msgs for robot health, geometry_msgs for geometric primitives, nav_msgs for navigation tasks, sensor_msgs for sensor data, shape_msgs for 3D shapes, and std_msgs for basic primitive types.

Tokens
11.8K
Snippets
3
Records
90
Agent score
62%

What's inside ros2-common_interfaces

  1. Overview of sensor_msgs package

    rolling
    The sensor_msgs package provides a standardized set of messages and services for communicating data from various sensor devices in ROS 2. It includes support for common sensors such as cameras, IMUs, LiDAR, GPS, and battery systems. Many of these interfaces are ported from ROS 1 and maintain compatibility with established sensor data formats.
  2. What is common_interfaces

    rolling
    The common_interfaces repository is a metapackage containing the standard set of ROS messages (.msg) and services (.srv) used across the entire ROS ecosystem. It serves as a shared dependency layer, allowing different ROS stacks to communicate with each other without creating circular dependencies. By using these standardized interfaces, nodes in separate packages can exchange data seamlessly.
  3. Use geometry_msgs for geometric primitives

    rolling
    The geometry_msgs package provides standard message types for common geometric primitives used throughout ROS 2. These messages facilitate interoperability by providing a common data format for points, vectors, poses, velocities, and more. Use these messages when communicating spatial information, such as the position of an object, the orientation of a robot, or the velocity of a moving part.
  4. Use std_msgs for basic message types

    rolling

    The std_msgs package provides fundamental message types for ROS 2. It includes standard metadata headers, color representations, and wrappers for primitive data types.

    Best Practice Warning: Most primitive and array types in std_msgs (like Int32, String, etc.) use a generic field name data. Because they lack semantic meaning, they are recommended for quick prototyping but are NOT intended for long-term production use. For robust applications, you should use existing specialized messages or create new custom messages with meaningful field names that describe the data they contain.

  5. Use shape_msgs for 3D shape descriptions

    rolling

    The shape_msgs package provides a set of standardized messages for describing 3-dimensional shapes, primarily used for visualization and collision detection tasks in ROS 2.

    Available message types include:

    • Mesh: Contains data describing a mesh for visualization and collision detection.
    • MeshTriangle: Represents a single triangle within a mesh.
    • Plane: Represents a plane using the plane equation $ax + by + cz + d = 0$.
    • SolidPrimitive: Describes simple geometric primitives such as boxes, spheres, cylinders, and cones.
  6. Use trajectory_msgs for robotic joint trajectories

    rolling

    The trajectory_msgs package provides standard message definitions for describing coordinated sequences of joint configurations over time. It is primarily used for motion planning and control of robotic joints.

    Available message types:

    Standard Joint Trajectories

    • JointTrajectory: A coordinated sequence of joint configurations to be reached at prescribed time points.
    • JointTrajectoryPoint: A single configuration for multiple joints within a JointTrajectory.

    Multi-DOF Trajectories

    • MultiDOFJointTrajectory: A representation of a multi-degree-of-freedom (multi-dof) joint trajectory where each point represents a transformation.
    • MultiDOFJointTrajectoryPoint: A single configuration for multiple joints within a MultiDOFJointTrajectory.
  7. Use visualization_msgs for 3D visualization in ROS GUI programs

    rolling
    The visualization_msgs package provides the standard message and service definitions required to visualize 3D information in ROS GUI applications, most notably RViz. It includes support for non-interactive annotations (Markers), interactive objects for user manipulation (InteractiveMarkers), and image overlays (ImageMarkers).
  8. Use DisparityImage messages in stereo_msgs

    rolling
    The stereo_msgs package provides a specific message type for describing a disparity image, which is a floating-point representation of the difference in image location of an object seen by the left and right eyes of a stereo camera system. Use the DisparityImage message type to transmit disparity data along with its associated metadata.
    DisparityImage
  9. Understand the orientation in Imu messages

    rolling
    When using the sensor_msgs/msg/Imu message, the orientation field is defined relative to the coordinate frame specified in the header.frame_id. The message itself does not enforce a specific convention (like ENU or NED); the consumer must interpret the orientation based on the frame metadata provided in the header.
  10. Understand the versioning and stability of sensor_msgs

    rolling

    The sensor_msgs package follows the semver (Semantic Versioning) scheme used for ROS Core packages.

    • Version Stability: The package is at a stable version (>= 1.0.0).
    • API/ABI Stability: Within a released ROS distribution, the package guarantees no breaking changes to the public API or the C++ ABI.
  11. Differentiate between semantically similar geometry_msgs types

    rolling

    Some message types in geometry_msgs share the same underlying data structure but are used for different semantic purposes. Do not assume they are interchangeable in your code logic:

    • Point vs Vector3: These are the same data structure but represent different concepts (a location in space vs. a direction/magnitude).
    • Pose vs Transform: These are the same data structure but serve different semantic roles in robotics applications.