carla-training-data icon indicating copy to clipboard operation
carla-training-data copied to clipboard

Issue with the object location coordinate transformation from CARLA to kitti

Open makaveli10 opened this issue 2 years ago • 1 comments

Hi, I really appreciate the work you have done to put this together. So, I am trying to reproduce this with latest CARLA version and I know the API has changed a bit that's what I am trying to understand.

https://github.com/enginBozkurt/carla-training-data/blob/4fe8fc8eba918ef4ef41c657309c974741797e20/datadescriptor.py#L118

From what I understood from the docstring section of [this method is that the transformation from CARLA to kitti for the object location should rather be:

self.location = " ".join(map(str, [y, -z, x]))
           Converts the 3D object location from CARLA coordinates and saves them as KITTI coordinates in the object
            In Unreal, the coordinate system of the engine is defined as, which is the same as the lidar points
            z
            ▲   ▲ x
            |  /
            | /
            |/____> y
            This is a left-handed coordinate system, with x being forward, y to the right and z up 
            See also https://github.com/carla-simulator/carla/issues/498
            However, the camera coordinate system for KITTI is defined as
                ▲ z
               /
              /
             /____> x
            |
            |
            |
            ▼
            y 
            This is a right-handed coordinate system with z being forward, x to the right and y down
            Therefore, we have to make the following changes from Carla to Kitti
            Carla: X   Y   Z
            KITTI:-X  -Y   Z 

So, instead of KITTI: -X, -Y, Z it should be Y, -Z, X

@enginBozkurt let me know what you think.

makaveli10 avatar May 25 '22 07:05 makaveli10