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

Cancel in-progress trajectories. #400

Merged
merged 11 commits into from
Aug 4, 2018

Conversation

brianhou
Copy link
Contributor

@brianhou brianhou commented May 7, 2018

There was a comment that suggested that this isn't supported by rewd_controllers yet, but it seems like it might be? We should test this out on the real hardware.


Before creating a pull request

  • Document new methods and classes
  • Format code with make format

Before merging a pull request

  • Set version target by selecting a milestone on the right side
  • Summarize this change in CHANGELOG.md
  • Add unit test(s) for this change

@codecov
Copy link

codecov bot commented May 8, 2018

Codecov Report

Merging #400 into master will decrease coverage by 0.08%.
The diff coverage is 38.88%.

@@            Coverage Diff             @@
##           master     #400      +/-   ##
==========================================
- Coverage   78.98%   78.89%   -0.09%     
==========================================
  Files         258      258              
  Lines        6296     6303       +7     
==========================================
  Hits         4973     4973              
- Misses       1323     1330       +7
Impacted Files Coverage Δ
include/aikido/control/TrajectoryExecutor.hpp 100% <ø> (ø) ⬆️
src/control/InstantaneousTrajectoryExecutor.cpp 92.85% <0%> (ø) ⬆️
src/control/ros/RosTrajectoryExecutor.cpp 0% <0%> (ø) ⬆️
.../control/KinematicSimulationTrajectoryExecutor.cpp 84.5% <40%> (-2.45%) ⬇️
src/control/QueuedTrajectoryExecutor.cpp 93.61% <83.33%> (ø) ⬆️

@jslee02 jslee02 added this to the Aikido 0.3.0 milestone May 9, 2018
DART_UNUSED(lock); // Suppress unused variable warning.

if (mInProgress)
mGoalHandle.cancel();
Copy link
Member

Choose a reason for hiding this comment

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

Would it be useful to print a warning something like "Attempting to abort trajectory execution but no trajectory in progress."?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That sounds like a good idea. We should do this to the other TrajectoryExecutor::abort implementations as well.

@@ -234,7 +234,11 @@ void RosTrajectoryExecutor::step(
//==============================================================================
void RosTrajectoryExecutor::abort()
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd prefer "cancel" instead of "abort". It seems like "cancel" and "abort" are different terms in ros_control; "cancel" is where the client requested to cancel the trajectory, and "abort" is where the server had to stop it for some other reason (e.g. force threshold has been violated).

http://wiki.ros.org/actionlib/DetailedDescription

@gilwoolee
Copy link
Contributor

Shouldn't we add the method to TrajectoryExecutor and support the same functionality in KinematicSimulationTrajectoryExecutor?

@brianhou
Copy link
Contributor Author

brianhou commented Jul 2, 2018

I think KinematicSimulationTrajectoryExecutor already has this abort implemented (although as you said, it should probably be renamed to cancel).

My understanding is that we're not using actionlib in simulation, so this particular implementation is not helpful there.

@gilwoolee
Copy link
Contributor

Oops- sorry I wasn't aware that the base class / KinematicSimulationTrajectoryExecutor had this method. I think it's all good as long as we rename it then!

@brianhou
Copy link
Contributor Author

brianhou commented Aug 2, 2018

@Tonkel said that they're using this in the feeding demo already, so it looks like this works! @gilwoolee or @jslee02 would you mind taking one last look before merging?

jslee02
jslee02 previously approved these changes Aug 2, 2018
@@ -43,7 +43,7 @@ class InstantaneousTrajectoryExecutor : public TrajectoryExecutor
const std::chrono::system_clock::time_point& /*timepoint*/) override;

// Do nothing.
Copy link
Member

@jslee02 jslee02 Aug 2, 2018

Choose a reason for hiding this comment

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

Nit: /// Does nothing? Note three slashes.

@@ -4,6 +4,7 @@
#include <chrono>
#include <future>
#include <set>
#include <dart/common/Console.hpp>
Copy link
Member

Choose a reason for hiding this comment

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

Nit: This can be moved to the cpp file.

@@ -58,8 +58,8 @@ class RosTrajectoryExecutor : public aikido::control::TrajectoryExecutor
/// Regularly checks for the completion of a sent trajectory.
void step(const std::chrono::system_clock::time_point& timepoint) override;

// Do nothing.
void abort() override;
// \copydoc TrajectoryExecutor::cancel()
Copy link
Member

Choose a reason for hiding this comment

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

Nit: ///

mGoalHandle.cancel();
else
dtwarn << "[RosTrajectoryExecutor::cancel] Attempting to "
<< "cancel trajectory, but no trajectory in progress.\n";
Copy link
Member

Choose a reason for hiding this comment

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

Nit: Please wrap multiple lines with curly brackets.

@brianhou brianhou force-pushed the enhancement/brianhou/ros-traj-abort branch from 0dbbe07 to 9e360d2 Compare August 3, 2018 22:30
@brianhou brianhou merged commit de4ea8b into master Aug 4, 2018
@brianhou brianhou deleted the enhancement/brianhou/ros-traj-abort branch August 4, 2018 06:30
gilwoolee pushed a commit that referenced this pull request Jan 21, 2019
* Cancel actionlib goal.

* Rename abort to cancel to match actionlib.

* Add warning when no trajectory is in progress.

* Update CHANGELOG.md.

* Address PR comments.
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.

3 participants