CAN output
The controller can send the final
autoware_control_msgs/msg/Control command over DDS, CAN, or both. DDS
inputs are unchanged; only the final control-command output is gated by this
mode.
Output modes
CONFIG_CONTROL_CMD_OUTPUT_* selects one mode at build time:
DDS_ONLY— publish/control/trajectory_follower/control_cmdonly.CAN_ONLY— send CAN frames only.DDS_AND_CAN— publish DDS and send CAN frames.
Current defaults:
zephyr-fvp:DDS_ONLY. TAP plus the UDP tunnel selectsCAN_ONLYorDDS_AND_CANexplicitly.zephyr-s32z:DDS_AND_CAN.freertos-posix:DDS_ONLY. SocketCAN is selected with--control-output CAN_ONLYorDDS_AND_CANandSAFETY_ISLAND_CAN_IFACE. The in-memory mock is test-only.freertos-s32z2/freertos-x5h:DDS_ONLY; CAN is not part of this stack on those targets.
Frame format
The CAN mapping is a placeholder contract intended for integration testing and early bring-up. Each command produces three classic 8-byte CAN frames:
CAN ID |
Payload |
Scaling |
|---|---|---|
|
steering angle, steering rate |
signed little-endian |
|
velocity, acceleration |
signed little-endian |
|
output mode and supervisor decision, flags, sequence, timestamp, fault id, CRC |
see the status frame layout below |
Non-finite command values are rejected before any CAN frame is sent.
Status frame
0x102 closes a command and tells the receiver what the supervisor decided:
Byte |
Content |
|---|---|
0 |
bits 0-1: output mode ( |
1 |
flags: |
2-3 |
sequence, little-endian |
4-5 |
producer timestamp in ms modulo 65536, little-endian |
6 |
fault id of the latched fault, |
7 |
CRC-8 SAE J1850 (polynomial |
The decision is the one on ApprovedRequest: with CAN as the only output, a
receiver can tell an SI_STOP from a normal command and read which fault
caused it. The payload of an SI_STOP or HOLD command is the stop
command itself, so a receiver that only applies the payload still stops.
The CRC covers all three frames. A receiver must reject a command whose CRC
does not match, and must reject a status frame without the 0x10 flag:
that is the earlier layout, which carried a 32-bit timestamp in bytes 4-7 and
no decision, fault id or CRC.
The CRC also catches most commands assembled from frames of different cycles,
but not all: 0x100 and 0x101 carry no sequence number, so a stale
lateral or longitudinal frame combined with a fresh status frame is rejected
only when the 8-bit CRC differs, about 255 times in 256. A receiver that needs
a deterministic check uses the CAN-FD frame 0x103 below, which carries all
three payloads in one frame.
freertos-posix can instead send the same three payloads as one 24-byte
CAN-FD frame 0x103 when SAFETY_ISLAND_CAN_FORMAT=fd is set. That mode
is opt-in and documented in CAN-FD; every other runtime stays classic.
Backends
Zephyr uses the selected zephyr,canbus device. The S32Z @D overlay sets
this to &can0 in actuation_module/boards/s32z270dc2_rtu0_r52@D.overlay.
Real bus validation requires the board CAN pins to be connected to an external
CAN transceiver and bus.
freertos-posix uses Linux SocketCAN when CAN output is enabled and
SAFETY_ISLAND_CAN_IFACE is set. The in-memory mock is compiled only
into --can-output-test. That test program
(actuation_module/test/can_output_test.cpp) validates the encoder,
output modes, and recorded mock frames.
Host SocketCAN (vcan or a real adapter), the Zephyr FVP UDP tunnel, and
the CARLA ego bridge are specified in CAN and CARLA integration and
CAN and CARLA implementation plan. Those paths sit on top of this
placeholder contract and carry the frames unchanged.