How to make the camera track a moving robot
When the robot moves, how do you make the camera track it, so the robot doesn't move out of the viewing pane?
I'm assuming I'll need to write a world plugin, but it's unclear how to programmatically access the camera. I see there's API documentation, but it's not searchable, so I'm not sure where to begin looking.
Also, is there a maximum limit to where the robot can move in the simulated world? When placing models, I noticed there appears to be min/max limits on the ground where models can be placed, implying the world is not infinite and that a moving robot would eventually run into some sort of invisible wall.
Asked by Cerin on 2015-04-12 12:05:02 UTC
Answers
If you don't want to go through the trouble of writing a plugin, you can right-click the model and choose Follow
and the camera will follow the robot. Press ESC
to leave follow mode.
Programmatically, I think it should be possible to emit gui::Events::follow(<modelName>)
. And gui::Events::follow("")
to stop following.
The ground plane seems to end where the gray square ends, but if you try to place models beyond that point you'll see it's possible. You can also edit a model's pose on the left panel, I guess the only limitation should be numeric.
Asked by chapulina on 2015-04-12 14:09:16 UTC
Comments
When following, is there any way to control the zoom? Follow is exactly what I need, but it zooms to far out, my model is barely visible, and when I try and manually zoom it re-zooms out.
Asked by Cerin on 2015-04-12 19:44:42 UTC
See this question
Asked by chapulina on 2015-04-12 20:26:50 UTC
Thank you for your help.
Asked by Fenix0817 on 2023-06-23 08:54:02 UTC
Comments