CAN Transmit
Transmit messages to controller area network (CAN) bus from ROS 2 network
Since R2026a
Libraries:
ROS Toolbox /
ROS 2
Description
This feature also requires the Vehicle Network Toolbox™ product when transmitting message as a structured CAN message.
The CAN Transmit block transmits messages to a CAN network using a real
or virtual CAN interface on your target machine. It enables the Simulink® model to send data formatted as a raw uint8 vector, ROS 2
message, or a structured CAN message containing fields such as ID, length, and data. Use this
block to transmit CAN messages in external mode execution and code generation workflows. For
more information on how to set up a virtual CAN interface, see Set Up Virtual CAN Interface.
You can configure the block to wait for successful transmission (blocking mode) or to continue execution without waiting (non-blocking mode). The block is designed to work with ROS 2 nodes that support CAN device integration through supported drivers. It supports code generation and external mode workflows involving ROS 2 and CAN-enabled embedded systems.
This image shows a ROS 2-CAN node that you can deploy on hardware. This node acts as a bridge between the CAN device and the ROS 2 network, thereby enabling the transmission and reception of CAN messages.
For the Raw Data input type, you can apply message filters such as
Identifier type,
Message ID, and
Message length from
the block dialog box parameters.
For the ROS Msg or CAN Msg input type, you can set
message filters such as ID Type, Acceptance
Mask, and Acceptance Filter using the steps listed in Configure CAN Interfaces and Apply Message Filtering.
Examples
Ports
Input
Output
Parameters
Extended Capabilities
Version History
Introduced in R2026a

