Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: Foxy-devel #56

Closed
wants to merge 17 commits into from
Closed

Draft: Foxy-devel #56

wants to merge 17 commits into from

Conversation

relffok
Copy link

@relffok relffok commented Nov 18, 2021

Hi there,

I started porting this to foxy a while ago. I also needed to port the tests, so there is no qualified statement whether this works as intended or not. I use it for the mir_bridge (see DFKI-NI/mir_robot#96) and it does it's job.
I'm sure there will be some issues (there are 2 failures I could not fix so far but unfortunately ported this a while ago and forgot about the PR), so feedback would be great on this!

Also since I renamed the package from rospy_message_converter to rclpy_message_converter I think a little bit of git history went missing. Sorry about that.

@relffok relffok mentioned this pull request Nov 18, 2021
@mintar
Copy link
Member

mintar commented Nov 22, 2021

Thanks for the PR! I'll look into it as soon as I find the time!

@rcywongaa
Copy link

rcywongaa commented Apr 23, 2022

FWIW, this is also working on galactic 👍

        goal_msg.trajectory.points = [
          message_converter.convert_dictionary_to_ros_message('trajectory_msgs/JointTrajectoryPoint',
          {
            "positions": [0.2, 0.0, 0.0, 0.0, 0.0, 0.0],
            "time_from_start": [1, 0]
          })
        ]

though this doesn't work

        goal_msg.trajectory.points = [
          message_converter.convert_dictionary_to_ros_message('trajectory_msgs/JointTrajectoryPoint',
          {
            "positions": [0.2, 0.0, 0.0, 0.0, 0.0, 0.0],
            "time_from_start": Duration(seconds=1)
          })
        ]

(http://docs.ros.org/en/api/trajectory_msgs/html/msg/JointTrajectoryPoint.html)

Thanks a lot for doing this! Hope this gets merged soon! 💪

@mintar
Copy link
Member

mintar commented Apr 24, 2022

this doesn't work
"time_from_start": Duration(seconds=1)

That's not supposed to work. convert_dictionary_to_ros_message converts a JSON-like dictionary to a ROS message, and there should be only basic datatypes (string, int, float, ...) in there. Duration is not a basic datatype.

this is also working
"time_from_start": [1, 0]

Maybe that works, but I think a better way would be this:

    "time_from_start": {"sec": 1, "nanosec": 0}

Sönke Niemann and others added 2 commits June 30, 2022 17:57
@mintar
Copy link
Member

mintar commented Sep 12, 2022

I have just finished converting this repo to ROS2 and released it (as rclpy_message_converter) to ROS2 foxy, galactic, humble and rolling. It should be available as binary package after the next sync.

I used as much as I could from this PR (thanks a lot, @relffok!). I ended up re-doing a lot of it in order to keep the Git history and have nice commits. Also, I've ended up copying and modifying rosidl_runtime_py.set_message.set_message_fields() and rosidl_runtime_py.convert.message_to_orderreddict instead of adapting the old implementation.

The biggest thing that was missing from this PR (and from the rosidl_runtime_py implementations above) is the Base64 encoding of binary arrays (uint8[]). I haven't checked, but I'm pretty sure that the mir_robot driver transfers sensor_msgs/Image encoded this way. I've added back this functionality.

It now passes all the original tests, so I'm very confident that it works just as before.

@mintar mintar closed this Sep 12, 2022
@relffok
Copy link
Author

relffok commented Sep 12, 2022

Awesome, thank you. Glad I could contribute and looking forward to using it.

@mintar
Copy link
Member

mintar commented Sep 12, 2022

Thanks again. Without you taking the initiative I wouldn't have done it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants