Closed WSPeng closed 4 years ago
getContactPointVel takes the contactId as the first argument. There can be many contacts on body "foddIndex_hl" so your syntax cannot be used. So you should do
raisim::Vec<3> footVel_hl;
footVel_hl.setZero();
for(size_t i=0; i<robot->getContacts().size(); i++) {
if ( footIndex_hl == robot->getContacts()[i].getlocalBodyIndex() ) {
robot->getContactPointVel(i, footVel_hl);
}
}
Not tested but should work. Let me know if it doesn't
Yes, it works! Thank you ;D
Hi,
I am trying to use the getContactPointVel method, with the pointID and raisim::Vec<3> vel as arguments. but I get segfault. Do you have any suggestion to fix the problem?
for example, then code is: raisim::Vec<3> footVel_hl; footVel_hl.setZero(); for(auto& contact: robot -> getContacts()) { if ( footIndex_hl == contact.getlocalBodyIndex() ) { robot->getContactPointVel(footIndex_hl, footVel_hl); } }