If the DLC(Data Length Code) is less than 8, the previously received data remains in the "data" field of the topic sent by ros2_socketcan.
When supporting multiple types of HW with the same CAN-ID but different DLCs, unintended behavior may occur if garbage is included in the reception result of can_receiver.
I checked with the following steps.
Preparation
Install can-utils
sudo apt install can-utils
Enable vcan
sudo modprobe vcan
sudo ip link add dev vcan0 type vcan
sudo ip link set up vcan0
Description
If the DLC(Data Length Code) is less than 8, the previously received data remains in the "data" field of the topic sent by ros2_socketcan.
When supporting multiple types of HW with the same CAN-ID but different DLCs, unintended behavior may occur if garbage is included in the reception result of can_receiver.
I checked with the following steps.
Preparation
Procedure
Send the following CAN data with cansend.
Output