> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cerulion.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Message types

> The native_ros2_messages packages, representative types, the ROS2-to-Rust type mapping, and the generated type triple.

Cerulion ships ROS2-compatible message types in the `native_ros2_messages` crate, generated from ROS2 Jazzy `.msg` files at build time. There are 20 packages.

Import a type from its package:

```rust theme={null}
use native_ros2_messages::sensor_msgs::Image;
```

## Packages and representative types

The following table lists the packages with representative types from each. Type names are the PascalCase form of the source `.msg` file.

| Package                   | Representative types                                                                                                                                                |
| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `action_msgs`             | Action-related message types.                                                                                                                                       |
| `builtin_interfaces`      | Time, Duration.                                                                                                                                                     |
| `control_msgs`            | JointTrajectoryControllerState, DynamicJointState, JointJog, PidState, GripperCommand.                                                                              |
| `diagnostic_msgs`         | Diagnostic message types.                                                                                                                                           |
| `geometry_msgs`           | Point, Point32, Pose, Pose2D, PoseArray, Quaternion, Transform, Twist, Vector3, Accel, Inertia, Polygon.                                                            |
| `grid_map_msgs`           | GridMap, GridMapInfo.                                                                                                                                               |
| `moveit_msgs`             | CollisionObject, AttachedCollisionObject, DisplayTrajectory, Constraints, Grasp.                                                                                    |
| `nav_msgs`                | Odometry, Path, OccupancyGrid, MapMetaData, GridCells.                                                                                                              |
| `object_recognition_msgs` | RecognizedObject, RecognizedObjectArray, ObjectInformation.                                                                                                         |
| `octomap_msgs`            | Octomap, OctomapWithPose.                                                                                                                                           |
| `radar_msgs`              | RadarReturn, RadarScan, RadarTrack, RadarTracks.                                                                                                                    |
| `sensor_msgs`             | Image, Imu, LaserScan, JointState, PointCloud2, CameraInfo, CompressedImage, NavSatFix, BatteryState, Range.                                                        |
| `shape_msgs`              | Shape primitive types.                                                                                                                                              |
| `statistics_msgs`         | Statistics message types.                                                                                                                                           |
| `std_msgs`                | Header, String, Bool, Byte, Char, ColorRGBA, Empty, Float32/64, Int8/16/32/64, UInt8/16/32/64, and the `*MultiArray` family.                                        |
| `tf2_msgs`                | Transform-tree message types.                                                                                                                                       |
| `trajectory_msgs`         | Trajectory types.                                                                                                                                                   |
| `unique_identifier_msgs`  | UUID.                                                                                                                                                               |
| `vision_msgs`             | Detection2D, Detection2DArray, Detection3D, Detection3DArray, BoundingBox2D, BoundingBox3D, Classification, ObjectHypothesis, ObjectHypothesisWithPose, VisionInfo. |
| `visualization_msgs`      | Marker, MarkerArray.                                                                                                                                                |

## ROS2-to-Rust type mapping

`schema info` displays Rust types using this mapping:

| ROS2 type        | Rust type |
| ---------------- | --------- |
| `bool`           | `bool`    |
| `byte` / `uint8` | `u8`      |
| `char` / `int8`  | `i8`      |
| `uint16`         | `u16`     |
| `int16`          | `i16`     |
| `uint32`         | `u32`     |
| `int32`          | `i32`     |
| `uint64`         | `u64`     |
| `int64`          | `i64`     |
| `float32`        | `f32`     |
| `float64`        | `f64`     |
| `string`         | `String`  |
| `T[]`            | `Vec<T>`  |

## Fixed vs variable fields

Fixed-size primitive fields are written directly — the write goes straight to shared memory, for example `self.image.height = 480`.

Variable-length fields (`string`, `T[]`) must be listed in the `#[output(...)]` attribute; once listed, plain assignment works for them too. See the [Node macro reference](/cerulion/reference/node-macro) for the `#[output(...)]` keys.

```rust theme={null}
use native_ros2_messages::sensor_msgs::Image;
// in tick (with #[output(data, encoding)] image: Image):
self.image.height = 480;            // fixed field, direct write
self.image.width  = 640;
self.image.encoding = "rgb8";       // variable field — plain assignment, listed in #[output]
```

In your node struct, a message type is used by name as a port field — for
example `image: Image` — and read or written through plain field access inside
`tick()`.
