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

PointCloud visualization reference frames #595

Open
dakejahl opened this issue Nov 10, 2023 · 1 comment
Open

PointCloud visualization reference frames #595

dakejahl opened this issue Nov 10, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@dakejahl
Copy link

I have a drone with a depth camera attached and I want to visualize the point cloud. The PointCloud data is in body frame of the drone and the visualizer displays the data in world frame. Is there a way to know which link the data came from and a transformation published that we can use?

Continuation of the conversation in #346 (comment)

Here's the model I'm using for the drone, you can see how the camera is attached
https://github.com/PX4/PX4-Autopilot/blob/main/Tools/simulation/gz/models/x500_depth/model.sdf

I have some example code where I am downsampling a camera point cloud and republishing it
dakejahl/PX4-Autopilot@02ef528

Here's a pic of a drone with a depth camera looking at a block some distance from the origin
Screenshot from 2023-11-09 15-19-35

@dakejahl dakejahl added the enhancement New feature or request label Nov 10, 2023
@azeey
Copy link
Contributor

azeey commented Nov 10, 2023

The reference frame of a point cloud message is set in the header (see https://github.com/gazebosim/gz-sensors/blob/ec52913e608ce8f64053650bfcced84a70ca12e2/src/DepthCameraSensor.cc#L557), so it should be easy to retrieve it. The issue is, since we don't have something equivalent to TF in ROS, knowing the transform from the body frame to the world will be difficult. Have you considered using RViz for this?

If you want to implement this for Gazebo, my suggestion would be to make it so that markers can be published with custom reference frames. Then, in gz-sim's MarkerManager, it would be possible to obtain the entity given a frame name
via entitiesFromScopedName. Once you have the entity, you can find its world pose using worldPose.

@azeey azeey removed this from Core development Nov 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants