DanielCoelho112 / synfeal

Synfeal: A Data-Driven Simulator for Camera Localization
9 stars 1 forks source link

camera_bringup not spawning camera in the correct pose #102

Closed Kazadhum closed 7 months ago

Kazadhum commented 9 months ago

I'm trying to spawn the localbot camera in a specific pose. To do that, I've added the RPY arguments to bringup_camera.launch.

I've been calculating the Euler angles with a script, which I've added to synfeal_bringup/scripts (in the branch created for this issue), that calculates these angles from a transform matrix. However, the camera doesn't end up where it is expected. Collecting a 1-frame dataset with Synfeal, the rotation part of the transform matrix obtained is different from the one we started from, which leads me to believe the issue is with the calculation of the Euler angles.

To replicate:

  1. Add the 3d model for the room world to your models_3d folder (ask me to e-mail you the files)
  2. Launch the simulation world: roslaunch synfeal_bringup bringup_mesh.launch world:=mp3d_1.world
  3. Run: python3 ~/catkin_ws/src/synfeal/synfeal_bringup/scripts/mat2eul_test.py

The expected image from the camera would be the following:

frame-00000 rgb

Tagging @miguelriemoliveira and @DanielCoelho112 for visibility

Kazadhum commented 7 months ago

I figured it out. Apparently the camera lens was aligned with the X axis and not the Z axis. By adjusting the transform matrices to point the camera's X axis at what we want to take a picture of, we get the correct images. So the camera was in fact spawning in the correct pose , but the alignment of the camera wasn't as we thought it was. @miguelriemoliveira @pmdjdias