ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Convert from RViz camera location (eye + focus points) to Gazebo (just pose)

asked 2021-04-18 08:04:31 -0600

jorge gravatar image

I'm trying to control both the RViz and Gazebo cameras simultaneously. The RViz part is solved by using this code, but the pose it publishes for the camera makes sense only for the position; I don't really get what the orientation represents, but for sure is not what gazebo understands. Gazebo expects an orientation pointing from the camera location to the focus.

I have tried to compute such a pose, and got almost there (I think) by calculating a quaternion with the rotation from +x vector to the vector connecting eye and focus, but still I get weird behavior (video here)

Has anyone tried to do something like this, or knows how to to the vector - vector -> quaternion calculation properly?


edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2021-05-12 11:53:55 -0600

jorge gravatar image

I can answer myself now. Just need to

On RViz's camera orientation, +z axis points in the focus-to-eye vector's direction, but in Gazebo the camera's +x axis is expected to point towards the focus. So I Just need to rotate by 0, pi/2, pi/2 (ypr) Required changes

In case anyone needs something similar, the other component (modify Gazebo camera pose by the received pose) is here.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2021-04-18 08:04:31 -0600

Seen: 61 times

Last updated: May 12 '21