RobotLocomotion / drake

Model-based design and verification for robotics.
https://drake.mit.edu
Other
3.33k stars 1.26k forks source link

Add Xacro as build-dependency #4326

Closed liangfok closed 4 years ago

liangfok commented 7 years ago

Edit: This issue was originally titled "Update Drake's version of Xacro".

In #4218, the HSRb model is not being used in hsrb_system_factories_test because it is unable to generate the URDF model of the HSRb due to lack of a modern version of ROS xacro. This issue tracks the updating and integration of the latest version of ROS xacro with C++ Drake.

liangfok commented 7 years ago

An alternative approach is to use the latest version of ROS xacro to generate the URDF and save the URDF into a file that's committed to this repository. I'd prefer local on-demand generation rather than version controlling generated code, but this might be an easier short term solution.

liangfok commented 7 years ago

Based on #5660 and #5636, I think relying on the ROS-installed version of xacro to generate the URDF files, and then committing the resulting URDF files into master is adequate. To avoid confusing users into thinking the version of xacro in Drake is usable (it's too old and does not support features needed by some .xacro files in master), we should probably remove it from master.

liangfok commented 7 years ago

Based on feedback from #5807, the new plan is to:

  1. Update Drake's version of xacro to a more recent version. The version must support all .xacro files in master.
  2. Use Bazel's genrule() to generate the URDFs.
jwnimmer-tri commented 7 years ago

I'd encourage the approach for (1) to be to pull xacro into the WORKSPACE, rather than updating the vendored copy in-tree.

jwnimmer-tri commented 6 years ago

Not fixed, but closing for now. We can reopen once we have a use case.

jwnimmer-tri commented 4 years ago

@sammy-tri Could you post a note about recent need for xacro, please?

sammy-tri commented 4 years ago

In #13007, I managed to get the collision models for the Jaco arm-only and arm + hand models out of sync when manually merging changes between the two. Building arm only and arm + hand models from the same source is a typical use for xacro, Franka does so for their model of the panda, for example in https://github.com/frankaemika/franka_ros/tree/kinetic-devel/franka_description/robots Additionally, since the upstream versions of models like the Jaco and Panda use xacro, keeping drake's models in sync with upstream would be simplified.

jwnimmer-tri commented 4 years ago

https://github.com/jwnimmer-tri/drake/commits/ros_xacro appears to work with --help and one of Anzu's xacro files as a sanity check. Probably just needs a regression test added and we can PR to Drake.

\CC @EricCousineau-TRI @IanTheEngineer FYI

jwnimmer@cons:~/jwnimmer-tri/drake$ bazel build @ros_xacro//:xacro && bazel-bin/external/ros_xacro/xacro --help
INFO: Analyzed target @ros_xacro//:xacro (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
Target @ros_xacro//:xacro up-to-date:
  bazel-bin/external/ros_xacro/src/ros_xacro_main.py
  bazel-bin/external/ros_xacro/xacro
INFO: Elapsed time: 0.065s, Critical Path: 0.00s
INFO: 0 processes.
INFO: Build completed successfully, 1 total action
No module named 'rosgraph'
Usage: ros_xacro_main.py [options] <input>

Options:
  -h, --help         show this help message and exit
  -o FILE            write output to FILE instead of stdout
  --deps             print file dependencies
  -i, --inorder      processing in read order (default, can be omitted)
  -q                 quiet operation, suppressing warnings
  -v                 increase verbosity
  --verbosity=level  set verbosity level
                     0: quiet, suppressing warnings
                     1: default, showing warnings and error locations
                     2: show stack trace
                     3: log property definitions and usage on top level
                     4: log property definitions and usage on all levels