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

[RotationShimController] Rotate to goal heading #4332

Merged
merged 1 commit into from
May 29, 2024

Conversation

gennartan
Copy link
Contributor

When arriving in the goal xy tolerance, the rotation shim controller takes back the control to command the robot to rotate in the goal heading orientation.

The initial goal of the rotationShimController was to rotate the robot at the beginning of a navigation towards the paths orientation because some controllers are not good at performing in place rotations. For the same reason, the rotationShimController should be able to rotate the robot towards the goal heading.


Basic Info

Info Please fill out this column
Ticket(s) this addresses #4289
Primary OS tested on Ubuntu
Robotic platform tested on Gazebo simulation on custom robot
Does this PR contain AI generated software? No

Description of contribution in a few bullet points

  • Add new feature to rotationShimController: It can rotate towards the goal heading when arriving in goal XY tolerance

Description of documentation updates required from your changes

  • Added new parameter ´rotate_to_goal_heading´, so need to add that to default configs and documentation page

Future work that may be required in bullet points

For Maintainers:

  • Check that any new parameters added are updated in docs.nav2.org
  • Check that any significant change is added to the migration guide
  • Check that any new features OR changes to existing behaviors are reflected in the tuning guide
  • Check that any new functions have Doxygen added
  • Check that any new features have test coverage
  • Check that any new plugins is added to the plugins page
  • If BT Node, Additionally: add to BT's XML index of nodes for groot, BT package's readme table, and BT library lists

@SteveMacenski
Copy link
Member

SteveMacenski commented May 13, 2024

@gennartan please see #4290 (comment) if you hadn't already

@SteveMacenski
Copy link
Member

Please also make sure to sign off your commits. See the DCO failed job for details

SteveMacenski referenced this pull request May 13, 2024
When arriving in the goal xy tolerance, the rotation shim controller
takes back the control and perform the necessary rotation to be in the
correct goal orientation.

This can be useful when the final orientaion of the robot matters. It
can also simplify the configuration of the primary controller since it
would not have to be configured to be able to reach the target
orientation.
@gennartan gennartan force-pushed the test_goal_rotation branch 2 times, most recently from 3aabd4a to 4095c29 Compare May 25, 2024 21:27
@SteveMacenski
Copy link
Member

Essentially done though, this looks good to me. Did you test this out?

@gennartan
Copy link
Contributor Author

gennartan commented May 28, 2024

Essentially done though, this looks good to me. Did you test this out?

Yes I tested it in simulation. It works fine.

@gennartan please see #4290 (comment) if you hadn't already

I missed this comment the other day. Now it is fixed (and tested) 😄

@SteveMacenski
Copy link
Member

@gennartan see my new review comments, some are outstanding still. Then I think the last thing left if just adding the new parameter to the configuration guide for this plugin + add to the migration guide that this is a new available feature!

@gennartan gennartan force-pushed the test_goal_rotation branch 2 times, most recently from 5c13988 to 54c1b34 Compare May 28, 2024 19:54
@SteveMacenski
Copy link
Member

I think just docs left now!

When arriving in the goal xy tolerance, the rotation shim controller
takes back the control to command the robot to rotate in the goal
heading orientation.

The initial goal of the rotationShimController was to rotate the robot
at the beginning of a navigation towards the paths orientation because
some controllers are not good at performing in place rotations. For the
same reason, the rotationShimController should be able to rotate the
robot towards the goal heading.

Signed-off-by: Antoine Gennart <gennart.antoine@gmail.com>
@SteveMacenski
Copy link
Member

@gennartan
Copy link
Contributor Author

here is the PR: ros-navigation/docs.nav2.org#561

@SteveMacenski SteveMacenski merged commit 30e2cde into ros-navigation:main May 29, 2024
9 of 10 checks passed
@SteveMacenski
Copy link
Member

Thanks @gennartan !

@gennartan gennartan deleted the test_goal_rotation branch May 29, 2024 19:52
@gennartan gennartan restored the test_goal_rotation branch May 29, 2024 19:53
SteveMacenski pushed a commit that referenced this pull request May 31, 2024
When arriving in the goal xy tolerance, the rotation shim controller
takes back the control to command the robot to rotate in the goal
heading orientation.

The initial goal of the rotationShimController was to rotate the robot
at the beginning of a navigation towards the paths orientation because
some controllers are not good at performing in place rotations. For the
same reason, the rotationShimController should be able to rotate the
robot towards the goal heading.

Signed-off-by: Antoine Gennart <gennart.antoine@gmail.com>
SteveMacenski added a commit that referenced this pull request May 31, 2024
* Add configure and cleanup transitions to lifecycle manager and client (#4371)

Signed-off-by: Joni Pöllänen <joni.pollanen@karelics.fi>

* [RotationShimController] Rotate to goal heading (#4332)

When arriving in the goal xy tolerance, the rotation shim controller
takes back the control to command the robot to rotate in the goal
heading orientation.

The initial goal of the rotationShimController was to rotate the robot
at the beginning of a navigation towards the paths orientation because
some controllers are not good at performing in place rotations. For the
same reason, the rotationShimController should be able to rotate the
robot towards the goal heading.

Signed-off-by: Antoine Gennart <gennart.antoine@gmail.com>

* bump to 1.2.9 for release

---------

Signed-off-by: Joni Pöllänen <joni.pollanen@karelics.fi>
Signed-off-by: Antoine Gennart <gennart.antoine@gmail.com>
Co-authored-by: Joni Pöllänen <jonipol@users.noreply.github.com>
Co-authored-by: Saitama <gennartan@users.noreply.github.com>
@SteveMacenski
Copy link
Member

// of the goal. The rotation shim controller should rotate toward the goal heading
// then it will throw an exception because the costmap is bogus
controller->setPlan(path);
EXPECT_THROW(controller->computeVelocityCommands(pose, velocity, &checker), std::runtime_error);
Copy link
Contributor

Choose a reason for hiding this comment

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

This test consistently fails for me on rolling. @gennartan would it be possible for you to check it out? It failed on CI too . No idea how it passed for the PR

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah sorry, just saw Steve commented already

Copy link
Contributor Author

@gennartan gennartan Jun 1, 2024

Choose a reason for hiding this comment

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

I fixed the error related to the EXPECT_THROW and implemented real tests for this feature.

But I am still getting error while testing and I cannot figure out what is causing it. Could you help me @tonynajjar or @SteveMacenski ?

build/nav2_rotation_shim_controller/test_results/nav2_rotation_shim_controller/flake8.xunit.xml: 3 tests, 0 errors, 3 failures, 0 skipped
- nav2_rotation_shim_controller.flake8 E501 (./install/_local_setup_util_sh.py:14:100)
  <<< failure message
    line too long (109 > 99 characters):
    FORMAT_STR_INVOKE_SCRIPT = 'COLCON_CURRENT_PREFIX="{prefix}" _colcon_prefix_sh_source_script "{script_path}"'
  >>>
- nav2_rotation_shim_controller.flake8 E501 (./install/_local_setup_util_sh.py:15:100)
  <<< failure message
    line too long (124 > 99 characters):
    FORMAT_STR_REMOVE_LEADING_SEPARATOR = 'if [ "$(echo -n ${name} | head -c 1)" = ":" ]; then export {name}=${{{name}#?}} ; fi'
  >>>
- nav2_rotation_shim_controller.flake8 E501 (./install/_local_setup_util_sh.py:16:100)
  <<< failure message
    line too long (125 > 99 characters):
    FORMAT_STR_REMOVE_TRAILING_SEPARATOR = 'if [ "$(echo -n ${name} | tail -c 1)" = ":" ]; then export {name}=${{{name}%?}} ; fi'
  >>>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It seems that I am only getting these test error locally, I created a PR and this error doesn't show up.

See the PR: #4391

However the release tests still fails, but not for the rotationShimController

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

3 participants