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
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -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.

{
emitter << YAML::Key << "joints" << YAML::Value << ci.joints_;
}
Expand Down