collision1_name not a member of gazebo_msgs/ContactState [closed]
Hi,
I am writing a program read the data from a contact sensor in Gazebo. When I make the package, I get this error
/home/crichton/ros_workspace/angen_cognitive_environment/angen_apps/src/test_sensor.cpp: In member function ‘void test_sensor::callback(const ConstPtr&)’:
/home/crichton/ros_workspace/angen_cognitive_environment/angen_apps/src/test_sensor.cpp:32:25: error: ‘const struct gazebo_msgs::ContactState_<std::allocator<void> >’ has no member named ‘collision1_name’
My code is this
void test_sensor::callback(const gazebo_msgs::ContactState::ConstPtr& DetectState)
{
if(DetectState->collision1_name.compare("base_footprint_geom_plate_1_link"))
cout<<"Contact with the robot"<<endl;
}
The api lists collision1_name as its member. What's the problem here ? or Am I making a mistake ?