Home | Tutorials | Wiki | Issues
Ask Your Question
0

error: ‘class gazebo::physics::World’ has no member named ‘LightCount’

asked 2017-10-02 09:15:44 -0600

Ash_100 gravatar image

I am using Gazebo 7 with ROS kinetic on Ubuntu 16.04. I wrote a small gazebo plugin with gets loaded when I load a world in gazebo. However, when I try to use LightCount API, I get the compile error saying "error: ‘class gazebo::physics::World’ has no member named ‘LightCount’".
Here is the link that says that this API is supported http://osrf-distributions.s3.amazonaw...

Here is the code snippet that is giving me error
   // Called by the world update start event
    public: void OnUpdate(const common::UpdateInfo & /*_info*/)
    {
       physics::WorldPtr w = this->model->GetWorld();
       unsigned int i = w->LightCount();
       printf("Light count = %d\n", i); 
    }
edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2017-10-02 09:49:28 -0600

chapulina gravatar image

What minor version of Gazebo are you running? It looks like World::LightCount was added on Gazebo 7.1.0 and is not on 7.0.0.

On Gazebo 7.0.0, you should be able to use w->Lights().size() instead.

edit flag offensive delete link more

Comments

How to update 7.0.0 to 7.1.1? Basically, I want to add/remove lights from the world. Therefore, I need to access API relevant to lights.

Ash_100 gravatar imageAsh_100 ( 2017-10-02 10:03:33 -0600 )edit
chapulina gravatar imagechapulina ( 2017-10-02 10:07:01 -0600 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2017-10-02 09:15:44 -0600

Seen: 2,155 times

Last updated: Oct 02 '17