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

WIP: Use anchors and aliases for each joint in controller config + cleanup #554

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

captain-yoshi
Copy link
Contributor

This PR uses anchors and aliases on each robot joint and sets indentation level to 2 spaces (there were mixed indentation). This makes the following benefits:

  • Same indentation level (set to 2 but can be anything)
  • Consistency with string values (removed dquotes)
  • PID and trajectory/goal section is easier on the eyes...
  • Adding a prefix to joint names is easier (less search and replace)

Only did the changes for the UR3. If you think this change could be merged, I will modify the other UR config files.

Copy link
Collaborator

@fmauch fmauch left a comment

Choose a reason for hiding this comment

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

Thanks for taking the effort diving into this. Please see my comments and if this is going to be merged, all controller files should be handled I think.

Comment on lines +38 to +43
*joint1: {trajectory: 0.2, goal: 0.1}
*joint2: {trajectory: 0.2, goal: 0.1}
*joint3: {trajectory: 0.2, goal: 0.1}
*joint4: {trajectory: 0.2, goal: 0.1}
*joint5: {trajectory: 0.2, goal: 0.1}
*joint6: {trajectory: 0.2, goal: 0.1}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I am not sure whether using anchors for this really improves things. Yes, it is less code duplication, but in my opinion this is also less readable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If someone uses the prefix below in their urdf:

<xacro:ur3_robot prefix="ur3_"/>

All the joints must be renamed, with anchors/aliases you only need to rename 6 joint names. Would something like this be better ?

    *shoulder_pan_joint:  {trajectory: 0.2, goal: 0.1}
    *shoulder_lift_joint: {trajectory: 0.2, goal: 0.1}
    *elbow_joint:         {trajectory: 0.2, goal: 0.1}
    *wrist_1_joint:       {trajectory: 0.2, goal: 0.1}
    *wrist_2_joint:       {trajectory: 0.2, goal: 0.1}
    *wrist_3_joint:       {trajectory: 0.2, goal: 0.1}

Copy link
Contributor

Choose a reason for hiding this comment

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

have you considered using subst_value? I don't believe you'd need to manually rename anything.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This would work with the /my_controller/joints because they are values, but I would need to remap the constraints, gains and velocity_ff namespaces:

 * /pos_joint_traj_controller/constraints/ur3_elbow_joint/goal: 0.1
 * /pos_joint_traj_controller/constraints/ur3_elbow_joint/trajectory: 0.2
 * /pos_joint_traj_controller/constraints/ur3_shoulder_lift_joint/goal: 0.1
 * /pos_joint_traj_controller/constraints/ur3_shoulder_lift_joint/trajectory: 0.2
 * /pos_joint_traj_controller/constraints/ur3_shoulder_pan_joint/goal: 0.1
 * /pos_joint_traj_controller/constraints/ur3_shoulder_pan_joint/trajectory: 0.2
 * /pos_joint_traj_controller/constraints/ur3_wrist_1_joint/goal: 0.1
 * /pos_joint_traj_controller/constraints/ur3_wrist_1_joint/trajectory: 0.2
 * /pos_joint_traj_controller/constraints/ur3_wrist_2_joint/goal: 0.1
 * /pos_joint_traj_controller/constraints/ur3_wrist_2_joint/trajectory: 0.2
 * /pos_joint_traj_controller/constraints/ur3_wrist_3_joint/goal: 0.1
 * /pos_joint_traj_controller/constraints/ur3_wrist_3_joint/trajectory: 0.2

When adding new controllers I would have to remap the new controller namespace. With the anchors solution I don't have to bother, it scales well when adding new controllers. I may be missing something...

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't understand what you write here.

But perhaps I also don't fully understand what you're trying to achieve.

@gavanderhoorn
Copy link
Contributor

Something to keep in mind: anchors et al. are not part of the YAML standard.

They never made it past the draft/proposed state of YAML 1.1 (IIRC).

@github-actions
Copy link

This PR hasn't made any progress for quite some time and will be closed soon. Please comment if it is still relevant.

@github-actions github-actions bot added the Stale label Jan 24, 2023
@fmauch
Copy link
Collaborator

fmauch commented Jan 27, 2023

I don't necessarily want to have this closed by a bot, hence commenting on this.

@github-actions github-actions bot removed the Stale label Jan 27, 2023
@github-actions
Copy link

This PR hasn't made any progress for quite some time and will be closed soon. Please comment if it is still relevant.

@github-actions github-actions bot added the Stale label Apr 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants