ros-industrial / ros_canopen

CANopen driver framework for ROS (http://wiki.ros.org/ros_canopen)
GNU Lesser General Public License v3.0
332 stars 270 forks source link

ROS2 foxy updating can_msg #421

Closed kamakshijain closed 3 years ago

kamakshijain commented 3 years ago

Screenshot from 2021-01-21 12-40-51

I am trying to publish a can_msg type ros2 topic and monitor it as seen in the screenshot. Everything apart from data is getting updated and I can view it on the topic monitor of rqt and on the terminal but data isn't getting updated. I am not able to publish the topic from my command line as the format is confusing. Please help.

ros2 topic pub /send_message can_msgs/msg/Frame header:\
\ \ stamp:\
\ \ \ \ sec:\ 0\
\ \ \ \ nanosec:\ 0\
\ \ frame_id:\ \'\'\
id:\ 0\
is_rtr:\ false\
is_extended:\ false\
is_error:\ false\
dlc:\ 0\
data:\
-\ 0\
-\ 0\
-\ 0\
-\ 0\
-\ 0\
-\ 0\
-\ 0\
-\ 0\ 

@ipa-mdl (since you have been a major contributor and you released can_msg in foxy)

Thank you

mathias-luedtke commented 3 years ago

not able to publish the topic from my command line as the format is confusing.

This seems to be a bug https://github.com/ros2/ros2cli/issues/563

For now, you have to publish the command line yourself (no tab), e.g.:

 ros2 topic pub test can_msgs/msg/Frame "{data: [1,2,3,4,5,6,7,8], id: 0x123}"

Everything apart from data is getting updated and I can view it on the topic monitor of rqt and on the terminal but data isn't getting updated.

If I use the above script to publish data, I get the proper output with ros2 topic echo test:

header:
  stamp:
    sec: 0
    nanosec: 0
  frame_id: ''
id: 291
is_rtr: false
is_extended: false
is_error: false
dlc: 0
data:
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
---

Everything works as expected!

I think this is a bug in one of the RQT plugins.