Home | Tutorials | Wiki | Issues
Ask Your Question
0

change view of world in Gazebo

asked 2019-10-02 08:15:50 -0600

PeterHer gravatar image

Is there a way to change the view of the world in Gazebo in a world plugin like I can do with the GUI-camera-pose-yaw in the left menu?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-10-02 08:49:06 -0600

kumpakri gravatar image

You can do it in WORLD file.

<world>
    ...
    <gui>
      <camera name='gzclient_camera'>
        <pose>-13.0 -9.0 8.0 0 0.4 1.3</pose>
      </camera>
    </gui>
</world>

There is a method of UserCamera object in Gazebo 9 API called MoveToPosition. Maybe that would work for you but I haven't try this myself.

edit flag offensive delete link more

Comments

I had these lines in my world plugin code but didn't work I just cannot access the camera

    // Get a pointer to the active user camera
    this->userCam = gui::get_active_camera();

    if (this->userCam != NULL)
    {
      this->userCam->Yaw(0);
    }
PeterHer gravatar imagePeterHer ( 2019-10-02 13:17:55 -0600 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2019-10-02 08:15:50 -0600

Seen: 151 times

Last updated: Oct 02