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

Backporting Joint Properties back to Noetic #109

Merged
merged 2 commits into from
Feb 28, 2023

Conversation

scchow
Copy link
Contributor

@scchow scchow commented Feb 25, 2023

This PR is a backport of #77 from Foxy to Noetic.

I am currently working on using MoveIt! for a differential drive robot in ROS1 and have been backporting components necessary for differential drive robots that was implemented for ROS2 back into ROS1.

This PR enables joint properties, which allows properties such as angular_distance_weight to be defined for joints.
These properties can then be used by the differential drive kinematics.

We also do the same code cleanup as seen in #77 and replace verbose joint validity checking with the newly defined isValidJoint() function.

- To set planar joints as differential drive, moveit2
  uses joint properties.
- This is a backport of the joint properties supported
  by moveit2 that currently exists on the foxy branch.
- Added tests for joint properties and applied refactors to model
  that use the new isValidJoint() function
Copy link
Contributor

@v4hn v4hn left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@scchow Do you plan to provide a follow-up PR that adds ports main feature to MoveIt as well?

@v4hn
Copy link
Contributor

v4hn commented Feb 28, 2023

Please refer to the original PR/commits (and if possible the authors) in the commit.

Copy link
Contributor

@rhaschke rhaschke left a comment

Choose a reason for hiding this comment

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

I understand that this is a backport. Nevertheless, I suggest rethinking the data structure to store joint properties to better reflect the intended semantics.
Before merging, you definitely need to fix the formatting errors (see instructions in CI job).

@@ -279,6 +314,11 @@ class Model
std::vector<CollisionPair> enabled_collision_pairs_;
std::vector<CollisionPair> disabled_collision_pairs_;
std::vector<PassiveJoint> passive_joints_;
std::map<std::string, std::vector<JointProperty>> joint_properties_;
Copy link
Contributor

Choose a reason for hiding this comment

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

Hm. My actual comment was lost. Here it is again:
I think this is the wrong data structure to store properties:

  • First, the joint name is stored redundantly both, in this map and in the JointProperty struct.
  • Second, the vector should actually be a map too (property name -> property value).
    It doesn't make sense to have multiple properties with same name but different value.

@v4hn
Copy link
Contributor

v4hn commented Feb 28, 2023 via email

@rhaschke
Copy link
Contributor

I agree there is a lot to criticize in this patch, but it is supposed to be a backport. As such I think it's sufficient. I would propose to keep the backport and add improvements on top to keep patches more compatible. Do you want to insist on improving the datastructures in this PR to merge?

Sorry, I'm somewhat frustrated about the poor quality of patches (and their reviews) applied to ROS2 branches.
If we don't insist on improvements immediately, when will they ever happen?

The CI failure is actually a missing clang-format-10 package and reads like a gha-config issue to me.

Ok. I will handle that.

@rhaschke
Copy link
Contributor

The CI failure is actually a missing clang-format-10 package and reads like a gha-config issue to me.

Ok. I will handle that.

Done: 177742b

@v4hn
Copy link
Contributor

v4hn commented Feb 28, 2023 via email

@scchow
Copy link
Contributor Author

scchow commented Feb 28, 2023

@scchow Do you plan to provide a follow-up PR that adds ports main feature to MoveIt as well?

@v4hn I am actually preparing a PR with a backport of moveit/moveit2#390 right now, just doing some final testing before submitting the PR.

I understand that this is a backport. Nevertheless, I suggest rethinking the data structure to store joint properties to better reflect the intended semantics. Before merging, you definitely need to fix the formatting errors (see instructions in CI job).

@rhaschke I understand and share your concerns with the redundant storage of joint_names and agree that using a map would streamline accessing the joint properties. My goal with this PR was to do a 1-to-1 backport of the ROS2 implementation to avoid introducing additional bugs when integrating with the backport of MoveIt2's diff drive implementation.
Once I have that working, I'll be happy to come back and see if I can submit another PR cleaning up the JointProperty data structures.

@rhaschke rhaschke merged commit 04c7726 into moveit:noetic-devel Feb 28, 2023
@rhaschke
Copy link
Contributor

I'll be happy to come back and see if I can submit another PR cleaning up the JointProperty data structures.

I filed a corresponding issue: #110 😉

rhaschke pushed a commit that referenced this pull request Feb 28, 2023
@rhaschke
Copy link
Contributor

Unfortunately, there were still formatting issues. I fixed them and force-pushed. Please update your branch to the current master.

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.

None yet

3 participants