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

[MSA] ros2_control Integration #1299

Merged
merged 9 commits into from
Jun 14, 2022

Conversation

DLu
Copy link
Contributor

@DLu DLu commented Jun 1, 2022

Description

Modifies the existing ControllersWidget to generate moveit_controllers.yaml (Generating ros_controllers.yaml will be a different PR). The main functional difference is in the formatting of the yaml.

Edit: I realized I could reuse a lot of the existing functionality for both moveit_controllers.yaml and ros2_controllers.yaml.

Here is the full ros2_control flow:

URDF Modifications

Screenshot from 2022-06-07 10-44-47

ROS2 Controllers

Screenshot from 2022-06-07 10-44-58

MoveIt Controllers

Screenshot from 2022-06-07 10-45-05

Checklist

  • Required by CI: Code is auto formatted using clang-format
  • Extend the tutorials / documentation reference
  • Document API changes relevant to the user in the MIGRATION.md notes
  • Create tests, which fail without this PR reference
  • Include a screenshot if changing a GUI
  • While waiting for someone to review your request, please help review another open pull request to support the maintainers

@DLu DLu requested a review from vatanaksoytezer June 1, 2022 14:12
@codecov
Copy link

codecov bot commented Jun 1, 2022

Codecov Report

Merging #1299 (fb88c6a) into feature/msa (5608368) will decrease coverage by 0.02%.
The diff coverage is n/a.

@@               Coverage Diff               @@
##           feature/msa    #1299      +/-   ##
===============================================
- Coverage        61.58%   61.56%   -0.01%     
===============================================
  Files              274      274              
  Lines            24966    24966              
===============================================
- Hits             15373    15369       -4     
- Misses            9593     9597       +4     
Impacted Files Coverage Δ
...nning_scene_monitor/src/planning_scene_monitor.cpp 45.29% <0.00%> (-0.43%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5608368...fb88c6a. Read the comment docs.

Copy link
Contributor

@jliukkonen jliukkonen left a comment

Choose a reason for hiding this comment

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

I tested this locally and the result looks OK. I left couple questions about small things here and there.

One another thing I noticed while testing this is the following error:
auto_add_error

I get that error after clicking the Auto Add FollowJointsTrajectory Controllers For Each Planning Group button. I get that error even when I do have planning groups defined (like in that screenshot). If the list of controllers is empty, no error, but clicking on the auto add button again shows that error popup. I didn't check if it is related to this particular PR but it might be fixable within this PR.

/**
* \brief Adds a controller to ros_controllers_config_ vector
* \brief Adds a controller to controllers_config_ vector
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be a nice improvement if every function followed this documentation style with brief, then parameters (input or output, hopefully never output or mixed) and return, when applicable.

// TODO: Output possible trajectory_execution parameters including...
// * allowed_execution_duration_scaling: 1.2
// * allowed_goal_duration_margin: 0.5
// * allowed_start_tolerance: 0.01
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider adding these in this PR. 🙏

@DLu DLu force-pushed the feature/msa_moveit_control branch from c653b3c to d64892e Compare June 7, 2022 15:07
@DLu DLu changed the title [MSA] Generate MoveIt Controllers [MSA] ros2_control Integration Jun 7, 2022
@DLu DLu mentioned this pull request Jun 7, 2022
6 tasks
@DLu DLu force-pushed the feature/msa_moveit_control branch from b34262f to e371b31 Compare June 8, 2022 17:01
Copy link
Contributor

@vatanaksoytezer vatanaksoytezer left a comment

Choose a reason for hiding this comment

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

I tested this and was able to generate ros2_control files without any problems. The launch files at least launch normally know. I'm still getting the following error when I'm launching demo.launch.py:

[spawner-5] [INFO] [1654786906.095245390] [spawner_panda_arm_hand_controller]: Waiting for '/controller_manager' services to be available
[spawner-6] [INFO] [1654786906.095696045] [spawner_joint_state_broadcaster]: Waiting for '/controller_manager' services to be available
[spawner-6] [INFO] [1654786908.102498881] [spawner_joint_state_broadcaster]: Waiting for '/controller_manager' services to be available
[spawner-5] [INFO] [1654786908.102495244] [spawner_panda_arm_hand_controller]: Waiting for '/controller_manager' services to be available
[spawner-5] [INFO] [1654786910.110568133] [spawner_panda_arm_hand_controller]: Waiting for '/controller_manager' services to be available
[spawner-6] [INFO] [1654786910.110702876] [spawner_joint_state_broadcaster]: Waiting for '/controller_manager' services to be available
[spawner-6] [INFO] [1654786912.118679627] [spawner_joint_state_broadcaster]: Waiting for '/controller_manager' services to be available
[spawner-5] [INFO] [1654786912.119128218] [spawner_panda_arm_hand_controller]: Waiting for '/controller_manager' services to be available
[spawner-6] [ERROR] [1654786914.127482870] [spawner_joint_state_broadcaster]: Controller manager not available
[spawner-5] [ERROR] [1654786914.128252414] [spawner_panda_arm_hand_controller]: Controller manager not available

which might be out of scope of this PR. Another TODO would be to fix the rviz configs as well., which is also out of scope of this PR. Thus, I'm happy to approve as is.

@DLu
Copy link
Contributor Author

DLu commented Jun 9, 2022

was able to generate ros2_control files without any problems. The launch files at least launch normally know. I'm still getting the following error when I'm launching demo.launch.py:

@vatanaksoytezer Was this with a clean panda config, or building off of the existing one?

Another TODO would be to fix the rviz configs as well., which is also out of scope of this PR.

@vatanaksoytezer Open a ticket? I'm not sure what you're talking about

@vatanaksoytezer
Copy link
Contributor

@vatanaksoytezer Was this with a clean panda config, or building off of the existing one?

A fresh panda config I generated with this branch from scratch.

@vatanaksoytezer Open a ticket? I'm not sure what you're talking about

When we launch rviz, the motion planning, robot model, fixed frame etc. on rviz.

@DLu
Copy link
Contributor Author

DLu commented Jun 10, 2022

I'm still getting the following error when I'm launching demo.launch.py:

This should be fixed with the latest commit. panda.urdf.xacro was not being properly generated.

When we launch rviz, the motion planning, robot model, fixed frame etc. on rviz.

I resolved this with #1316, but its on main and not the feature branch. I recommend we resolve #1315 and #1332 before rebasing.

@moveit moveit deleted a comment from mergify bot Jun 13, 2022
emitter << YAML::Key << "action_ns" << YAML::Value << "follow_joint_trajectory";
emitter << YAML::Key << "default" << YAML::Value << "true";
}
else
Copy link
Member

Choose a reason for hiding this comment

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

I believe you could safely drop this, or make it an error. All of the MoveIt ControllerManager stuff only works with FollowJointTrajectory, so there would be no reason to configure anything else.

@JafarAbdi @schornakj do you agree?

Suggested change
else
else
{
// Throw error or something
RCLCPP_WARN_STREAM((*logger_),
"MoveIt controllers only work with FollowJointTrajectory-type controllers.");
return false;
}

Comment on lines +113 to +114
if (controller.joints_.empty())
{
Copy link
Member

Choose a reason for hiding this comment

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

Is this basically creating one default joint, if none are defined? Prob should print a warning in this case.

Suggested change
if (controller.joints_.empty())
{
if (controller.joints_.empty())
{
RCLCPP_WARN_STREAM_ONCE((*logger_), "Did not find even one valid joint in the ros2_control yaml `joints` list. Creating a dummy default.");

@DLu DLu force-pushed the feature/msa_moveit_control branch from 2b4d321 to 25551c3 Compare June 14, 2022 14:55
@moveit moveit deleted a comment from mergify bot Jun 14, 2022
@AndyZe
Copy link
Member

AndyZe commented Jun 14, 2022

I'll keep an eye on this and merge when it passes CI

@DLu
Copy link
Contributor Author

DLu commented Jun 14, 2022

🎉

@AndyZe AndyZe merged commit 087664b into moveit:feature/msa Jun 14, 2022
@DLu DLu deleted the feature/msa_moveit_control branch June 14, 2022 17:00
vatanaksoytezer pushed a commit that referenced this pull request Jun 14, 2022
* Modified URDF Infrastructure

* Control Xacro Config

* URDF Modifications Widget

* Use same base class for ROS2Controllers and MoveItControllers (widget/config/setup_step)

* Further cleanup

* Fix ModifiedURDF Generation

* Apply suggestions from code review

Co-authored-by: AndyZe <andyz@utexas.edu>

* Rename button variable

* Clang line length fix

Co-authored-by: AndyZe <andyz@utexas.edu>
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

4 participants