CAN

can_msgs

This is the ROS can msgs. Represented a frame, which we’ll need to decode.

https://docs.ros.org/en/noetic/api/can_msgs/html/msg/Frame.html

Header header  
uint32 id  
bool is_rtr  
bool is_extended  
bool is_error  
uint8 dlc  
uint8[8] data
  • uint32 id:

    • This field represents the identifier (ID) of the CAN frame.
    • The CAN ID can be either 11 bits (standard CAN) or 29 bits (extended CAN). The ID is used to determine the priority of the frame on the CAN bus, with lower numbers indicating higher priority.
  • bool is_rtr:

    • This boolean field indicates whether the frame is a Remote Transmission Request (RTR) frame.
    • If true, the frame is a remote frame, meaning it is a request for data from another node. If false, it’s a data frame, meaning it carries actual data.
  • bool is_extended:

    • This field specifies whether the CAN ID is extended (29 bits) or standard (11 bits).
    • If true, the CAN frame uses an extended 29-bit identifier. If false, it uses a standard 11-bit identifier.
  • bool is_error:

    • This field indicates whether the frame is an error frame.
    • If true, the frame is an error frame, which is used to signal errors in the CAN network. If false, it’s a normal data or remote frame.
  • uint8 dlc:

    • DLC stands for Data Length Code. This field represents the number of data bytes in the frame.
    • The value ranges from 0 to 8, as CAN frames can carry a maximum of 8 bytes of data.
  • uint8[8] data:

    • This array holds the actual data carried by the CAN frame.
    • The array size is fixed at 8, corresponding to the maximum number of data bytes in a CAN frame. If the dlc is less than 8, the unused bytes in the data array are typically ignored.