Open Zumbalamambo opened 4 years ago
@Zumbalamambo use this to get the position. Then you can convert it to an odom message.
auto camera_pose = mappublisher->get_current_cam_pose().inverse().eval();
It gives me the following matrix,
0.923833 -0.115088 -0.365086 -0.143865
-0.0427792 -0.9788 0.200302 0.0126258
0.380399 0.169427 0.909171 -0.10293
-0 0 -0 -1
if my understanding is right, [-0.143865 0.0126258 -0.10293]
are the xyz positions and the rotation matrix is represented as,
> 0.923833 -0.115088 -0.365086
> -0.0427792 -0.9788 0.200302
> 0.380399 0.169427 0.909171
rot_cw_ = cam_pose_cw_.block<3, 3>(0, 0);
rot_wc_ = rot_cw_.transpose();
trans_cw_ = cam_pose_cw_.block<3, 1>(0, 3);
cam_center_ = -rot_cw_.transpose() * trans_cw_;
@dimaxano @chyohoo is cam_center the origin?
Hi guys, @dimaxano @chyohoo . Do you know how to get camera position, rotation matrix, xyz param, orientation of the camera from the saved map (map.msg)? There are rot_cw and trans cw arrays but how to use them?
"trans_cw": [ 0.001168138611814195, 0.001744156806106644, -0.04382340588891053 ], "rot_cw": [ -0.013637094956248765, 0.00030411659091322845, -0.001853422243378439, 0.9999052465010078 ],
Hi, @AndrewSerbin! Use code @chyohoo posted above: you alredy have rot_cw_
and trans_cw_
variables. After running the code, rot_wc_
will contain your camera orientation and cam_center_
will contain your camera position
@dimaxano how can I use this camera pose information, when the map has got scale drift?..let's say for indoor navigation
I'm not able to retrieve the camera position. How do I retrieve the camera position in
run_video_localization
?