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

Don't assume gripper controller for single joint control in MoveIt Setup Assistant #2555

Merged
merged 5 commits into from Nov 29, 2023

Conversation

forrest-rm
Copy link
Contributor

Description

The MoveIt Setup Assistant assumed any controller with a single joint was a gripper controller. This created a bug in the generated ros2_controllers yaml with parameter joint instead of joints.

@bmagyar
Copy link
Member

bmagyar commented Nov 27, 2023

We'd also like this backported to Humble

@sjahr sjahr added backport-humble Mergify label that triggers a PR backport to Humble backport-iron Mergify label that triggers a PR backport to Iron labels Nov 27, 2023
Copy link

codecov bot commented Nov 27, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (7e83fe6) 50.52% compared to head (172a2d1) 50.52%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2555      +/-   ##
==========================================
+ Coverage   50.52%   50.52%   +0.01%     
==========================================
  Files         387      387              
  Lines       32099    32099              
==========================================
+ Hits        16215    16216       +1     
+ Misses      15884    15883       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -192,7 +192,7 @@ bool ROS2ControllersConfig::GeneratedControllersConfig::writeYaml(YAML::Emitter&
emitter << YAML::Value;
emitter << YAML::BeginMap;
{
if (ci.joints_.size() != 1)
if (ci.type_ != "position_controllers/GripperActionController")
Copy link
Contributor

Choose a reason for hiding this comment

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

While the diff will be slightly larger - maybe swap these statements so that we aren't working in negatives?

if (ci.type_ == "position_controllers/GripperActionController")
{
  emitter << YAML::Key << "joint" << YAML::Value << ci.joints_[0];
}
else
{
  emitter << YAML::Key << "joints" << YAML::Value << ci.joints_;
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The default behavior is to use the "joints" parameter as only the gripper controller uses the singular "joint". Either putting the "default" or "positive" clause first would work, but I think I'll leave it as is for now.

@forrest-rm forrest-rm closed this Nov 28, 2023
@forrest-rm forrest-rm reopened this Nov 28, 2023
@sjahr sjahr enabled auto-merge (squash) November 29, 2023 16:08
@sjahr sjahr merged commit 81094a6 into ros-planning:main Nov 29, 2023
20 of 21 checks passed
mergify bot pushed a commit that referenced this pull request Nov 29, 2023
…tup Assistant (#2555)

* For single joint controllers which are not gripper controllers, still output joints list

* Use OR

* Only check for GripperActionController

Co-authored-by: Sebastian Jahr <sebastian.jahr@picknik.ai>

---------

Co-authored-by: Sebastian Jahr <sebastian.jahr@picknik.ai>
(cherry picked from commit 81094a6)
mergify bot pushed a commit that referenced this pull request Nov 29, 2023
…tup Assistant (#2555)

* For single joint controllers which are not gripper controllers, still output joints list

* Use OR

* Only check for GripperActionController

Co-authored-by: Sebastian Jahr <sebastian.jahr@picknik.ai>

---------

Co-authored-by: Sebastian Jahr <sebastian.jahr@picknik.ai>
(cherry picked from commit 81094a6)
henningkayser pushed a commit that referenced this pull request Dec 15, 2023
…tup Assistant (backport #2555) (#2560)

* For single joint controllers which are not gripper controllers, still output joints list

* Use OR

* Only check for GripperActionController

Co-authored-by: Sebastian Jahr <sebastian.jahr@picknik.ai>

---------

Co-authored-by: Sebastian Jahr <sebastian.jahr@picknik.ai>
(cherry picked from commit 81094a6)

Co-authored-by: Forrest Rogers-Marcovitz <39061824+forrest-rm@users.noreply.github.com>
henningkayser pushed a commit that referenced this pull request Dec 15, 2023
…tup Assistant (backport #2555) (#2559)

* For single joint controllers which are not gripper controllers, still output joints list

* Use OR

* Only check for GripperActionController

Co-authored-by: Sebastian Jahr <sebastian.jahr@picknik.ai>

---------

Co-authored-by: Sebastian Jahr <sebastian.jahr@picknik.ai>
(cherry picked from commit 81094a6)

Co-authored-by: Forrest Rogers-Marcovitz <39061824+forrest-rm@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-humble Mergify label that triggers a PR backport to Humble backport-iron Mergify label that triggers a PR backport to Iron
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants