ROS2 & J1939

Due to CSS Electronic “SAE J1939 is a set of standards that define how ECUs communicate via the CAN bus in heavy-duty vehicles”. At the end it is a specific CAN de-/encoding (aka protocol) of the byte bunch (aka frame) which is passed through the Controller Area Network (CAN) bus.

Usually the protocol use the communication mechanism of broadcasts. J1939 in addition ads request-response information. Additionally J1939 is not restricted on one frame per information unit. The multibyte variables & multi-packets mechanism allows to send huge portions of data, constructing information out of multiple frames. This feature is commonly referred via the abbreviations PGN and SPN. PGN as a group of parameter and SPN as the IDs of specific parameter in the group – simply a map-struct with one to many values.

Let assume that we intend to publish and subscribe data to and from ROS2 topics. If so we require a ROS2 node which is reading and writing frames from and to the CAN bus. IMHO a good OSS starting point is given here on GitHub (for J1939 use the framework referenced down below).

So now we have CAN frames in the hand, but we have to interpret them – the de-/encoding task. A common way of describing the de-/encoding is to use so called DBC files. A nice explanation of CSS electronics can be found here. An DBC reader project can be found on GitHub here.

A J1939 framework interpreting J1939 can be found here on GitHub – the frames.json is missing 🙁

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *