Skip to content

Speed is inverted when dist is negative#1897

Merged
SteveMacenski merged 3 commits intoros-navigation:masterfrom
mdtoom:backup_action_speed_fix
Aug 5, 2020
Merged

Speed is inverted when dist is negative#1897
SteveMacenski merged 3 commits intoros-navigation:masterfrom
mdtoom:backup_action_speed_fix

Conversation

@mdtoom
Copy link
Copy Markdown
Contributor

@mdtoom mdtoom commented Jul 30, 2020


Basic Info

Info Please fill out this column
Ticket(s) this addresses #1896
Primary OS tested on Ubuntu
Robotic platform tested on Gazebo

Description of contribution in a few bullet points

  • Fixes that backup_action_node cannot enter a negative speed and therefore the action cannot backed up.
  • Changed to invert speed when distance is negative (robot should go forward) similar to backup recovery node.

Description of documentation updates required from your changes


Future work that may be required in bullet points

@mdtoom mdtoom force-pushed the backup_action_speed_fix branch from f54ce6c to 6e694d8 Compare July 30, 2020 12:59
@codecov
Copy link
Copy Markdown

codecov bot commented Jul 30, 2020

Codecov Report

Merging #1897 into master will decrease coverage by 0.68%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1897      +/-   ##
==========================================
- Coverage   71.83%   71.15%   -0.69%     
==========================================
  Files         222      222              
  Lines       10673    10671       -2     
==========================================
- Hits         7667     7593      -74     
- Misses       3006     3078      +72     
Impacted Files Coverage Δ
...v2_behavior_tree/plugins/action/back_up_action.cpp 87.50% <ø> (-1.39%) ⬇️
...v2_behavior_tree/plugins/action/back_up_action.hpp 100.00% <100.00%> (ø)
nav2_recoveries/plugins/back_up.cpp 91.66% <100.00%> (ø)
...re/include/dwb_core/illegal_trajectory_tracker.hpp 40.00% <0.00%> (-60.00%) ⬇️
...roller/dwb_core/src/illegal_trajectory_tracker.cpp 25.00% <0.00%> (-55.00%) ⬇️
...tree/include/nav2_behavior_tree/bt_action_node.hpp 79.26% <0.00%> (-9.76%) ⬇️
...map_2d/include/nav2_costmap_2d/inflation_layer.hpp 91.66% <0.00%> (-8.34%) ⬇️
nav2_costmap_2d/src/clear_costmap_service.cpp 17.89% <0.00%> (-6.32%) ⬇️
..._dwb_controller/dwb_core/src/dwb_local_planner.cpp 75.68% <0.00%> (-5.48%) ⬇️
nav2_recoveries/plugins/spin.cpp 89.47% <0.00%> (-5.27%) ⬇️
... and 9 more

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 c65e3aa...c906ec5. Read the comment docs.

@SteveMacenski
Copy link
Copy Markdown
Member

SteveMacenski commented Jul 30, 2020

This is not an intuitive solution. I think you'd be better off checking both variables for signs. The speed must be positive since speed is a scalar not a vector quantity. We assume this is always positive and the sign is flipped in the backup recovery. The distance is also a scalar and should also be assumed to always be positive.

@mdtoom mdtoom force-pushed the backup_action_speed_fix branch from 6e694d8 to 784e14f Compare July 31, 2020 09:20
@mdtoom
Copy link
Copy Markdown
Contributor Author

mdtoom commented Jul 31, 2020

I agree, and updated, but shouldn't then the backup recovery in nav2_recoveries also be changed because there a negative distance and a positive speed is required to go backward. This also not very intuitive.

@SteveMacenski
Copy link
Copy Markdown
Member

SteveMacenski commented Jul 31, 2020

I agree that's unintuitive for the API. Can you update the recovery behavior & the BT node to use only positive values as inputs and then set the negative signs required in the recovery behavior itself?

So at the end, it should be all positive values in the BT node and in the actual recovery behavior we add negative sign for the velocity and distance when processing.

I think it would be good to add that as a doc as well. In the Foxy migration page https://github.com/ros-planning/navigation.ros.org/blob/master/migration/Foxy.rst can you write a couple sentences explaining that change?

@mdtoom
Copy link
Copy Markdown
Contributor Author

mdtoom commented Aug 4, 2020

Interface changes documented in: ros-navigation/docs.nav2.org#60

@mdtoom mdtoom force-pushed the backup_action_speed_fix branch from b837500 to 76339c6 Compare August 4, 2020 08:28
Comment thread nav2_behavior_tree/plugins/action/back_up_action.cpp Outdated
@mdtoom mdtoom requested a review from SteveMacenski August 5, 2020 10:27
@SteveMacenski SteveMacenski merged commit 6f4a558 into ros-navigation:master Aug 5, 2020
SteveMacenski pushed a commit that referenced this pull request Aug 11, 2020
* Positive speed and distance are enforced in backup action node

* Enforce positive inputs to backup recovery

* Removed positive enforcement from backup action

Co-authored-by: Matthijs den Toom <mdentoom@lely.com>
ruffsl pushed a commit to ruffsl/navigation2 that referenced this pull request Jul 2, 2021
* Positive speed and distance are enforced in backup action node

* Enforce positive inputs to backup recovery

* Removed positive enforcement from backup action

Co-authored-by: Matthijs den Toom <mdentoom@lely.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.

2 participants