Drake: Add Xacro as build-dependency

Created on 1 Dec 2016  路  8Comments  路  Source: RobotLocomotion/drake

_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.

low manipulation feature request

Most helpful comment

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

All 8 comments

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.

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.

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.

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

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

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

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.

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
Was this page helpful?
0 / 5 - 0 ratings