Robotics StackExchange | Archived questions

change view of world in Gazebo

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?

Asked by PeterHer on 2019-10-02 08:15:50 UTC

Comments

Answers

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.

Asked by kumpakri on 2019-10-02 08:49:06 UTC

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);
    }

Asked by PeterHer on 2019-10-02 13:17:55 UTC