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(obstacle_stop_planner): fix yaw calculation in acc #406

Conversation

tkimura4
Copy link
Contributor

@tkimura4 tkimura4 commented Feb 17, 2022

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

Related Issue(required)

Description(required)

  • Bug fix of adaptive cruise controller in obstacle_stop_planner.
  1. Change the point used to calculate trajectory-yaw.

In acc, target object velocity v is calculated as folloing.

v = object_velocity * cos(object_yaw - trajectory_yaw)

Then, the yaw of trajectory is calculated using collision point(blue arrow).
Thereby, the difference of yaw of object (green arrow) and between trajectory is inaccurately calculated.

image

In this PR, the nearest point to object (red arrow) is used for calculating yaw of trajectory.

  1. re-calculate yaw in the acc function

Previously, the orientation of point was used to calculate the trajectory yaw.
However, the orientation may be inaccurate.

In this PR, the yaw of trajectory point is recalculated in the ACC node, and orientation information of trajectory point is not used..

Review Procedure(required)

test cases as below.
image

In this cases, v ( = object_velocity * cos(object_yaw - trajectory_yaw) ) of the crossing object should be 0 or less than 0.
However, v was sometimes calculated as positive due to the above bug, and then the mode transitions to ACC and obstacle stop did not work without merging this PR.

Confirm that the bug is fixed by this PR.
(Confirm that the obstacle stop works properly)

Related PR(optional)

Pre-Review Checklist for the PR Author

PR Author should check the checkboxes below when creating the PR.

If you are adding new package following items are required:

  • Documentation with description of the package is available
  • A sample launch file and parameter file are available if the package contains executable nodes

Checklist for the PR Reviewer

Reviewers should check the checkboxes below before approval.

  • Commits are properly organized and messages are according to the guideline
  • PR title describes the changes

Post-Review Checklist for the PR Author

PR Author should check the checkboxes below before merging.

  • All open points are addressed and tracked via issues or tickets

CI Checks

  • Build and test for PR / build-and-test-pr: Required to pass before the merge.
  • Build and test for PR / clang-tidy-pr: NOT required to pass before the merge. It is up to the reviewer(s). Found false positives? See the [guidelines][clang-tidy-guidelines].
  • Check spelling: NOT required to pass before the merge. It is up to the reviewer(s). See here if you want to add some words to the spell check dictionary.

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

codecov bot commented Feb 17, 2022

Codecov Report

Merging #406 (fffcb68) into tier4/proposal (ca45e4a) will decrease coverage by 10.04%.
The diff coverage is 0.00%.

Impacted file tree graph

@@                Coverage Diff                 @@
##           tier4/proposal    #406       +/-   ##
==================================================
- Coverage           10.04%   0.00%   -10.05%     
==================================================
  Files                 705       4      -701     
  Lines               49295    1096    -48199     
  Branches             6245       0     -6245     
==================================================
- Hits                 4952       0     -4952     
+ Misses              40285    1096    -39189     
+ Partials             4058       0     -4058     
Impacted Files Coverage Δ
...tacle_stop_planner/src/adaptive_cruise_control.cpp 0.00% <0.00%> (ø)
...ion/include/fault_injection/diagnostic_storage.hpp
...src/outlier_filter/ring_outlier_filter_nodelet.cpp
...follower/src/qp_solver/qp_solver_unconstr_fast.cpp
...ehavior_path_planner/src/behavior_tree_manager.cpp
common/signal_processing/src/lowpass_filter_1d.cpp
...llower/test/test_longitudinal_controller_utils.cpp
..._error_monitor/src/planning_error_monitor_node.cpp
...erception/shape_estimation/lib/corrector/utils.cpp
...nning/behavior_path_planner/src/path_utilities.cpp
... and 692 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 ca45e4a...fffcb68. Read the comment docs.

@TakaHoribe
Copy link
Contributor

TakaHoribe commented Feb 17, 2022

Memo. There are 2 modifications here.

To calculate the longitudinal speed of the target vehicle along the trajectory, the yaw angle between the blue and green arrows was used. However, this calculation was not correct on a curve trajectory as in the picture. In this PR, the calculation is fixed by using the yaw angle calculation between the blue and red arrows.

The calculation of the trajectory yaw angle has also been fixed. In the previous implementation, the yaw angle in the trajectory (trajectory.points.pose.orientation) was used, but it is sometimes noisy and inappropriate to use for the purpose above (longitudinal speed calculation). So the trajectory yaw angle is calculated by atan(dx/dy) with a certain distance (5m by default).

@TakaHoribe
Copy link
Contributor

Confirmed the bug has been fixed in my environment.

@tkimura4 tkimura4 marked this pull request as ready for review February 18, 2022 06:43
mitsudome-r added a commit to mitsudome-r/autoware.universe that referenced this pull request Mar 1, 2022
* release v0.4.0

* add use_object_recognition flag in dummy_perception_publisher (autowarefoundation#696)

* remove ROS1 packages temporarily

Signed-off-by: mitsudome-r <ryohsuke.mitsudome@tier4.jp>

* add sample ros2 packages

Signed-off-by: mitsudome-r <ryohsuke.mitsudome@tier4.jp>

* remove ROS1 packages

Signed-off-by: mitsudome-r <ryohsuke.mitsudome@tier4.jp>

* Revert "remove ROS1 packages temporarily"

This reverts commit 2e9822586a3539a32653e6bcd378715674b519ca.

Signed-off-by: mitsudome-r <ryohsuke.mitsudome@tier4.jp>

* add COLCON_IGNORE to ros1 packages

Signed-off-by: mitsudome-r <ryohsuke.mitsudome@tier4.jp>

* Rename launch files to launch.xml (autowarefoundation#28)

* Port dummy_perception_publisher to ROS2 (autowarefoundation#90)

* Port dummy_perception_publisher to ROS2

* Uncrustify

* Lint

* Copyright

* Period

* Further ament_cpplint fixes

* Convert calls of Duration to Duration::from_seconds where appropriate (autowarefoundation#131)

* Use quotes for includes where appropriate (autowarefoundation#144)

* Use quotes for includes where appropriate

* Fix lint tests

* Make tests pass hopefully

* adding linters to dummy_perception_publisher (autowarefoundation#220)

* [dummy_perception_publisher] fix launch file and installation (autowarefoundation#215)

* [dummy_perception_publisher] fix launch file and installation

Signed-off-by: mitsudome-r <ryohsuke.mitsudome@tier4.jp>

* Apply suggestions from code review

Co-authored-by: Takamasa Horibe <horibe.takamasa@gmail.com>

Co-authored-by: Takamasa Horibe <horibe.takamasa@gmail.com>

* reduce terminal ouput for better error message visibility (autowarefoundation#200)

* reduce terminal ouput for better error message visibility

Signed-off-by: mitsudome-r <ryohsuke.mitsudome@tier4.jp>

* [costmap_generator] fix waiting for first transform

Signed-off-by: mitsudome-r <ryohsuke.mitsudome@tier4.jp>

* fix tests

Signed-off-by: mitsudome-r <ryohsuke.mitsudome@tier4.jp>

* fix test

Signed-off-by: mitsudome-r <ryohsuke.mitsudome@tier4.jp>

* modify launch file for making psim work (autowarefoundation#238)

* modify launch file for making psim work

Signed-off-by: kosuke murakami <kosuke.murakami@tier4.jp>

* remove unnecesary ns

Signed-off-by: kosuke murakami <kosuke.murakami@tier4.jp>

* Ros2 v0.8.0 dummy perception publisher (autowarefoundation#286)

* Remove "/" in frame_id (autowarefoundation#406)

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>

* Fix transform (autowarefoundation#420)

* Replace rclcpp::Time(0) by tf2::TimePointZero() in lookupTransform

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>

* Fix canTransform

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>

* Fix test

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>

* add use_sim-time option (autowarefoundation#454)

* Remove use_sim_time for set_parameter (autowarefoundation#1260)

Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp>

* Diable dummy_perception_publisher if argument 'scenario_simulation' i… (autowarefoundation#1275)

* Diable dummy_perception_publisher if argument 'scenario_simulation' is true

* Rename argument to 'disable_dummy_perception_publisher_node' from 'scenario_simulation'

* change theta step for obj point cloud (autowarefoundation#1280)

* Revert changes of PR autowarefoundation#1275 (autowarefoundation#1377)

* Add pre-commit (autowarefoundation#1560)

* add pre-commit

* add pre-commit-config

* add additional settings for private repository

* use default pre-commit-config

* update pre-commit setting

* Ignore whitespace for line breaks in markdown

* Update .github/workflows/pre-commit.yml

Co-authored-by: Kazuki Miyahara <kmiya@outlook.com>

* exclude svg

* remove pretty-format-json

* add double-quote-string-fixer

* consider COLCON_IGNORE file when seaching modified package

* format file

* pre-commit fixes

* Update pre-commit.yml

* Update .pre-commit-config.yaml

Co-authored-by: Kazuki Miyahara <kmiya@outlook.com>
Co-authored-by: pre-commit <pre-commit@example.com>
Co-authored-by: Kenji Miyake <31987104+kenji-miyake@users.noreply.github.com>

* Fix dependency type of rosidl_default_generators (autowarefoundation#1801)

* Fix dependency type of rosidl_default_generators

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>

* Remove unnecessary depends

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>

* Use ament_cmake_auto

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>

* Fix -Wunused-parameter (autowarefoundation#1836)

* Fix -Wunused-parameter

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>

* Fix mistake

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>

* fix spell

* Fix lint issues

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>

* Ignore flake8 warnings

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>

Co-authored-by: Hiroki OTA <hiroki.ota@tier4.jp>

* fix topic namespace (autowarefoundation#2054)

Signed-off-by: Azumi Suzuki <azumi.suzuki@tier4.jp>

* add sort-package-xml hook in pre-commit (autowarefoundation#1881)

* add sort xml hook in pre-commit

* change retval to exit_status

* rename

* add prettier plugin-xml

* use early return

* add license note

* add tier4 license

* restore prettier

* change license order

* move local hooks to public repo

* move prettier-xml to pre-commit-hooks-ros

* update version for bug-fix

* apply pre-commit

* Feature/porting occlusion spot (autowarefoundation#1740)

* Feature/occlusion_spot safety planner public road (autowarefoundation#1594)

* add blind spot safety planner public road

* remove duplicated procesing

* remove unused private param

* renaming fix typo add comments

* fix spell check

* velocity -> relative velocity

* calc2d, To param, simplify search, To original

* add the num possible collision gurd

* computational cost reduction

* Cosmetic change for PossibleCollisionInfo

* add interpolation to possible collision value

* refactor codes

* fix details

* invalid point gurd

* To Param

* refacotor to occlusion spot util

* cosmetic change

* clean up blindspot

* To Occlusion Spot

* revise readme

* refactor drawing

* for better explanation

* fix velocity profile

* clean up details

* cosmetic change for debug marker

* use max velocity in obstacle info instead

* add gtest for Too Many Possible Collision case

* change case

* refactor readme

* minor fix

* add more occlusion spot explanation

* replace svg

* add gtest build path lanelet

* hotfix lateral distance and searching method

* update g test for lateral distance

* use faster search

* set more realistic param

* add lanelet subtype highway

* cosmetic change of reviews

* add occlusion spot module in private area (autowarefoundation#1640)

* add occlusion spot in private

* For debugging change

* add spline interpolation to path

* add review changes

* adding minor change

* cosmetic change

* Vector to retval

* Blindspot To OcclusionSpot1

* To Occlusion Spot 2

* To Occlusions spot3

* update gtest with unified anchor

* remove anchor

* add test slice

* simplify interpolation

* Too Occlusion spot4

* add test buffer

* To Occlusion spot

* namespace gurd

* correct slice and add interpolation first

* handle self crossing with check for invation

* to ros debug stream

* removed unused interpolation

* add readme to plant uml

* cosmetic change

* minor change

* update readme

* review change

* change occlusion spot text color

* To Offset no Throw

* better debug marker

* catch only inversion error

* skip return in case of inversion

* for better grid

* simplify path lanelet at first

* remove std::cout

* for better path

* limit ego path inside target lanelet location

* remove last points

* cosmetic change for markers

* apply module for limited scene

* fix interpolation gurd

* for better params

* do not includes path behind

* remove dummy perception publisher

* Revert "remove dummy perception publisher"

This reverts commit 4acad985fe31dd9befaa21a16631495de6c3a117.

* replace hard coded occupancy grid option in psim

* remove respawn

* add arg to params and remove redundunt launch

* fix spell check

* fix default value

Co-authored-by: tkimura4 <tomoya.kimura@tier4.jp>

* Feature/occlusion spot private slice size param (autowarefoundation#1703)

* add min slice size

* for a bit narrow lateral distance

* Update planning/scenario_planning/lane_driving/behavior_planning/behavior_velocity_planner/config/occlusion_spot_param.yaml

Co-authored-by: Maxime CLEMENT <78338830+maxime-clem@users.noreply.github.com>

Co-authored-by: Maxime CLEMENT <78338830+maxime-clem@users.noreply.github.com>

* Rename files

Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp>

* Porting to ros2

Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp>

* pre-commit fixes

Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp>

* Fix typo

Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp>

* Fix launch namespace

Co-authored-by: tkimura4 <tomoya.kimura@tier4.jp>

* Fix parameter type

Co-authored-by: tkimura4 <tomoya.kimura@tier4.jp>

* Update planning/scenario_planning/lane_driving/behavior_planning/behavior_velocity_planner/src/scene_module/occlusion_spot/scene_occlusion_spot_in_private_road.cpp

Co-authored-by: tkimura4 <tomoya.kimura@tier4.jp>

Co-authored-by: taikitanaka3 <65527974+taikitanaka3@users.noreply.github.com>
Co-authored-by: tkimura4 <tomoya.kimura@tier4.jp>
Co-authored-by: Maxime CLEMENT <78338830+maxime-clem@users.noreply.github.com>

* Change formatter to clang-format and black (autowarefoundation#2332)

* Revert "Temporarily comment out pre-commit hooks"

This reverts commit 748e9cdb145ce12f8b520bcbd97f5ff899fc28a3.

* Replace ament_lint_common with autoware_lint_common

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>

* Remove ament_cmake_uncrustify and ament_clang_format

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>

* Apply Black

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>

* Apply clang-format

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>

* Fix build errors

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>

* Fix for cpplint

* Fix include double quotes to angle brackets

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>

* Apply clang-format

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>

* Fix build errors

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>

* Add COLCON_IGNORE (autowarefoundation#500)

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>

* port dummy perception publisher to auto (autowarefoundation#562)

* port dummy perception publisher to auto

* autoware_perception_msgs/DynamicObjectWithFeatureArray convert to autoware_perception_msgs/DetectedObjectsWithFeature

* change tracked objects to PREDICTED objects

* separate pub type with real

* Add README.md to dummy perception publisher (autowarefoundation#641)

* Added readme for dummy_perception_pub

* README update

* README update

* Fix pre-commit

* fix typo

* Update README.md

* Update README.md

* Update README.md

* Modified node.cpp

* Modified README.md

* change parameter name

* Update README.md

* [shape_estimation]change type (autowarefoundation#663)

* change output type of shape_estimation

* remove unused function

* add dynamic_object_converter

* rename

* fix typo

* fix dummy_perception_publisher

* update readme

* fix copyright

* rename package

* add readme

* fix launch name

* remove unused variable

* fix readme

* fix convert function

* change topic name of DynamicObjectsWithFeature

* Fix no ground pointcloud topic name (autowarefoundation#733)

Signed-off-by: j4tfwm6z <proj-jpntaxi@tier4.jp>

Co-authored-by: j4tfwm6z <proj-jpntaxi@tier4.jp>

* auto/fix occupancy grid name space in dummy perception publisher (autowarefoundation#739)

* fix name space

* change namespace: object_segmentation -> obstacle_segmentation

* feat: add use_traffic_light status

Co-authored-by: mitsudome-r <ryohsuke.mitsudome@tier4.jp>
Co-authored-by: Taichi Higashide <taichi.higashide@tier4.jp>
Co-authored-by: Nikolai Morin <nnmmgit@gmail.com>
Co-authored-by: nik-tier4 <71747268+nik-tier4@users.noreply.github.com>
Co-authored-by: Ryohsuke Mitsudome <43976834+mitsudome-r@users.noreply.github.com>
Co-authored-by: Takamasa Horibe <horibe.takamasa@gmail.com>
Co-authored-by: Kosuke Murakami <kosuke.murakami@tier4.jp>
Co-authored-by: Daisuke Nishimatsu <42202095+wep21@users.noreply.github.com>
Co-authored-by: Kenji Miyake <31987104+kenji-miyake@users.noreply.github.com>
Co-authored-by: tkimura4 <tomoya.kimura@tier4.jp>
Co-authored-by: Tatsuya Yamasaki <httperror@404-notfound.jp>
Co-authored-by: taikitanaka3 <65527974+taikitanaka3@users.noreply.github.com>
Co-authored-by: Keisuke Shima <19993104+KeisukeShima@users.noreply.github.com>
Co-authored-by: Kazuki Miyahara <kmiya@outlook.com>
Co-authored-by: pre-commit <pre-commit@example.com>
Co-authored-by: Hiroki OTA <hiroki.ota@tier4.jp>
Co-authored-by: Azumi Suzuki <38061530+s-azumi@users.noreply.github.com>
Co-authored-by: Maxime CLEMENT <78338830+maxime-clem@users.noreply.github.com>
Co-authored-by: Yohei Mishina <66298900+YoheiMishina@users.noreply.github.com>
Co-authored-by: j4tfwm6z <proj-jpntaxi@tier4.jp>
Co-authored-by: Satoshi OTA <44889564+satoshi-ota@users.noreply.github.com>
@tkimura4 tkimura4 closed this Mar 1, 2022
@tkimura4 tkimura4 deleted the fix/adaptive_cruise_yaw branch March 1, 2022 10:14
TomohitoAndo pushed a commit to TomohitoAndo/autoware.universe that referenced this pull request Oct 5, 2022
* Add pre-commit

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>

* Add sort-package-xml

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>
TomohitoAndo pushed a commit to TomohitoAndo/autoware.universe that referenced this pull request Oct 5, 2022
soblin pushed a commit to soblin/autoware.universe that referenced this pull request May 10, 2023
keiota pushed a commit to keiota/autoware.universe that referenced this pull request Aug 17, 2023
kyoichi-sugahara pushed a commit that referenced this pull request Sep 16, 2023
Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>
HansOersted pushed a commit to HansOersted/autoware.universe that referenced this pull request Mar 8, 2024
Signed-off-by: Tomohito Ando <tomohito.ando@tier4.jp>
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