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

feat: add planning debug tools #1362

Merged
merged 8 commits into from
Jul 30, 2022
Merged

feat: add planning debug tools #1362

merged 8 commits into from
Jul 30, 2022

Conversation

TakaHoribe
Copy link
Contributor

@TakaHoribe TakaHoribe commented Jul 16, 2022

Description

Now there are many tools for planning debug, visualization, and analysis.
Here add a pkg to manage these debugging tools.

This PR has also a new feature to visualize the trajectory information on PlotJugglar.

TODO

  • add readme
  • make a config file to autmatically load the script

Related links

Tests performed

trajectory_analyzer-2022-07-17_00.16.22.mp4

with the following code on plotjuggler reactive scripts

in Global code

behavior_path = '/planning/scenario_planning/lane_driving/behavior_planning/path_with_lane_id/debug_info'
behavior_velocity = '/planning/scenario_planning/lane_driving/behavior_planning/path/debug_info'
motion_avoid = '/planning/scenario_planning/lane_driving/motion_planning/obstacle_avoidance_planner/trajectory/debug_info'
motion_smoother_latacc = '/planning/scenario_planning/motion_velocity_smoother/debug/trajectory_lateral_acc_filtered/debug_info'
motion_smoother = '/planning/scenario_planning/trajectory/debug_info'

in function(tracker_time)

PlotCurvatureOverArclength('k_behavior_path', behavior_path, tracker_time)
PlotCurvatureOverArclength('k_behavior_velocity', behavior_velocity, tracker_time)
PlotCurvatureOverArclength('k_motion_avoid', motion_avoid, tracker_time)
PlotCurvatureOverArclength('k_motion_smoother', motion_smoother, tracker_time)

PlotVelocityOverArclength('v_behavior_path', behavior_path, tracker_time)
PlotVelocityOverArclength('v_behavior_velocity', behavior_velocity, tracker_time)
PlotVelocityOverArclength('v_motion_avoid', motion_avoid, tracker_time)
PlotVelocityOverArclength('v_motion_smoother_latacc', motion_smoother_latacc, tracker_time)
PlotVelocityOverArclength('v_motion_smoother', motion_smoother, tracker_time)

PlotCurrentVelocity('localization_kinematic_state', '/localization/kinematic_state', tracker_time)

in Function Library

function PlotCurvatureOverArclength(name, path, timestamp)
  new_series = ScatterXY.new(name)
  index = 0
  while(true) do
    series_k = TimeseriesView.find( string.format( "%s/curvature.%d", path, index) )
    series_s = TimeseriesView.find( string.format( "%s/arclength.%d", path, index) )
    series_size = TimeseriesView.find( string.format( "%s/size", path) )

    if series_k == nil or series_s == nil then break end
    
    k = series_k:atTime(timestamp)	
    s = series_s:atTime(timestamp)
    size = series_size:atTime(timestamp)

    if index >= size then break end
  
    new_series:push_back(s,k)
    index = index+1
  end
end

function PlotVelocityOverArclength(name, path, timestamp)
  new_series = ScatterXY.new(name)
  index = 0
  while(true) do
    series_v = TimeseriesView.find( string.format( "%s/velocity.%d", path, index) )
    series_s = TimeseriesView.find( string.format( "%s/arclength.%d", path, index) )
    series_size = TimeseriesView.find( string.format( "%s/size", path) )

    if series_v == nil or series_s == nil then break end

    v = series_v:atTime(timestamp)	
    s = series_s:atTime(timestamp)
    size = series_size:atTime(timestamp)

    if index >= size then break end
    
    new_series:push_back(s,v)
    index = index+1
  end
end


function PlotCurrentVelocity(name, kinematics_name, timestamp)
  new_series = ScatterXY.new(name)
  series_v = TimeseriesView.find( string.format( "%s/twist/twist/linear/x", kinematics_name))
  if series_v == nil then 
    print("error")
    return
  end
  v = series_v:atTime(timestamp)	
  new_series:push_back(0.0, v)
end

Notes for reviewers

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.

  • The PR follows the pull request guidelines.
  • The PR has been properly tested.
  • The PR has been reviewed by the code owners.

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.
  • The PR is ready for merge.

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

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>
Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>
Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>
@codecov
Copy link

codecov bot commented Jul 16, 2022

Codecov Report

Merging #1362 (eeb6e81) into main (f603772) will decrease coverage by 0.06%.
The diff coverage is 0.00%.

@@           Coverage Diff            @@
##            main   #1362      +/-   ##
========================================
- Coverage   9.64%   9.58%   -0.07%     
========================================
  Files       1096    1099       +3     
  Lines      77147   77644     +497     
  Branches   17719   18041     +322     
========================================
+ Hits        7441    7442       +1     
- Misses     62465   62936     +471     
- Partials    7241    7266      +25     
Flag Coverage Δ *Carryforward flag
differential 3.82% <0.00%> (?)
total 9.62% <ø> (ø) Carriedforward from ef3a045

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

Impacted Files Coverage Δ
...clude/planning_debug_tools/trajectory_analyzer.hpp 0.00% <0.00%> (ø)
..._debug_tools/include/planning_debug_tools/util.hpp 0.00% <0.00%> (ø)
...g/planning_debug_tools/src/trajectory_analyzer.cpp 0.00% <0.00%> (ø)
...ity_planner/src/scene_module/intersection/util.cpp 0.00% <0.00%> (ø)
..._planner/src/scene_module/intersection/manager.cpp 0.00% <0.00%> (ø)
...ner/src/scene_module/crosswalk/scene_crosswalk.cpp 0.00% <0.00%> (ø)
...c/scene_module/intersection/scene_intersection.cpp 0.00% <0.00%> (ø)
planning/behavior_velocity_planner/src/node.cpp 0.84% <0.00%> (+0.38%) ⬆️

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 f603772...eeb6e81. Read the comment docs.

TakaHoribe and others added 3 commits July 16, 2022 17:28
Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>
Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>
@taikitanaka3
Copy link
Contributor

@TakaHoribe
Can you remove or move trajectory visualizer to this package,? Because purpose of the package is the same.
https://github.com/autowarefoundation/autoware.universe/tree/main/planning/motion_velocity_smoother/scripts

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>
@TakaHoribe
Copy link
Contributor Author

It seems this code causes an error in the latest version of the plotjugler (3.4.4-1focal.20220517.013511).

new_series = MutableScatterXY.new("xxx")

It worked in the old version: 3.4.2-1focal.20220430.111249.
image

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>
@TakaHoribe
Copy link
Contributor Author

Now the error problem was fixed.
facontidavide/PlotJuggler#699

Copy link
Contributor

@taikitanaka3 taikitanaka3 left a comment

Choose a reason for hiding this comment

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

image

LGTM

@taikitanaka3 taikitanaka3 merged commit 2958bfa into autowarefoundation:main Jul 30, 2022
taikitanaka3 referenced this pull request in tier4/autoware.universe Sep 14, 2022
* add planning_debug_tools and trajectory_analyzer implementation

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>

* precommit

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>

* change output topic name

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>

* precommit

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>

* add missing depend

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>

* ci(pre-commit): autofix

* update

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>

* move smoother tools to debug_tools

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
taikitanaka3 referenced this pull request in tier4/autoware.universe Sep 14, 2022
* add planning_debug_tools and trajectory_analyzer implementation

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>

* precommit

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>

* change output topic name

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>

* precommit

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>

* add missing depend

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>

* ci(pre-commit): autofix

* update

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>

* move smoother tools to debug_tools

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
taikitanaka3 referenced this pull request in tier4/autoware.universe Sep 14, 2022
* feat: add planning debug tools (#1362)

* add planning_debug_tools and trajectory_analyzer implementation

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>

* precommit

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>

* change output topic name

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>

* precommit

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>

* add missing depend

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>

* ci(pre-commit): autofix

* update

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>

* move smoother tools to debug_tools

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* feat(planning_debug_tools): add readme and add yaw to analyzer (#1613)

* feat(planning_debug_tools): add readme and add yaw to analyzer

Signed-off-by: tanaka3 <ttatcoder@outlook.jp>

* chore: remove verbose

Signed-off-by: tanaka3 <ttatcoder@outlook.jp>

* update docs

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>

* fix precommit

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>

Signed-off-by: tanaka3 <ttatcoder@outlook.jp>
Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>
Co-authored-by: Takamasa Horibe <horibe.takamasa@gmail.com>

* feat(planning_debug_tools): add accleration calculation (#1782)

* chore: fix maintainer

Signed-off-by: tanaka3 <ttatcoder@outlook.jp>

* feat(planning_debug_tools): add stop reason visualizer (autowarefoundation#1847)

* feat(planning_debug_tools): add stop reason visualizer

Signed-off-by: tanaka3 <ttatcoder@outlook.jp>

* chore : minor change

Signed-off-by: tanaka3 <ttatcoder@outlook.jp>

* fix: pre-commit

Signed-off-by: tanaka3 <ttatcoder@outlook.jp>

* feat: add stop reason text

Signed-off-by: tanaka3 <ttatcoder@outlook.jp>

* chore: add stop text

Signed-off-by: tanaka3 <ttatcoder@outlook.jp>

* doc : add readme

Signed-off-by: tanaka3 <ttatcoder@outlook.jp>

* doc: fix indent

Signed-off-by: tanaka3 <ttatcoder@outlook.jp>

Signed-off-by: tanaka3 <ttatcoder@outlook.jp>

* feat(tier4_autoware_utils): add time argument in appendMarkerArray (#1415)

* feat(tier4_autoware_utils): add time argument in appendMarkerArray

Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>

* add default argument

Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>

Signed-off-by: tanaka3 <ttatcoder@outlook.jp>
Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>
Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>
Co-authored-by: Takamasa Horibe <horibe.takamasa@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Takayuki Murooka <takayuki5168@gmail.com>
boyali referenced this pull request in boyali/autoware.universe Sep 28, 2022
* add planning_debug_tools and trajectory_analyzer implementation

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>

* precommit

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>

* change output topic name

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>

* precommit

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>

* add missing depend

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>

* ci(pre-commit): autofix

* update

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>

* move smoother tools to debug_tools

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
boyali referenced this pull request in boyali/autoware.universe Oct 3, 2022
* add planning_debug_tools and trajectory_analyzer implementation

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>

* precommit

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>

* change output topic name

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>

* precommit

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>

* add missing depend

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>

* ci(pre-commit): autofix

* update

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>

* move smoother tools to debug_tools

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
boyali referenced this pull request in boyali/autoware.universe Oct 3, 2022
* add planning_debug_tools and trajectory_analyzer implementation

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>

* precommit

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>

* change output topic name

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>

* precommit

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>

* add missing depend

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>

* ci(pre-commit): autofix

* update

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>

* move smoother tools to debug_tools

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
yukke42 pushed a commit to tzhong518/autoware.universe that referenced this pull request Oct 14, 2022
* add planning_debug_tools and trajectory_analyzer implementation

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>

* precommit

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>

* change output topic name

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>

* precommit

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>

* add missing depend

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>

* ci(pre-commit): autofix

* update

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>

* move smoother tools to debug_tools

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
boyali referenced this pull request in boyali/autoware.universe Oct 19, 2022
* add planning_debug_tools and trajectory_analyzer implementation

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>

* precommit

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>

* change output topic name

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>

* precommit

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>

* add missing depend

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>

* ci(pre-commit): autofix

* update

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>

* move smoother tools to debug_tools

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
TetsuKawa added a commit to TetsuKawa/autoware.universe that referenced this pull request Jul 1, 2024
…-mrm-handler-for-mrm-v0.6

feat: change MrmState.msg to internal one
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