javaandroidkotlinarcore3d-reconstruction

ARCore – Does Pose "getRotationQuaternion" return rotation in real world coordinates?


I'm trying to get the pose of the device in real world coordinates (meters). I wanted to try inputting the pose of the camera as prior input to colmap for sparse point cloud reconstruction. The pose colmap estimates is not in any absolute measurement but an arbitrary value. So I need the rotation and translation quaternion from ARCore so I could input it to colmap.

Does the ARCore .getRotationQuaternion() return quaternion in real world coordinates?

If no, is there any other method to get it?


Solution

  • Google's ARCore official documentation says:

    Pose class represents an immutable rigid transformation from one coordinate space to another.

    public Pose(float[3] translation, float[4] rotation) 
    

    As provided from all ARCore APIs, Poses always describe the transformation from object's Local coordinate space to the World coordinate space.

    Frame frame = session.update();
    Pose pose = frame.getAndroidSensorPose();
    
    Pose modelPose = pose.extractRotation();
    float orientation[] = modelPose.getRotationQuaternion();
    

    P. S.

    public Pose getAndroidSensorPose()
    

    Returns the pose of the Android Sensor Coordinate System in the world coordinate space for this frame. The orientation follows the device's "native" orientation (it is not affected by display rotation) with all axes corresponding to those of the Android sensor coordinates. Translation units are in meters.