Clarification needed regarding coordinate system transformation (Rig to Camera)
#38
by robmir - opened
I am currently struggling with the coordinate transformation from the Vehicle Rig system to the Camera system.
Despite following the documented conventions (Rig: X=Forward, Y=Left, Z=Up; Camera: Z=Forward, X=Right, Y=Down), I consistently encounter negative Z-values when applying the extrinsic transformations to the ground-truth obstacle coordinates.
My current approach:
- I am extracting the camera extrinsics (quaternions and translation vectors) from the provided calibration files.
- I am applying the transformation $P_{cam} = R_{cam_to_rig}^{-1} \cdot (P_{rig} - T_{cam_to_rig})$.
- I have tried several axis mappings for the resulting camera coordinates, but I am unable to consistently achieve positive Z-values (depth) for objects clearly visible in the camera FOV.
My questions:
- Is there a specific "hidden" coordinate system convention or an intermediate transformation step for the obstacle labels in the .offline (or ground truth) files that I am missing?
- Are the x, y, z coordinates provided in the obstacle files already defined in a specific sensor-local frame, or are they truly in the global Rig frame?
- Could you clarify the expected matrix multiplication order for your specific dataset format to ensure the depth values ($Z$) correctly map to the optical axis?
Any guidance or a reference to a code snippet that handles the Rig-to-Camera transformation for the physical_ai dataset would be greatly appreciated.
Thank you for your support!