Closed bbferka closed 3 years ago
Hi. Thank you for the pull request. This package was created to handle communication with "rosbridge_suite" using WebSocket and JSON messages. However, it hasn't been maintained for a year and is designed to work with ROS2 Dashing and ROS1 Kinetic in the first place.
The communication using the rosbridge was between ROS1 Websocket server - ROS2 client for an internal project. Therefore, the dictionaries created with convert_ros_message_to_dictionary
actually generate the dictionary for ROS1, which is nsecs and secs. Therefore, dictionaries are processed and generated as ROS1 type, and messages are processed and generated as ROS2 type. This might be the cause of that error. Also, the latest updated branch was foxy, not master. It might be fixed on that branch. As I mentioned, this package was for a specific internal project and might not be suitable for all cases.
I might divide the message conversion to be generic, so the generated dictionaries might be configured to be either ROS1 type or ROS2 type. I will get back to this when I have time.
Again, thank you for the PR. I appreciate it.
@mehmetkillioglu thanks for getting back on this; Will close this PR now since the changes of @marshallpt are more complete;
The current implementation fails to convert timestamps to dicts and back; To reconstruct simply run:
This will throw the following AttributeError:
This PR addresses this issue by first renaming
nsecs
andsecs
tonanosec
andsec
respectively and by actually disabling the check for timestamp field_types. In ROS2 Timestamps are just another type of message, so general conversion works fine.