Gazebo | Ignition | Community
Ask Your Question

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

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

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

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

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


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 -0500 )edit
chapulina gravatar imagechapulina ( 2017-10-02 10:07:01 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower


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

Seen: 2,928 times

Last updated: Oct 02 '17