Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Socketcan_bridge : Error when publishing on sent_messages topic

Hi I am running socketcan_bridge package and trying to publish a can_msgs/Frame type message to a rostopic using the command

rostopic pub -r 10 /sent_messages can_msgs/Frame 'header: seq: 0 stamp: {secs: 0, nsecs: 0} frame_id: '' id: 0x29F is_rtr: false is_extended: false is_error: false dlc: 8 data: [53,70,40,00,00,00,40,6a] ' from terminal, but it is throwing an error as follows

ERROR: Unable to publish message. One of the fields has an incorrect type: field data[] must be unsigned integer type

msg file: std_msgs/Header header uint32 seq time stamp string frame_id uint32 id bool is_rtr bool is_extended bool is_error uint8 dlc uint8[8] data

The problem is due to '6a' which is not uint8. Should I change the data type in .msg to account for this? If so, what should it be to accommodate hex values. Is there any way I can change data field in the command itself without changing .msg? thanks

click to hide/show revision 2
None

Socketcan_bridge : Error when publishing on sent_messages topic

Hi I am running socketcan_bridge package and trying to publish a can_msgs/Frame type message to a rostopic using the command

rostopic pub -r 10 /sent_messages can_msgs/Frame 'header:
  seq: 0
  stamp: {secs: 0, nsecs: 0}
  frame_id: ''
id: 0x29F
is_rtr: false
is_extended: false
is_error: false
dlc: 8
data: [53,70,40,00,00,00,40,6a]

' from terminal, but it is throwing an error as follows

ERROR: Unable to publish message. One of the fields has an incorrect type:
  field data[] must be unsigned integer type

type msg file: std_msgs/Header header uint32 seq time stamp string frame_id uint32 id bool is_rtr bool is_extended bool is_error uint8 dlc uint8[8] data

data

The problem is due to '6a' which is not uint8. Should I change the data type in .msg to account for this? If so, what should it be to accommodate hex values. Is there any way I can change data field in the command itself without changing .msg? thanks