Convert from RViz camera location (eye + focus points) to Gazebo (just pose)
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?
Thanks!