open-dynamic-robot-initiative / robot_properties_solo

BSD 3-Clause "New" or "Revised" License
40 stars 20 forks source link

Add srdf file #22

Closed pFernbach closed 4 years ago

pFernbach commented 4 years ago

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.

thibnoel commented 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

pFernbach commented 4 years ago

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.

pFernbach commented 4 years ago

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.

MaximilienNaveau commented 4 years ago

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 :)

pFernbach commented 4 years ago

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.

MaximilienNaveau commented 4 years ago

Thanks for the code @pFernbach !!