Problems with the camera's coordinate system

Hi,team.
When I add runtime_parameters.measure3D_reference_frame = sl in depth_sensing this code. REFERENCE_FRAME. WORLD, the coordinate system y-axis on which the obtained point cloud depends is always parallel to gravity.
When I write my own code, I added coordinate_system=sl. COORDINATE_SYSTEM. RIGHT_HANDED_Y_UP and runtime_parameters.measure3D_reference_frame = sl. REFERENCE_FRAME. WORLD
the y-axis of the coordinate system on which the point cloud I get is not parallel to gravity.
What’s going on here?

The default reference frame if none is specified is sl.COORDINATE_SYSTEM.IMAGE, where the +Y axis points down (and so would be parallel to gravity).

If you use sl.COORDINATE_SYSTEM.RIGHT_HANDED_Y_UP the +Y axis will point up, and so it would be in the opposite direction of gravity.

Check out COORDINATE_SYSTEM Class Reference | API Reference | Stereolabs for a description of all the coordinate systems.

1 Like

Thank you for your reply!
Can I understand it this way,as long as I set it up runtime_parameters.measure3D_reference_frame = sl. REFERENCE_FRAME. WORLD
there will be an axis parallel to gravity.

Hi @zore017

Fully by default, yes, because set_gravity_as_origin is true by default. If you set it to false, you won’t have an axis parallel to the gravity.

As @JC31 said, by default, it’s the Y axis that would be pointing down, so if you leave set_gravity_as_origin to true, Y will be parallel to gravity in sl. REFERENCE_FRAME. WORLD.
In CAMERA, Y will be toward the bottom of the camera.

I understand,so,with the Y axis remaining parallel to gravity, how are the other two axes set?
Can I set set_gravity_as_origin?
Also,I want to say,thanks to your team for this camera product, it is really amazing! :star_struck:

Thanks for the kind words :smiling_face:

set_gravity_as_origin overrides the roll and the pitch of the camera using IMU data. The yaw is set using the direction the camera is facing.
Talking about axes,

  • the Y axis would be parallel to the gravity
  • the Z axis (forward) would be the forward of the camera projected in the plane orthogonal to Y
  • the X axis would be the right axis projected in the plane orthogonal to Y

Thank for your patient answer! :smiling_face_with_three_hearts:

1 Like