loco-3d / multicontact-locomotion-planning

MLP : a Decoupled and Modular Framework for Multicontact Locomotion Planning
BSD 2-Clause "Simplified" License
55 stars 13 forks source link

Ros pack fails to load robot model in tsid whobody motion generation #56

Open stonneau opened 4 years ago

stonneau commented 4 years ago

Here https://github.com/loco-3d/multicontact-locomotion-planning/blob/master/python/mlp/wholebody/tsid.py#L375 Apparently the method getPath is not able to handle slashes "/" when retrieving packages. Subsequently the loading of a wholebody motion method with Talos leads to the following error:


  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/media/data/dev/linux/hpp/src/multicontact-locomotion-planning/python/mlp/__main__.py", line 29, in <module>
    loco_planner.run()
  File "/media/data/dev/linux/hpp/src/multicontact-locomotion-planning/python/mlp/loco_planner.py", line 239, in run
    self.run_wholebody(iter_dynamic_filter)
  File "/media/data/dev/linux/hpp/src/multicontact-locomotion-planning/python/mlp/loco_planner.py", line 135, in run_wholebody
    self.cs_wb = generate_wholebody(self.cfg, self.cs_ref, self.fullBody, self.viewer)
  File "/media/data/dev/linux/hpp/src/multicontact-locomotion-planning/python/mlp/wholebody/tsid.py", line 375, in generate_wholebody_tsid
    package_path = rp.get_path(cfg.Robot.packageName)
  File "/home/stevet/.local/lib/python3.6/site-packages/rospkg/rospack.py", line 207, in get_path
    raise ResourceNotFound(name, ros_paths=self._ros_paths)
rospkg.common.ResourceNotFound: example-robot-data/robots/talos_data

@nim65s as discussed yesterday.

This is temporarily fixed by directly inputing the urdf path manually:

urdf = "/opt/openrobots/share/example-robot-data/robots/talos_data"+'/urdf/' + cfg.Robot.urdfName + cfg.Robot.urdfSuffix + '.urdf'

Thank you very much !

nim65s commented 4 years ago

Do you need only stuff from example-robot-data, or do you plan to use models from elsewhere ?

stonneau commented 4 years ago

To be completely honest I have no idea why this package is loaded. I d say in general we want to use models from elsewhere because this is not limited to laas

pFernbach commented 4 years ago

Yes, we need to be able to use any other kind of models from different packages. I think that this issue should not be fixed here but in the talos-rbprm (and all the other {robot}-rbprm packages). It make sens to me to constraint packageName to be a single name and not a relative path.

I need to check the Robot class to see which variables we could use to correctly define this or if we need to add another variable.

A quick and simple fix in this package would be to extract the first part of the string before the first /, call get_path with it and append the second part of the string to the result.