ros-industrial / ros_canopen

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

socketcan_bridge - sent_messages: Decimal conversion #355

Closed Prj1508 closed 4 years ago

Prj1508 commented 4 years ago

I am trying to publish a message (of type can_msgs/Frame) to sent_message topic in socketcan_bridge. For the id i am providing appropriate hex value ( 0x29F) in this case, but when I echo sent_messages, it is actually converting this hex into decimal (671) and hence I am not able to publish this can message correctly. Can you pleas help?

mathias-luedtke commented 4 years ago

Can you pleas help?

As I already told you (https://github.com/ros-industrial/ros_canopen/issues/352#issuecomment-531140132), this issue tracker is meant for bug reporting and feature requests.

If you need further support, please ask a question at ROS answers, if it was not answered there yet. I will close this issue here.

For the id i am providing appropriate hex value ( 0x29F) in this case, but when I echo sent_messages, it is actually converting this hex into decimal (671)

In most (if not all) programming languages, 0x29F and 671 can be interchanged, because they are just different representations (for humans!) of the same data, which in this case is a 32-bit unsigned integer.

Prj1508 commented 4 years ago

thanks. I have asked this question on ROS Answers already, but havent got any reponse. I know those 2 are same values, but I think the CAN frame should have exact unique id (29F in this case) to be heard by CAN bus.

Prj1508 commented 4 years ago

Also, this hex to decimal conversion happens only when I am on can0. When I am using vcan0, there is no conversion and I can see hex as is when I echo this topic