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

fix(behavior_path_planner): fix turn signal distance #1606

Merged
merged 3 commits into from
Aug 17, 2022

Conversation

tkimura4
Copy link
Contributor

@tkimura4 tkimura4 commented Aug 17, 2022

Signed-off-by: tomoya.kimura tomoya.kimura@tier4.jp

Description

Fix turn signal distance.

  1. distance-rewritten bug

Before the change, the distance of intersection turn signal could be accidentally rewritten by lanes with none attribute.
After the change, distance will be only updated by lane with left or right attribute.

  1. minus-distance turn signal from intersection
    When avoiding near the intersection, the intersection turn_signal with big minus distance is output as shown below, and the avoidance turn signal does not turn on correctly.
    After the change, the intersection turn_signal with minus distance will not be output from getIntersectionTurnSignal
[component_container_mt-47] [ERROR 1660720681.073442459] [tmp]: =========================================
[component_container_mt-47] [ERROR 1660720681.073497523] [tmp]: avoid_turn_signal2
[component_container_mt-47] [ERROR 1660720681.073514104] [tmp]: avoid_distance29.2685
[component_container_mt-47] [ERROR 1660720681.073522763] [tmp]: intersection_turn_signal1
[component_container_mt-47] [ERROR 1660720681.073534476] [tmp]: intersection_distance1.79769e+308
[component_container_mt-47] [ERROR 1660720681.173590824] [tmp]: =========================================
[component_container_mt-47] [ERROR 1660720681.173633209] [tmp]: lane8231
[component_container_mt-47] [ERROR 1660720681.173649558] [tmp]: avoid_turn_signal2
[component_container_mt-47] [ERROR 1660720681.173658836] [tmp]: avoid_distance28.7431
[component_container_mt-47] [ERROR 1660720681.173664062] [tmp]: intersection_turn_signal3
[component_container_mt-47] [ERROR 1660720681.173669557] [tmp]: intersection_distance-7.94307 <- this!
[component_container_mt-47] [ERROR 1660720681.273433434] [tmp]: =========================================
[component_container_mt-47] [ERROR 1660720681.273475030] [tmp]: lane8231
[component_container_mt-47] [ERROR 1660720681.273492750] [tmp]: avoid_turn_signal2
[component_container_mt-47] [ERROR 1660720681.273502568] [tmp]: avoid_distance28.2165
[component_container_mt-47] [ERROR 1660720681.273507652] [tmp]: intersection_turn_signal3
[component_container_mt-47] [ERROR 1660720681.273514532] [tmp]: intersection_distance-8.37621 <- this!
[component_container_mt-47] [ERROR 1660720681.373796097] [tmp]: =========================================
[component_container_mt-47] [ERROR 1660720681.373841634] [tmp]: avoid_turn_signal2
[component_container_mt-47] [ERROR 1660720681.373853138] [tmp]: avoid_distance27.689
[component_container_mt-47] [ERROR 1660720681.373858560] [tmp]: intersection_turn_signal1
[component_container_mt-47] [ERROR 1660720681.373866317] [tmp]: intersection_distance1.79769e+308
[component_container_mt-47] [ERROR 1660720681.473503680] [tmp]: =========================================
  1. no-command-turn-signal from avoidance

Sometimes, the turn signal with NO_COMMAND is output from avoidance module, and it rewrites the intersection turn signal.
After the change, turn_signal with NO_COMMAND will be ignored.

[component_container_mt-47] [ERROR 1660721220.857009443] [tmp]: avoid_turn_signal0  <- this!
[component_container_mt-47] [ERROR 1660721220.857017539] [tmp]: avoid_distance0.653192
[component_container_mt-47] [ERROR 1660721220.857021850] [tmp]: intersection_turn_signal3
[component_container_mt-47] [ERROR 1660721220.857026484] [tmp]: intersection_distance0.808469
[component_container_mt-47] [ERROR 1660721220.957536496] [tmp]: =========================================
[component_container_mt-47] [ERROR 1660721220.957582795] [tmp]: avoid_turn_signal0  <- this!
[component_container_mt-47] [ERROR 1660721220.957590812] [tmp]: avoid_distance0.298453
[component_container_mt-47] [ERROR 1660721220.957596287] [tmp]: intersection_turn_signal3
[component_container_mt-47] [ERROR 1660721220.957603096] [tmp]: intersection_distance1.09024
[component_container_mt-47] [ERROR 1660721221.057352833] [tmp]: =========================================
[component_container_mt-47] [ERROR 1660721221.057410941] [tmp]: avoid_turn_signal0  <- this!
[component_container_mt-47] [ERROR 1660721221.057421654] [tmp]: avoid_distance1.79769e+308
[component_container_mt-47] [ERROR 1660721221.057427318] [tmp]: intersection_turn_signal3
[component_container_mt-47] [ERROR 1660721221.057433378] [tmp]: intersection_distance1.36582
[component_container_mt-47] [ERROR 1660721221.157416610] [tmp]: =========================================
[component_container_mt-47] [ERROR 1660721221.157467834] [tmp]: avoid_turn_signal0  <- this!
[component_container_mt-47] [ERROR 1660721221.157479068] [tmp]: avoid_distance1.79769e+308
[component_container_mt-47] [ERROR 1660721221.157484237] [tmp]: intersection_turn_signal3
[component_container_mt-47] [ERROR 1660721221.157489837] [tmp]: intersection_distance1.62823
[component_container_mt-47] [ERROR 1660721221.258417137] [tmp]: =========================================

I checked turn_signal value by inserting following code in turn_signal_decider.cpp

  RCLCPP_ERROR_STREAM(
    rclcpp::get_logger("tmp"), "avoid_turn_signal" << static_cast<int>(turn_signal_plan.command));
  RCLCPP_ERROR_STREAM(rclcpp::get_logger("tmp"), "avoid_distance" << plan_distance);

  RCLCPP_ERROR_STREAM(
    rclcpp::get_logger("tmp"),
    "intersection_turn_signal" << static_cast<int>(intersection_turn_signal.command));
  RCLCPP_ERROR_STREAM(rclcpp::get_logger("tmp"), "intersection_distance" << intersection_distance);

** Note **
https://user-images.githubusercontent.com/59680180/185071535-37d0131f-ce97-420e-8692-b7fcd31c0007.mp4

TODO:
Even after merging this PR, sometimes turn signal chattering still occurs.
This may be because the calculation method of distance to intersection is crude, and the distance to the lane changes depending on how lane_ids are embedded in PathWithLaneId.

[component_container_mt-47] [ERROR 1660723693.904823015] [tmp]: =========================================
[component_container_mt-47] [ERROR 1660723693.904848874] [tmp]: avoid_turn_signal2
[component_container_mt-47] [ERROR 1660723693.904854754] [tmp]: avoid_distance37.2723
[component_container_mt-47] [ERROR 1660723693.904857682] [tmp]: intersection_turn_signal1
[component_container_mt-47] [ERROR 1660723693.904861938] [tmp]: intersection_distance1.79769e+308
[component_container_mt-47] [ERROR 1660723694.004621365] [tmp]: =========================================
[component_container_mt-47] [ERROR 1660723694.004652211] [tmp]: avoid_turn_signal2
[component_container_mt-47] [ERROR 1660723694.004658282] [tmp]: avoid_distance36.8584
[component_container_mt-47] [ERROR 1660723694.004661173] [tmp]: intersection_turn_signal1
[component_container_mt-47] [ERROR 1660723694.004665300] [tmp]: intersection_distance1.79769e+308
[component_container_mt-47] [ERROR 1660723694.104611395] [tmp]: =========================================
[component_container_mt-47] [ERROR 1660723694.104649982] [tmp]: avoid_turn_signal2
[component_container_mt-47] [ERROR 1660723694.104657756] [tmp]: avoid_distance36.4352
[component_container_mt-47] [ERROR 1660723694.104662272] [tmp]: intersection_turn_signal3
[component_container_mt-47] [ERROR 1660723694.104667225] [tmp]: intersection_distance0.145327 <- here.
[component_container_mt-47] [ERROR 1660723694.204462664] [tmp]: =========================================
[component_container_mt-47] [ERROR 1660723694.204486688] [tmp]: lane8231
[component_container_mt-47] [ERROR 1660723694.204494304] [tmp]: avoid_turn_signal2
[component_container_mt-47] [ERROR 1660723694.204500710] [tmp]: avoid_distance36.0029
[component_container_mt-47] [ERROR 1660723694.204503602] [tmp]: intersection_turn_signal3
[component_container_mt-47] [ERROR 1660723694.204506635] [tmp]: intersection_distance0.567311 <- here.
[component_container_mt-47] [ERROR 1660723694.304347545] [tmp]: =========================================
[component_container_mt-47] [ERROR 1660723694.304372956] [tmp]: avoid_turn_signal2
[component_container_mt-47] [ERROR 1660723694.304378871] [tmp]: avoid_distance35.4655
[component_container_mt-47] [ERROR 1660723694.304381925] [tmp]: intersection_turn_signal1
[component_container_mt-47] [ERROR 1660723694.304386079] [tmp]: intersection_distance1.79769e+308

Pre-review checklist for the PR author

The PR author must check the checkboxes below when creating the PR.

In-review checklist for the PR reviewers

The PR reviewers must check the checkboxes below before approval.

Post-review checklist for the PR author

The PR author must check the checkboxes below before merging.

  • There are no open discussions or they are tracked via tickets.

After all checkboxes are checked, anyone who has write access can merge the PR.

Signed-off-by: tomoya.kimura <tomoya.kimura@tier4.jp>
…urn_signal

Signed-off-by: tomoya.kimura <tomoya.kimura@tier4.jp>
Signed-off-by: tomoya.kimura <tomoya.kimura@tier4.jp>
@codecov
Copy link

codecov bot commented Aug 17, 2022

Codecov Report

Merging #1606 (bfc6018) into main (5772020) will decrease coverage by 0.41%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main    #1606      +/-   ##
==========================================
- Coverage   11.06%   10.65%   -0.42%     
==========================================
  Files        1035     1103      +68     
  Lines       69343    72179    +2836     
  Branches    17982    18051      +69     
==========================================
+ Hits         7675     7689      +14     
- Misses      53227    55892    +2665     
- Partials     8441     8598     +157     
Flag Coverage Δ *Carryforward flag
differential 0.78% <0.00%> (?)
total 10.69% <0.00%> (-0.37%) ⬇️ Carriedforward from 375c3f0

*This pull request uses carry forward flags. Click here to find out more.

Impacted Files Coverage Δ
.../behavior_path_planner/src/turn_signal_decider.cpp 0.00% <0.00%> (ø)
planning/behavior_path_planner/test/input.cpp 60.00% <0.00%> (-7.86%) ⬇️
...ning/behavior_path_planner/test/test_utilities.cpp 33.33% <0.00%> (-4.17%) ⬇️
...ner/src/scene_module/avoidance/avoidance_utils.cpp 2.91% <0.00%> (-0.22%) ⬇️
planning/behavior_path_planner/src/utilities.cpp 1.04% <0.00%> (-0.07%) ⬇️
...erception/traffic_light_classifier/src/nodelet.cpp 0.00% <0.00%> (ø)
...nning/behavior_path_planner/src/path_utilities.cpp 0.00% <0.00%> (ø)
...ning/behavior_path_planner/src/debug_utilities.cpp 0.00% <0.00%> (ø)
...er4_state_rviz_plugin/src/autoware_state_panel.cpp 0.00% <0.00%> (ø)
... and 90 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@tkimura4 tkimura4 marked this pull request as ready for review August 17, 2022 08:36
Copy link
Contributor

@rej55 rej55 left a comment

Choose a reason for hiding this comment

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

LGTM

@tkimura4 tkimura4 enabled auto-merge (squash) August 17, 2022 09:33
@tkimura4 tkimura4 merged commit 803e278 into autowarefoundation:main Aug 17, 2022
@tkimura4 tkimura4 deleted the fix/turn_signal branch August 17, 2022 09:44
boyali referenced this pull request in boyali/autoware.universe Sep 28, 2022
* fix(behavior_path_planner): fix turn signal distance

Signed-off-by: tomoya.kimura <tomoya.kimura@tier4.jp>

* fix choice way of turn_signal from turn_signal_plan or intersection_turn_signal

Signed-off-by: tomoya.kimura <tomoya.kimura@tier4.jp>

* restrict distance_from_vehicle_front to positive value

Signed-off-by: tomoya.kimura <tomoya.kimura@tier4.jp>

Signed-off-by: tomoya.kimura <tomoya.kimura@tier4.jp>
boyali referenced this pull request in boyali/autoware.universe Oct 3, 2022
* fix(behavior_path_planner): fix turn signal distance

Signed-off-by: tomoya.kimura <tomoya.kimura@tier4.jp>

* fix choice way of turn_signal from turn_signal_plan or intersection_turn_signal

Signed-off-by: tomoya.kimura <tomoya.kimura@tier4.jp>

* restrict distance_from_vehicle_front to positive value

Signed-off-by: tomoya.kimura <tomoya.kimura@tier4.jp>

Signed-off-by: tomoya.kimura <tomoya.kimura@tier4.jp>
boyali referenced this pull request in boyali/autoware.universe Oct 3, 2022
* fix(behavior_path_planner): fix turn signal distance

Signed-off-by: tomoya.kimura <tomoya.kimura@tier4.jp>

* fix choice way of turn_signal from turn_signal_plan or intersection_turn_signal

Signed-off-by: tomoya.kimura <tomoya.kimura@tier4.jp>

* restrict distance_from_vehicle_front to positive value

Signed-off-by: tomoya.kimura <tomoya.kimura@tier4.jp>

Signed-off-by: tomoya.kimura <tomoya.kimura@tier4.jp>
yukke42 pushed a commit to tzhong518/autoware.universe that referenced this pull request Oct 14, 2022
…ion#1606)

* fix(behavior_path_planner): fix turn signal distance

Signed-off-by: tomoya.kimura <tomoya.kimura@tier4.jp>

* fix choice way of turn_signal from turn_signal_plan or intersection_turn_signal

Signed-off-by: tomoya.kimura <tomoya.kimura@tier4.jp>

* restrict distance_from_vehicle_front to positive value

Signed-off-by: tomoya.kimura <tomoya.kimura@tier4.jp>

Signed-off-by: tomoya.kimura <tomoya.kimura@tier4.jp>
boyali referenced this pull request in boyali/autoware.universe Oct 19, 2022
* fix(behavior_path_planner): fix turn signal distance

Signed-off-by: tomoya.kimura <tomoya.kimura@tier4.jp>

* fix choice way of turn_signal from turn_signal_plan or intersection_turn_signal

Signed-off-by: tomoya.kimura <tomoya.kimura@tier4.jp>

* restrict distance_from_vehicle_front to positive value

Signed-off-by: tomoya.kimura <tomoya.kimura@tier4.jp>

Signed-off-by: tomoya.kimura <tomoya.kimura@tier4.jp>
saka1-s pushed a commit to saka1-s/autoware.universe that referenced this pull request Nov 9, 2024
saka1-s pushed a commit to saka1-s/autoware.universe that referenced this pull request Nov 9, 2024
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