Make it easier to pass custom xacro args#210
Make it easier to pass custom xacro args#210nickswalker wants to merge 3 commits intorobot-descriptions:mainfrom
Conversation
stephane-caron
left a comment
There was a problem hiding this comment.
Thank you for this PR @nickswalker 👍 I fully agree with the use case of passing xacro arguments when loading a Xacro description, this looks to me like the logical next step after adding the ability to load Xacro descriptions. Your changes to the _xacro submodule look good to me.
One thing is that currently one needs to import the internal robot_descriptions._xacro submodule, as you do in the example. I'd suggest we expose xacro_args as a keyword argument to load_robot_description directly, so that users don't need to reach into the internal submodule to get the feature. Something like:
robot_description = load_robot_description(
"fr3_description",
xacro_args={"hand": "false"},
)What do you think?
Finally, the arm+gripper attachment example is interesting but it looks like it's about post-hoc URDF composition rather than directly related to xacro arguments. If so, can we split it into its own PR? (I'm open to merging it as well, it's just that if we can keep things separate it's easier to discuss them on their own.)
Xacro args are often used to define a range or reasonable customization of the model (e.g. including/excluding a gripper on an arm). There might be dozens of possible variants of a particular Xacro-based description based on these args, so it makes sense to allow the caller to pass their desired args.
Provides public API for loader users to pass in xacro args Cover this new interface with loader-specific tests
0d1eae5 to
ae067c4
Compare
|
That makes sense! I added Will send separate PRs for the other items. |
Expose xacro_args on the
get_urdf_pathinterface. Xacro args define reasonable (and uncountable numbers of) variations of a robot, so it makes sense to allow library users to pass their preferred args in when requesting a URDF. The user can do this currently, but must define their own module or one-off namespace.These uses will be somewhat non-standard definitionally, so it feels okay to not expose xacro args in the higher level loader interface.
Ultimately, I'm interested in being able to easily compose arms and grippers, for which this feature is helpful. I've included a new example script illustrating this, since it might be a common "advanced" use case. Please feel free to remove it