DavidPL1 / assembly_example

Example code for interaction with our assembly simulation ICRA 2023 challenge
7 stars 1 forks source link

The repeat values in camera_info topic #10

Closed renyu2016 closed 1 year ago

renyu2016 commented 1 year ago

After subscribing image and camera_info topics, I got following message for workspace_cam camera

header: seq: 1669 stamp: secs: 115 nsecs: 910000000 frame_id: "workspace_cam_optical_frame" height: 720 width: 1080 distortion_model: '' D: [] K: [869.1168824543141, 0.0, 539.5, 0.0, 869.1168824543141, 359.5, 0.0, 0.0, 1.0] R: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] P: [869.1168824543141, 0.0, 539.5, 0.0, 0.0, 869.1168824543141, 359.5, 0.0, 0.0, 0.0, 1.0, 0.0] binning_x: 0 binning_y: 0 roi: x_offset: 0 y_offset: 0 height: 0 width: 0 do_rectify: False

and following message for workspace_cam2 camera:

header: seq: 4416 stamp: secs: 299 nsecs: 959000000 frame_id: "workspace_cam2_optical_frame" height: 720 width: 1080 distortion_model: '' D: [] K: [869.1168824543141, 0.0, 539.5, 0.0, 869.1168824543141, 359.5, 0.0, 0.0, 1.0] R: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] P: [869.1168824543141, 0.0, 539.5, 0.0, 0.0, 869.1168824543141, 359.5, 0.0, 0.0, 0.0, 1.0, 0.0] binning_x: 0 binning_y: 0 roi: x_offset: 0 y_offset: 0 height: 0 width: 0 do_rectify: False

It seems that the intrinsic matrix was reported twice times but the extrinsic matrix was missing. Is this the intended behavior?

DavidPL1 commented 1 year ago

Citing the documentation of CameraInfo:

# Projection/camera matrix
#     [fx'  0  cx' Tx]
# P = [ 0  fy' cy' Ty]
#     [ 0   0   1   0]
# By convention, this matrix specifies the intrinsic (camera) matrix
#  of the processed (rectified) image. That is, the left 3x3 portion
#  is the normal camera intrinsic matrix for the rectified image.
# It projects 3D points in the camera coordinate frame to 2D pixel
#  coordinates using the focal lengths (fx', fy') and principal point
#  (cx', cy') - these may differ from the values in K.
# For monocular cameras, Tx = Ty = 0. Normally, monocular cameras will
#  also have R = the identity and P[1:3,1:3] = K.

These cameras are monocular and have no distortion, so P[1:3,1:3] is K and Tx = Ty = 0

renyu2016 commented 1 year ago

Thank you very much! It seems that the server image V2.1 works well now.