KITrobotics / force_torque_sensor

Apache License 2.0
8 stars 4 forks source link

wrong torque offset calculation? #19

Open jacknlliu opened 5 years ago

jacknlliu commented 5 years ago

https://github.com/KITrobotics/force_torque_sensor/blob/1065d1405a0c415fd3230d61d3e2600f1b093ef6/src/force_torque_sensor_handle.cpp#L359

This computes the gravity moment not follow

but using -r x G

destogl commented 5 years ago

But this is what we want, to remove gravity moment. or am I somewhere wrong?

jacknlliu commented 5 years ago

@destogl

offset_.torque.x -= (gravity_transformed.vector.y * cog.z - gravity_transformed.vector.z * cog.y); 

the right hand of the code is -r x G, not r x G. Then the result is:

offset_.torque = offset_.torque - (-rxG) = offset_.torque + r x G

In other words, the offset_.torque is to add the gravity moment, not to remove it. Right?

destogl commented 5 years ago

Yes you are right. I will check once again what we do in our code to check why is this like that...

destogl commented 4 years ago

@jacknlliu: Did you correct this for you? Can you make pull request or give a correct code snippet?

jacknlliu commented 4 years ago

@destogl Yes, I'll check it in these days.