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

Pose frames are lost in transport #456

Closed
simutisernestas opened this issue Oct 20, 2023 · 7 comments
Closed

Pose frames are lost in transport #456

simutisernestas opened this issue Oct 20, 2023 · 7 comments
Labels
bug Something isn't working

Comments

@simutisernestas
Copy link

simutisernestas commented Oct 20, 2023

Environment

  • OS Version: Ubuntu 22
  • Source: Humble distro, from APT
  • Gz Garden

Description

  • Actual behavior:
    Gazebo pose messages when transported to ROS tf messages lose the frame info. For instance this is one of the gazebo messages:
pose {
  name: "x500_0"
  id: 25
  position {
    x: -24.332399998778531
    y: -35.4081
    z: 0.77342682381223771
  }
  orientation {
    x: -4.686981005291697e-17
    y: 2.72876828650036e-09
    z: -1.9894898985671598e-17
    w: 1
  }
}

And at the other end only the pose info is passed, but the frame names are lost.

  • Expected behavior:
    In the end would be nice to have static transform names passed, in this way for use in ROS applications.

Steps to reproduce

  1. Fire a up a simulation with an entity
  2. Launch transport
  3. Check tf messages on ROS side
  4. The frame name infromation is lost
@simutisernestas simutisernestas added the bug Something isn't working label Oct 20, 2023
@azeey
Copy link
Contributor

azeey commented Nov 10, 2023

The steps you listed to reproduce the problem aren't very clear. Which launch files are you using? Is there a particular repository with an example I can look at?

@azeey azeey moved this from Inbox to In progress in Core development Nov 10, 2023
@simutisernestas
Copy link
Author

You can simply launch any world that has pose information; for instance NAO joint control - included by default with gz installation when you launch gz sim and choose that world;

Create a topic_map.yml with contents:

- ros_topic_name: "/gz/pose_array"
  gz_topic_name: "/world/nao_world/pose/info"
  ros_type_name: "geometry_msgs/msg/Pose"
  gz_type_name: "gz.msgs.Pose_V"

Launch bridge:
ros2 run ros_gz_bridge parameter_bridge --ros-args -p config_file:=topic_map.yml

The frame ids are not passed to ROS; If you look at the topic it's just a bunch of poses that you need to index manually to get the actual transforms, if simulation adds a new link all of these need to updated again. This is also related to sdf and urdf inter-op, most likely people have better solution for the use case.

So for example at that time I was trying to get static tf's from gazebo to transform some sensor data to base_link and this is a hassle currently because the frame information is lost in the transport. Of course pose array has only single frame_id included while gazebo published all a list with id attached to each of them. Need some consideration how to implement this properly and a test could be creating a joint/static tf publisher on ROS side.

Could help out with the feature, just need some input from your side how to go about it in a nice way. @azeey

@azeey
Copy link
Contributor

azeey commented Jan 4, 2024

Take a look at this example. For TF, you'll need to change the ros_type_name to tf2_msgs/msg/TFMessage. You should then be able to publish it directly to /tf by changing ros_topic_name to /tf. That example depends on the PosePublisher system. This other example might also be useful.

@Rendok
Copy link

Rendok commented Feb 4, 2024

I believe not only frame_ids are missing but also the time stamps. I observe the same behavior on ROS2 Humble and Gazebo Harmonic.

I tried ros2 run ros_gz_bridge parameter_bridge /world/empty_world/pose/info@tf2_msgs/msg/[email protected]_V
but still, observe the same missing frame_ids and time stamps. That is the whole header is not initialized.

- header:
    stamp:
      sec: 0
      nanosec: 0
    frame_id: ''
  child_frame_id: ''
  transform:
    translation:
      x: 0.0
      y: 0.0
      z: 10.0
    rotation:
      x: 0.0
      y: 0.0
      z: 0.0
      w: 1.0

@ns9
Copy link

ns9 commented Feb 14, 2024

I am also experiencing this issue, is there any way to get the frame_id's to make their way to the ROS messages with the current implementation of the bridge or is a PR necessary to fix this?

@azeey
Copy link
Contributor

azeey commented Feb 14, 2024

I think the problem is /world/<world name>/pose/info was not meant to be used with ROS. You'll want to set up the PosePublisher system.

This is actually a duplicate of #172, so I'll go ahead and close it.

@azeey azeey closed this as not planned Won't fix, can't repro, duplicate, stale Feb 14, 2024
@github-project-automation github-project-automation bot moved this from In progress to Done in Core development Feb 14, 2024
@ns9
Copy link

ns9 commented Feb 15, 2024

@azeey Thanks for the quick response, I'm having issues getting the PosePublisher to produce world frame poses (I just see child links poses of the model) but I'll ask my question in the other open issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

4 participants