Closed pFernbach closed 4 years ago
Hello, just a remark : it seems like you could also disable collision for some non-adjacent links thanks to the mechanical constraints of the robot. For example, I think the [FL_UPPER_LEG, HL_UPPER_LEG] and [FL_UPPER_LEG, HR_UPPER_LEG] should never be colliding, and their symetries for the other legs as well
Yes it's possible. But I think I will leave this kind of optimization to someone with more knowledge of the mechanical properties of Solo. The collisions that I disabled are the ones strictly required to make it work and not always detect it in self-collision.
I am using it with the HPP API, but it end up calling this method in pinocchio: https://github.com/stack-of-tasks/pinocchio/blob/9c03aa82d5c27dc69faaa35fe2c717d6a417f4fe/src/parsers/srdf.hpp#L26.
You can find an example of use in the pinocchio demos for another robot: https://github.com/stack-of-tasks/pinocchio/blob/2c22ca240e78e5a6c20e7b2cb6c44e7a45658d38/examples/collisions.py#L28
I can modify the scripts in the demos/ folder of this package if you want, but you aren't currently using the collision detection at all in this scripts.
The only thing we need as a "demo" is the way to load the srdf in the robot wrapper of pinocchio. I can be a 3 line python file: demo_srdf.py
from pinocchio import RobotWrapper
if __name__ == '__main__':
# some comments to explain the context
# load the collision using the srdf file
# do nothing
or demo_load_collision_with_srdf.py I trust you can be inventive :)
I added a demo that load the reference configuration from the srdf and show some self-collision test with pinocchio.
Some of the code of this demo may be moved directly to the SoloConfig
class (eg. the lines https://github.com/pFernbach/robot_properties_solo/blob/master/demos/solo12_collision_detection.py#L20-L33) but I did not want to add a dependency to the srdf file everywhere. I let you decide this.
Thanks for the code @pFernbach !!
Add an srdf file for solo, working for the 8 and 12 DoF versions. The file specify reference configurations, joints groups and disable collision for adjacent links.
Originally wrote by @cmastalli and modified by me.