Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Urdf with args and yaml configuration #371

Merged

Conversation

dhled
Copy link

@dhled dhled commented Jul 26, 2018

Move the duplicates parameters into common file and uses yaml file and xacro macro to configure urdf.

This PR includes:

  • Refactoring the common ur macro in a common files
  • Parse the parameters from yaml files
  • Put every ur specific urdf into a common one
  • Modify launch files and bringups according to the new parameters

Modifications:

  • 3 new yaml files to configure the robots parameters one for each robot model / urdf (joints_limits, physical, visual)
  • ur.common.xacro contains the parsing of the yaml files
  • ur.geometry contains the geometry of the robot
  • DOESN'T CONTAINS JOINT LIMITED ANYMORE
  • Bringups launch file and tests changes accordingly.

This PR doesn't apply to ur-e series (WIP in another PR)

@gavanderhoorn
Copy link
Member

gavanderhoorn commented Jul 26, 2018

Nice to see some work in this direction.

Some first suggestions / comments:

  • give the .yaml files a default location, and use default args in the xacro macro to load the files from there. Only if users want to use custom settings they'd have to provide an alternative location for the .yaml file. That would remove the need for the urN_robot_yaml.urdf.xacro files completely, which would add yet another (confusing) set of xacros to the package.

  • (this is a suggestion / debatable): do away with the in-xacro constants completely: so all D-H derived constants, all limits, mesh locations, link lengths, everything. Place all of them in .yaml files, one for each robot variant. Rationale: preparation for when we can use the calibration data from each individual UR in the xacro (How to add calibration.conf data from controller to URDF for maximum accuracy #357) and we essentially end up with a single macro for all robots that gets parameterised by the data in the .yaml files. This could allow us to simplify things significantly.

  • if we do this: also remove the limit args on the urN_robot macros: all limits can be set using the .yaml files, no need for the args

  • if we don't migrate all constants to the .yaml file, let's not make the mistake of including the world frame in the main xacro files agian (Rename 'world' frame to 'robot_base' in URDF #284).

  • iirc, we don't need to limit all joints to [-pi, pi], just one (the elbow_joint). See Fix elbow joint limits #268.

@gavanderhoorn
Copy link
Member

@ipa-led: as I used a squash-and-merge of #356 the first few commits of your PR now conflict with kinetic-devel. Sorry about that.

Could you rebase and the fix merge conflicts? That would also give you an opportunity to drop all the merge commits that Github introduced when updating your branch.

@dhled
Copy link
Author

dhled commented Sep 6, 2018

Hey @gavanderhoorn

Sorry for the delay on this one. I've made the requested changes. Please tell what you think.

If possible @ipa-nhg or @ipa-jfh can review it too.

@gavanderhoorn
Copy link
Member

Starting to get there @ipa-led :)

Any reason you did not add the mesh URLs to the yaml files?

That would allow ppl to use custom meshes, which would help with #267.

@gavanderhoorn
Copy link
Member

Similar question on the inertia parameters and origins.

@dhled
Copy link
Author

dhled commented Sep 6, 2018

No particular reason. It looks, indeed, that we can add more parameters (we also discussed this with Nadia). I will try to update it next week. Thank you.

@v4hn
Copy link

v4hn commented Sep 7, 2018

This looks like a nice change w.r.t. urdf-calibration support.

I'm not sure whether it makes sense to export everything to yaml, because you will eventually end up with a general-purpose xacro forward to yaml... unless this is exactly what you want.
Might make it harder to debug things though when setting up new systems.

But I do see the advantage to overload the specific mesh of wrist3...

nitpick: typo compute_lenght

@gavanderhoorn
Copy link
Member

@v4hn wrote:

I'm not sure whether it makes sense to export everything to yaml, because you will eventually end up with a general-purpose xacro forward to yaml... unless this is exactly what you want.

yes, that is one of the possible end goals.

But nothing will be removed without leaving some time for testing.

<limit lower="${shoulder_pan_lower_limit}" upper="${shoulder_pan_upper_limit}" effort="330.0" velocity="2.16"/>
</xacro:if>
<limit lower="${shoulder_pan_lower_limit}" upper="${shoulder_pan_upper_limit}"
effort="${shoulder_pan_effort_limit}" velocity="shoulder_pan_velocity_limit"/>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for the velocity limit the curly brackets are missed:

velocity="${ shoulder_pan_velocity_limit }"/>


offsets:
shoulder_offset: 0.13585 # measured from model
elbow_offset: -0.119 # measured from model
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the elbow_offset was originally -0.1197


offsets:
shoulder_offset: 0.13585 # measured from model
elbow_offset: -0.119 # measured from model
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the elbow_offset was originally -0.1197

@ipa-nhg
Copy link
Member

ipa-nhg commented Sep 20, 2018

Great job @ipa-led !!

From the technical point of view:

I tested the simulation of the 3 robots and it is working if you solve the issue I commented.

Also I generated the urdf code of the 3 models using:
rosrun xacro xacro urX_robot.urdf.xacro > urX_robot.urdf

and I compared the outcome with the outcome of the current upstream version, the only differences I found were a mistake copying the numbers, that the world link was removed and that all the xacro:property are not listed.

About the style:

I really like this solution, it is much cleaner and give us the chance to simplify the repository.

@dhled
Copy link
Author

dhled commented Oct 4, 2018

Made the change requested by @ipa-nhg

I will export also the rest of the parameters.

ipa-nhg
ipa-nhg previously approved these changes Oct 18, 2018
@gavanderhoorn
Copy link
Member

This is not finished iiuc @ipa-nhg.

@ipa-nhg
Copy link
Member

ipa-nhg commented Oct 18, 2018

@gavanderhoorn what about merge this PR and create a new PR for the new changes?
The problem I see is a future conflict with https://github.com/ros-industrial/universal_robot/pull/380/files

@gavanderhoorn
Copy link
Member

@gavanderhoorn what about merge this PR and create a new PR for the new changes?
The problem I see is a future conflict with https://github.com/ros-industrial/universal_robot/pull/380/files

#380 introduces new packages, so none of the files that this PR touches are changed by #380.

@ipa-nhg
Copy link
Member

ipa-nhg commented Nov 8, 2018

@gavanderhoorn I'm agree that #380 introduce new packages, but those packages have the same function as the modified here and have to be updated to follow the same structure

@dhled dhled force-pushed the ur_description_args branch 2 times, most recently from b6118e0 to ede7c5a Compare December 17, 2018 14:35
@fmauch fmauch mentioned this pull request Mar 29, 2019
@gavanderhoorn
Copy link
Member

Is this still something you'd like to continue with @ipa-led?

@dhled
Copy link
Author

dhled commented Jul 2, 2019

On it for the wrid19

@dhled dhled force-pushed the ur_description_args branch 2 times, most recently from 9320eda to b7d9f88 Compare July 2, 2019 10:53
Copy link
Member

@miguelprada miguelprada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In addition to the, admittedly minor, inline comments, I think this is good to go. Particularly considering it's probably been in use for a while already, via @fmauch's fork.

Apologies for letting this sit idle for so long, @ipa-led.

<!-- robot model parameters files-->
<arg name="joints_limits_params" default="$(find ur_description)/config/ur10/joints_limits_parameters.yaml"/>
<arg name="physical_params" default="$(find ur_description)/config/ur10/physical_parameters.yaml"/>

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any particular reason not to expose the visual_params argument to the ur..._upload.launch files?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not really (or at least I don't remember why I did that) ... I will change that

@@ -1,10 +1,10 @@
<?xml version="1.0"?>
<launch>
<include file="$(find ur_e_description)/launch/ur10e_upload.launch"/>
<include file="$(find ur_description)/launch/ur10e_upload.launch"/>

<node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" >
<param name="use_gui" value="true"/>
</node>
<node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not quite part of this PR, but this should probably be replaced to use robot_state_publisher instead of the deprecated state_publisher.

<arg name="safety_pos_margin" default="0.15" doc="The lower/upper limits in the safety controller" />
<arg name="safety_k_position" default="20" doc="Used to set k position in the safety controller" />

<param name="robot_description" command="$(find xacro)/xacro '$(find ur_description)/urdf/ur_robot.urdf.xacro' --inorder
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this targets melodic-devel, shouldn't --inorder be dropped?

@dhled
Copy link
Author

dhled commented Mar 4, 2020

@fmauch @miguelprada @gavanderhoorn

I should have added feature to solve Miguel's comment (sorry, took me way too long).

@gavanderhoorn gavanderhoorn changed the base branch from melodic-devel to melodic-devel-staging March 19, 2020 15:42
@gavanderhoorn
Copy link
Member

@ipa-led: picking this up again. I've just changed the target to a new melodic-devel-staging, to avoid users using melodic-devel and finding it in a broken state (we have a nr of other changes coming in from #448).

We'll merge this as-is now.

Thanks for iterating and for the (enormous) amount of effort. I believe this is definitely an improvement over the current state of things. We trade N almost identical macros for a single one with a nr of arguments. I believe that will scale better wrt maintenance, but let's see.

@gavanderhoorn
Copy link
Member

@ipa-led: could you clarify why you've chosen to separate the parameters for the various parts of the models into different files? There are different files for the appearance and physical parameters. I'm trying to understand whether it would make sense to merge those two.

The joint limits can certainly be kept separate: if we restructure/extend the file a little bit, it could also be used directly by MoveIt (instead of the separate file that's now hosted in the config/ sub dir of the MoveIt cfg packages).

@dhled
Copy link
Author

dhled commented Mar 20, 2020

@ipa-led: could you clarify why you've chosen to separate the parameters for the various parts of the models into different files? There are different files for the appearance and physical parameters. I'm trying to understand whether it would make sense to merge those two.

I think at that time I have separated by "concerns" (graphical, physicial, limits) but maybe it doesn't make sense to split. It just that maybe people wants to modify one file and ensuring that it doesn't impact the others.

The joint limits can certainly be kept separate: if we restructure/extend the file a little bit, it could also be used directly by MoveIt (instead of the separate file that's now hosted in the config/ sub dir of the MoveIt cfg packages).

I will have a look at that :)

@gavanderhoorn
Copy link
Member

You don't have to add anything to this PR. We'll merge into the staging branch and can then continue there with follow-up PRs.

@fmauch
Copy link
Contributor

fmauch commented May 5, 2020

Anything happening here recently?

@lianghongzhuo
Copy link

Can we please push this forward?

@dhled
Copy link
Author

dhled commented May 6, 2020

Anything happening here recently?

I don't know if we are waiting for this be merge or for me to add other things.

@v4hn
Copy link

v4hn commented May 6, 2020

@gavanderhoorn twice now you wrote you will merge this as-is, but that was two months ago.
Are you going to do so?

@miguelprada
Copy link
Member

Sorry, I had assumed this was already merged. Apologies for letting it sit for so long.

Any reason not to merge already, @gavanderhoorn, @ipa-nhg?

@lianghongzhuo
Copy link

What's going on here?

Copy link
Member

@ipa-nhg ipa-nhg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 Thanks @ipa-led

Copy link
Member

@gavanderhoorn gavanderhoorn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merging this into staging branch.

@gavanderhoorn gavanderhoorn merged commit 0eed4d7 into ros-industrial:melodic-devel-staging Jun 6, 2020
@gavanderhoorn
Copy link
Member

Thanks @ipa-led 👍

Great work and I believe this will greatly simplify maintenance of these packages in the future.

🤖 🇫🇷

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants