-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
rs.rs2_deproject_pixel_to_point does not work properly in Gazebo #12739
Comments
Hi @zyzgy In the RealSense coordinate system the positive X axis points to the right, as described at the link below. From the perspective of standing behind the camera and looking forwards, instead of the diagram's perspective of looking at the front of the camera, it appears that the person would be stepping back in the -X direction and so reducing the X value. |
Thank you so much for your reply! Sorry that I didn't explain my code clearly. Because I want to use values in rviz, I changed the coordinate.
So in my case, when x increases, it means z increases In the RealSense coordinate system. |
In the RealSense ROS wrapper, it automatically converts the RealSense coordinate system (X-right, Y-down, Z-forward) into the standard ROS axes (X-forward, Y-left, Z-up) by performing a multiplication on the rotation quaternions, as described at IntelRealSense/realsense-ros#1099 In your code, it looks as though you are assigning the values to the appropriate axes using the 0-2 index numbers to achieve the same conversion between ROS and RealSense coordinate systems. |
I'm sorry, I didn't understand what you meant.
Do I get a coordinate in ROS or a coordinate in the RealSense coordinate system with this code? What I'm trying to accomplish is to pass this coordinate into my Nav2 Costmap plugin to generate a specific costmap shape at the foot of a detected obstacle (e.g. a person). |
Hi! I found the following method on the Internet to align color and depth images.
But I don’t think it is for the camera in simulator. Is there any other way? |
pal-robotics/realsense_gazebo_plugin#31 Hi, I found this. I think it works. |
Hi @zyzgy I'm pleased to hear that you found a solution with the gazebo plugin. Thanks very much for the update! |
Issue Description
I used a D435i for measuring the distance from an object using rs.rs2_deproject_pixel_to_point, it gave me accurate coordinates of the object in the real world with the help of YOLOV8.
However, when I try the same code in Gazebo, it doesn't work.
for example, there is a person in front of my camera. The output is: person: x: 8.51 y: -0.7365765380859375 z: 1.6941261291503906
When I move the person two cells further along the red line, The output is: person: x: 8.32 y: -0.48608860015869143 z: 1.2062197875976564
which makes me so confused. I think the value of x should increase, not decrease.
So my problem is :
Is this a problem with gazebo software? or did I do something wrong?
The text was updated successfully, but these errors were encountered: