-
Notifications
You must be signed in to change notification settings - Fork 16
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
Discuss RealSense rgb / depth frames and alignment in simulation #183
Comments
I think I can help a bit on this:
Do you find that confusing? I totally agree, see https://discourse.ros.org/t/urdf-ng-link-and-frame-concepts/56 for a related detailed post.
You can ignore that tags. |
Just to elaborate more on this, which version of Gazebo and sdformat you used for your tests? |
To be addressed after our PI16, that is in two weeks. /remind October 30 cc @Nicogene |
⏰ Reminder
|
Related to that, we should check which configuration files we ship by default to access the realsense and what is set there. |
Thanks @traversaro and @pattacini for your answers. I did not know that the frame used in the
The setup consists of:
In simulation, it seems that the alignment was assumed, i.e.:
On the real robot, it seems that the alignment is enabled: |
Actually I was just relying on memory, and I could not find anything on this, so I may be not recalling correctly. If attaching to a fake link works fine on the Gazebo available via apt on Ubuntu 22.04 (i.e. sdformat9 9.7.0/Gazebo 11.10.2), it is ok for me. (Note that OpenRobotics does not publish latest Gazebo11 version on Ubuntu 22.04, so if we want to support apt on 22.04 we need to ensure that our models are compatible with those versions.
Thanks for checking! In that case it make sense to align the two frames also on the URDF/SDF. |
actually this test was done on Ubuntu 20.04 but we also have an easy way to test it on Ubuntu 22.04, I can report back about that. |
I tried with Ubuntu 22.04 with Gazebo 11.0.2 and your suspicions were correct @traversaro: using a fake link as a reference tag does not work (the image was badly rotated). Nonetheless, the actual problem is more the fact that vision and kinematics do not agree - as the point cloud reveals. In this regard, I tried to restore the original URDF and then use the same pose parameters of the RGB sensor, i.e., ergocub-software/urdf/ergoCub/robots/ergoCubGazeboV1_1/model.urdf Lines 3492 to 3495 in a092c3a
for the depth sensor and that was enough to solve the problem, that is we need to enforce alignment of RGB and depth images as discussed in the first comment of this issue. |
Thanks! Yes, the two problems (that the sensor stuff is complex, and that the RGB and the depth are not aligned while in reality they are) are distinct. I think we can keep the issue to track the second problem. |
|
I forgot to mention that maybe also the |
Hi @xEnVrE, Since in the urdf there is not a single sensor that handles both streams, but depth and rgb are disjointed sensors, a way to align it could be take this ergocub-software/urdf/creo2urdf/data/ergocub1_1/ERGOCUB_all_options.yaml Lines 817 to 851 in f7ba46b
Changing frameName to SCSYS_HEAD_RGB and <horizontal_fov>1.57079</horizontal_fov> to <horizontal_fov>1.2217</horizontal_fov> should mimic what happens on the real robot.About the pose
I probably copied it from icub3 yaml so it can be wrong but I don't think it is the problem here. |
Maybe I am wrong, but should not we have the same pose for both sensors to get the alignment? Otherwise they will observe a different scene. At least, this was the way I could get the alignment in #183 (comment) |
If I am not wrong that pose is referred to the I committed here https://github.com/icub-tech-iit/ergocub-software/tree/fix/depthAlignment the urdf of ergoCubGazeboV1_1 w/ the depth aligned w/ the rgb camera, if it is correct I do the same thing also for the other robots and open a PR |
I can make some tests and let you know between today and tomorrow |
Hi @Nicogene, I tested your branch and the result seems fine so far: |
It is now aligned w/ the RGB frame as on the real robot. It fixes #183
PR opened: |
I was trying to visualize the point cloud from
ergoCub1_1
in simulation withrviz2
and I was superimposing it on the 3D model of the robot rendered according to the forward kinematics and I noticed the following misalignment:As the red arrows try to indicate, the point cloud is not perfectly superimposed on the model - something that 1) I was not expecting and that 2) actually does not happen on other robots, e.g.,
iCubGazeboV2_5_visuomanip
.URDF investigation
I then investigated the
urdf
of the robotergoCubGazeboV1_1
and I noticed the following facts:realsense
frame is defined and two childsrealsense_depth_frame
realsense_rgb_frame
via two fixed joints
realsense
instead ofrealsense_rgb_frame
ergocub-software/urdf/ergoCub/robots/ergoCubGazeboV1_1/model.urdf
Line 3488 in a092c3a
ergocub-software/urdf/ergoCub/robots/ergoCubGazeboV1_1/model.urdf
Lines 3492 to 3495 in a092c3a
ergocub-software/urdf/ergoCub/robots/ergoCubGazeboV1_1/model.urdf
Lines 3520 to 3523 in a092c3a
Proposed changes
I propose the following changes:
realsense_rgb_frame
<pose>0.0 0.0 0.0 0.0 -1.57 1.57</pose>
correction which make sure that the usual orientation used for cameras in robotics (y down, x right, z out of image plane) is aligned with the convention used inside Gazebo (z up, y left, x out of image plane)The final configuration becomes:
Comparison
Using the above proposals, we get the alignment as expected:
Superimposition is quite nice also when closing fingers:
I would be happy to discuss on the above with you in order to understand how to possibly fix the configuration for Gazebo, keeping in mind that there is a part of automatic generation going on in this repository.
cc @traversaro @pattacini @Nicogene
The text was updated successfully, but these errors were encountered: