Gazebo | Ignition | Community
Ask Your Question

contact sensor has no member named contacts

asked 2016-08-29 05:01:10 -0600

updated 2016-08-29 17:36:37 -0600

I was following this tutorial , but as i try to build the code i get theis error msg:

/usr/include/boost/asio/detail/impl/socket_ops.ipp:266:5: note:   ‘boost::asio::detail::socket_ops::bind’
 int bind(socket_type s, const socket_addr_type* addr,
/home/rob/Documents/gazebo_contact_tutorial/ In member function ‘virtual void gazebo::ContactPlugin::OnUpdate()’:
/home/rob/Documents/gazebo_contact_tutorial/ error: ‘class gazebo::sensors::ContactSensor’ has no member named ‘Contacts’
   contacts = this->parentSensor->Contacts();

How can i remove this error? I am using ros indigo with gazebo 2.2.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2016-08-29 11:24:49 -0600

chapulina gravatar image

updated 2016-08-29 22:19:00 -0600

For Gazebo 7+, it should be Contacts() with upper case, instead of lower case.

contacts = this->parentSensor->Contacts();

For previous versions:

contacts = this->parentSensor->GetContacts();

Be sure to check the Gazebo version on the tutorial's top-right corner.

edit flag offensive delete link more


yes i have trieed that. First it was like that, but i changed in to lower case, but no use.

hari1234 gravatar imagehari1234 ( 2016-08-29 15:48:01 -0600 )edit

But with the correct function you're probably getting a different error message, right?

chapulina gravatar imagechapulina ( 2016-08-29 16:42:47 -0600 )edit

no same error: .. has no member named Contacts, i looks at the class ContactSensor reference, i can see that this class has member function called Contacts, but when i try to access it it shows error.

hari1234 gravatar imagehari1234 ( 2016-08-29 17:09:40 -0600 )edit

ahh ok, now I see you're using Gazebo 2.2. You should choose the correct Gazebo version on the top right, the function used to be `GetContacts()`

chapulina gravatar imagechapulina ( 2016-08-29 22:17:28 -0600 )edit

Question Tools

1 follower


Asked: 2016-08-29 05:01:10 -0600

Seen: 737 times

Last updated: Aug 29 '16