# the question about the contact sensor data

when I get the data of contact sensor, such as, in 1 second, gazebo will generate 16 group(contact size =16)(I know that is the data of different time),and in a group, there are 12 groups data(contact(i).position size=12),whether it means that in that time, the link's 12 groups force and torque must be added up to sum as the result data? and I saw the instance as: // gzerr << " Depth:" << contacts.contact(i).depth(j) << "\n"; fTotal += math::Vector3( contacts.contact(i).wrench(j).body1force().x(), contacts.contact(i).wrench(j).body1force().y(), contacts.contact(i).wrench(j).body1force().z()); tTotal += math::Vector3( contacts.contact(i).wrench(j).body1torque().x(), contacts.contact(i).wrench(j).body1torque().y(), contacts.contact(i).wrench(j).body1torque().z()); } // low pass filter over time double e = 0.99; this->rFootForce = this->rFootForce * e + fTotal * (1.0 - e); this->rFootTorque = this->rFootTorque * e + tTotal * (1.0 - e);

geometry_msgs::Wrench msg;
msg.force.x = this->rFootForce.x;
msg.force.y = this->rFootForce.y;
msg.force.z = this->rFootForce.z;
msg.torque.x = this->rFootTorque.x;
msg.torque.y = this->rFootTorque.y;
msg.torque.z = this->rFootTorque.z;
this->pubRFootContact.publish(msg);


why use double e = 0.99; this->rFootForce = this->rFootForce * e + fTotal * (1.0 - e);? what is the filter's aim? if there is not the 'e', the fTotal cannot be the last result?

and whether are the contact force and torque data equal to the joint force and torque of this link? please help me, thank you.

edit retag close merge delete

Sort by » oldest newest most voted

In an existing pull request, the changes have been made to correctly sum up the forces and torques, and remove filtering.

roslaunch atlas_utils atlas.launch
rxplot /atlas/debug/l_foot_contact/force/z


in the issue_123 branch shows (Note: For reference, the z-force oscillation magnitudes shown here decreases while number of physics solver inner iterations increases from 40 to 800): more