Search code examples
drake

How do you visualise your ROS URDF on the Drake visualizer?


Drake noob here. I tried running the drake_visualizer and geometry_inspector with my own ROS generated URDF that depicts and experimental setup with two UR10s. This throws two errors

  • PackageMap is not able to resolve certain mesh files of extension *.STL and *.DAE. This has been well catalogued in this link.
  • And ROS paths of the sort package://blah/blah do not seem to be resolved as well. I know this because the console throws the following error
Couldn't find package 'blah' in the supplied packagepath: PackageMap:
 [EMPTY!]

In another stack question, one of the authors of the Drake repo suggested we can transform the .stl files during build time. I tried searching for how you can exactly do this but couldn't find anything. I have the feeling that I am missing something fundamental here. Any help would be appreciated.

Thanks in Advance


Solution

  • Using Russ's comment, what you need to do is the following

    parser = Parser(plant)
    parser.package_map().PopulateFromFolder("path/to/folder/containing/package.xml")
    parser.AddModelFromFile("your.urdf")
    

    There are many ways to populate the package map, as linked in Russ's comment