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

Allow specification of controller names for trajectories #1832

Merged
merged 2 commits into from
Jan 21, 2020

Conversation

llach
Copy link
Contributor

@llach llach commented Jan 14, 2020

Description

This PR adds a list of controller names to ExecutableTrajectory which is passed to the TrajectoryExecutionManager (TEM) in PlanExecution::executeAndMonitor(). This allows users to specify which controllers should execute a certain trajectory (or only a part of it). The TEM already had the ability to manage different controllers for different trajectory parts, it just was not used before.

Additonally, the FakeControllerManager now reads the default parameter from the controller_list on the param server and initializes the ControllerState accordingly. Before, each ControllerState had default_ and active_ set to true which lead the TEM's controller selection mechanism to choose any controller when no explicit controller name was given.
The documentation mentions this parameter, but neither SimpleControllerManager nor FakeControllerManager use it.

When I did these changes, I stumbled upon comments hinting that controller switching was possible or discontinued. Someone with a better overview of MoveIt should probably decide whether it okay to allow it again.

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

@welcome
Copy link

welcome bot commented Jan 14, 2020

Thanks for helping in improving MoveIt and open source robotics!

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.

This work was done under my supervision to expose controller selection for MTC.
I generally approve this, with some minor comments.

Copy link
Member

@henningkayser henningkayser left a comment

Choose a reason for hiding this comment

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

+1 after question is addressed

@@ -262,12 +268,9 @@ class MoveItFakeControllerManager : public moveit_controller_manager::MoveItCont
* Controllers are all active and default.
*/
moveit_controller_manager::MoveItControllerManager::ControllerState
getControllerState(const std::string& /*name*/) override
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't the same be implemented for the SimpleControllerManager?

Copy link
Contributor

Choose a reason for hiding this comment

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

Probably. @llach, could you provide the same implementation for SimpleControllerManager as well?
I suggest to split this PR into two separate commits then:

  1. forwarding the controller set
  2. fixing FakeControllerManager and SimpleControllerManager to consider the config default
    So, Luca, please cleanup the commit history by appropriately squashing your changes.

@rhaschke
Copy link
Contributor

@llach, could you please squash my fixup, so that we can rebase-merge this PR? Thanks.

@llach
Copy link
Contributor Author

llach commented Jan 21, 2020

Done!

@codecov-io
Copy link

codecov-io commented Jan 21, 2020

Codecov Report

Merging #1832 into master will decrease coverage by 0.03%.
The diff coverage is 80%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1832      +/-   ##
==========================================
- Coverage    48.5%   48.47%   -0.04%     
==========================================
  Files         298      298              
  Lines       23302    23307       +5     
==========================================
- Hits        11302    11297       -5     
- Misses      12000    12010      +10
Impacted Files Coverage Δ
...ros/planning/plan_execution/src/plan_execution.cpp 12.91% <0%> (ø) ⬆️
...ler_manager/src/moveit_fake_controller_manager.cpp 64.21% <100%> (+0.76%) ⬆️
...veit_experimental/moveit_jog_arm/src/jog_calcs.cpp 66.55% <0%> (-3.04%) ⬇️
...eit_core/robot_trajectory/src/robot_trajectory.cpp 41.81% <0%> (ø) ⬆️

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 a6c173f...590a1d2. Read the comment docs.

- ExecutableTrajectory has a new member controller_names_
- PlanExecution includes that list when pushing trajctory parts to the
TrajectoryExecutionManager
When reading controller configurations, "default" is ignored as
opposed to what is currently written in the documentation.
MoveIt{Fake|Simple}ControllerManager now maintains map of controller name and
ControllerState where "default" is initialized as "false" or whatever
is given in the configuration.
MoveIt{Fake|Simple}ControllerManager::getControllerState() now returns the
state that is held in that map instead of a default one.
@welcome
Copy link

welcome bot commented Jan 21, 2020

Congrats on getting your first MoveIt pull request merged and improving open source robotics!

sjahr pushed a commit to sjahr/moveit that referenced this pull request Jun 21, 2024
…e Parameterization (moveit#1832)

* add velocity and accelerations scaling when using custom limits for time parameterization

* add scaling when passing in vecotor of joint-limits

* add function descriptions

* add verifyScalingFactor helper function

* make map const

* address feedback

* add comment

Co-authored-by: Michael Wiznitzer <michael.wiznitzer@resquared.com>
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.

4 participants