Personal repo of SeaClear project. Also to keep track of my contribution.
-
Camera
$\rightarrow$ C -
Aruco (World)
$\rightarrow$ W
cv2.solvePnP returns
This maps a point from the world (aruco) frame into the camera frame.
After I fetch publish_camera_to_aruco_transform() which computes exactly the inverse: "How do I go from camera coordinates to world coordinates?"
Starting from:
Multiply on the left with
Rearrange:
or equivalently:
So the camera
-
Rotation:
$R^\top$ -
Translation:
$-R^\top t$
Once I pass this to the TF library, it will always know how to compute the transformations from each camera to world coordinates (in meters).
In ROS TF, I publish:
transform.header.frame_id = "aruco_marker" # parent = world
transform.child_frame_id = "camera" # child = cameraand I set the rotation to
When I back-project a pixel into 3D (pixel_to_3d_point), the result is expressed in the camera frame:
To interpret this in the world (aruco) frame, I use TF. Since TF already knows the static transform,
it can convert the point as:
Thus, TF takes care of expressing any point measured in the camera frame into the common world (aruco_marker) frame.