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

Add parameter to TrajectoryFollower stop rotation when bearing is reached #1349

Merged
merged 7 commits into from
Feb 25, 2022

Conversation

iche033
Copy link
Contributor

@iche033 iche033 commented Feb 18, 2022

Signed-off-by: Ian Chen [email protected]

🎉 New feature

Summary

Added parameter <zero_vel_on_bearing_reached>. When set to true, it forces angular velocity to be zero when the target bearing is reached. This is intended to remove any residue angular velocity of the link and prevent overshooting.

Test it

Test with trajectory_follower.sdf world. box_02 now has this parameter set and uses high torque for faster rotation and should not overshoot

ign gazebo -v 4 ./src/ign-gazebo/examples/worlds/trajectory_follower.sdf

Checklist

  • Signed all commits for DCO
  • Added tests
  • Added example and/or tutorial
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.

@iche033 iche033 requested a review from caguero February 18, 2022 01:57
@github-actions github-actions bot added the 🏯 fortress Ignition Fortress label Feb 18, 2022
@azeey azeey removed their request for review February 18, 2022 01:59
@codecov
Copy link

codecov bot commented Feb 18, 2022

Codecov Report

Merging #1349 (5a77fcd) into ign-gazebo6 (8b8b9f6) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@               Coverage Diff               @@
##           ign-gazebo6    #1349      +/-   ##
===============================================
+ Coverage        62.92%   62.93%   +0.01%     
===============================================
  Files              299      299              
  Lines            24159    24167       +8     
===============================================
+ Hits             15202    15210       +8     
  Misses            8957     8957              
Impacted Files Coverage Δ
include/ignition/gazebo/Link.hh 100.00% <ø> (ø)
src/systems/physics/Physics.cc 71.55% <ø> (ø)
src/Link.cc 94.77% <100.00%> (+0.28%) ⬆️

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 8b8b9f6...5a77fcd. Read the comment docs.


// force angular velocity to be zero when bearing is reached
if (this->dataPtr->forceZeroAngVel &&
math::equal(std::abs(bearing.Degree()), 0.0, 1.0))
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need the second expression math::equal(std::abs(bearing.Degree()), 0.0, 1.0)?

We're supposed to be within the acceptable range bearing. If we need higher bearing accuracy, I think we should change the parameter bearingTolerance.

Copy link
Contributor Author

@iche033 iche033 Feb 22, 2022

Choose a reason for hiding this comment

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

The behavior I found without this check is that as soon as the vehicle moves forward 1 iteration, its bearing immediately becomes outside of bearingTolerance. So it constantly switched back and forth between rotation and moving forward. The problem was that removing the AngularVelocityCmd component is found to be very expensive and this locks up simulation. With this check, I still do notice a slight pause in simulation when the component is being removed but it only happens occasionally when bearing needs to be corrected.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tweaked the 2nd tol check to be a percentage of bearingTolerance. aa8cf68

Copy link
Contributor

@caguero caguero left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@iche033 iche033 merged commit d3a5015 into ign-gazebo6 Feb 25, 2022
@iche033 iche033 deleted the traj_follower_stop_rotation branch February 25, 2022 00:00
@osrf-triage
Copy link

This pull request has been mentioned on Gazebo Community. There might be relevant details there:

https://community.gazebosim.org/t/new-ignition-releases-2022-03-01-citadel-edifice-fortress/1313/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏯 fortress Ignition Fortress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants