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(accel_brake_map_calibrator): fix accel_brake_map_calibrator not to output invalid maps #6992

Merged
merged 1 commit into from
May 13, 2024

Conversation

tkimura4
Copy link
Contributor

@tkimura4 tkimura4 commented May 13, 2024

Description

I have fixed accel_brake_map_calibrator not to output invalid maps.
(
In particular, in previous implementations, there were cases where an invalid map would be outputted when the values of adjacent elements in the map were very close. I have fixed this issue. )

Related links

(TIERIV Internal Link) https://tier4.atlassian.net/browse/RT0-31507

Tests performed

Before:

An accel_brake_map_calibrator output invalid accel_map.csv

Output:

default,0,0.1,0.572158,1.04432,1.51647,1.98863,2.46079,2.93295,3.40511,3.87726,4.34942,4.82158,5.29374,5.76589,6.23805,6.71021,7.18237,7.65453,8.12668,8.59884,9.071
0,-0.13,-0.129,-0.163,-0.163,-0.165,-0.201,-0.227,-0.283,-0.333,-0.411,-0.465,-0.498,-0.499,-0.5,-0.553,-0.58,-0.581,-0.582,-0.583,-0.584,-0.585
0.001,-0.129,-0.128,-0.162,-0.162,-0.164,-0.2,-0.226,-0.282,-0.332,-0.41,-0.464,-0.497,-0.498,-0.499,-0.552,-0.579,-0.58,-0.581,-0.582,-0.583,-0.584
0.032,0.231,0.232,0.137,-0.026,-0.027,-0.051,-0.052,-0.053,-0.054,-0.055,-0.056,-0.057,-0.058,-0.059,-0.06,-0.061,-0.062,-0.063,-0.064,-0.065,-0.067
0.063,0.311,0.312,0.153,0.04,0.039,0.017,-0.035,-0.052,-0.053,-0.054,-0.055,-0.056,-0.057,-0.058,-0.059,-0.06,-0.061,-0.062,-0.063,-0.064,-0.066
0.093,0.312,0.314,0.167,0.095,0.094,0.083,0.063,0.04,0.039,0.038,0.037,0.036,0.035,0.034,0.033,0.032,0.031,0.03,0.029,0.028,0.027
0.124,0.313,0.314,0.222,0.096,0.095,0.086,0.064,0.041,0.04,0.039,0.038,0.037,0.036,0.035,0.034,0.033,0.032,0.031,0.03,0.029,0.028
0.155,0.4,0.401,0.337,0.097,0.096,0.087,0.075,0.074,0.073,0.072,0.071,0.07,0.069,0.068,0.067,0.066,0.065,0.064,0.063,0.062,0.061

After:

Even if an invalid accel_map is provided as input, the output of accel_brake_map_calibrator will be a valid file.

Input:

0,0.3,0.3,0.3,0.3001,-0.4,-0.41,-0.42,-0.44,-0.46,-0.48,-0.5
0.1,0.3,0.3,0.3002,0.18,0.12,0.05,-0.08,-0.16,-0.2,-0.24,-0.28
0.2,0.3,0.3,0.3,0.6,0.48,0.34,0.26,0.2,0.1,0.05,-0.03
0.3,1.75,1.6,1.42,1.3,1.14,1,0.9,0.8,0.72,0.64,0.58
0.4,2.65,2.48,2.3,2.13,1.95,1.75,1.58,1.45,1.32,1.2,1.1
0.5,3.3,3.25,3.12,2.92,2.68,2.35,2.17,1.98,1.88,1.73,1.61

Output:

default,0,1.39,2.78,4.17,5.56,6.94,8.33,9.72,11.11,12.5,13.89
0,0.303,0.302,0.301,0.300,-0.400,-0.410,-0.420,-0.440,-0.460,-0.480,-0.500
0.100,0.305,0.303,0.302,0.301,0.120,0.050,-0.080,-0.160,-0.200,-0.240,-0.280

Notes for reviewers

Interface changes

none

ROS Topic Changes

none

ROS Parameter Changes

none

Effects on system behavior

accel_brake_map_calibrator becomes not to output invalid maps.

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.

…o output invalid maps

Signed-off-by: tomoya.kimura <tomoya.kimura@tier4.jp>
@github-actions github-actions bot added the component:vehicle Vehicle-specific implementations, drivers, packages. (auto-assigned) label May 13, 2024
@tkimura4
Copy link
Contributor Author

Another Case

Input:

default,0.0, 1.39, 2.78, 4.17, 5.56, 6.94, 8.33, 9.72, 11.11, 12.50, 13.89
0,0.3,0.29995,0.299993,0.29992,0.29,0.2895,0.28,0.27999,0.27998,0.27995,0.2799
0.1,0.3,0.29999,0.2994,0.18,0.12,0.05,-0.08,-0.16,-0.2,-0.24,-0.28
0.2,0.3,0.3,0.3,0.6,0.48,0.34,0.26,0.2,0.1,0.05,-0.03
0.3,1.75,1.6,1.42,1.3,1.14,1,0.9,0.8,0.72,0.64,0.58
0.4,2.65,2.48,2.3,2.13,1.95,1.75,1.58,1.45,1.32,1.2,1.1
0.5,3.3,3.25,3.12,2.92,2.68,2.35,2.17,1.98,1.88,1.73,1.61

Output: (Before: invalid)

default,0,1.39,2.78,4.17,5.56,6.94,8.33,9.72,11.11,12.5,13.89
0,0.300,0.299,0.292,0.291,0.290,0.289,0.280,0.280,0.280,0.280,0.280
0.100,0.301,0.300,0.299,0.298,0.291,0.290,0.281,0.281,0.281,0.281,-0.280
0.200,0.302,0.301,0.300,0.300,0.297,0.296,0.282,0.282,0.282,0.282,-0.030
0.300,1.750,1.600,1.420,1.300,1.140,1.000,0.900,0.800,0.720,0.640,0.580
0.400,2.650,2.480,2.300,2.130,1.950,1.750,1.580,1.450,1.320,1.200,1.100
0.500,3.300,3.250,3.120,2.920,2.680,2.350,2.170,1.980,1.880,1.730,1.610

Output: (After: valid)

default,0,1.39,2.78,4.17,5.56,6.94,8.33,9.72,11.11,12.5,13.89
0,0.303,0.302,0.301,0.300,0.290,0.289,0.284,0.283,0.282,0.281,0.280
0.100,0.304,0.303,0.302,0.301,0.291,0.290,0.285,0.284,0.283,0.282,0.281
0.200,0.603,0.602,0.601,0.600,0.480,0.340,0.286,0.285,0.284,0.283,0.282
0.300,1.750,1.600,1.420,1.300,1.140,1.000,0.900,0.800,0.720,0.640,0.580
0.400,2.650,2.480,2.300,2.130,1.950,1.750,1.580,1.450,1.320,1.200,1.100
0.500,3.300,3.250,3.120,2.920,2.680,2.350,2.170,1.980,1.880,1.730,1.610

@tkimura4 tkimura4 requested a review from h-ohta May 13, 2024 08:32
@tkimura4 tkimura4 added the run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label May 13, 2024
@tkimura4 tkimura4 enabled auto-merge (squash) May 13, 2024 09:37
Copy link
Contributor

@1222-takeshi 1222-takeshi 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 merged commit 7302cd7 into autowarefoundation:main May 13, 2024
41 of 43 checks passed
@tkimura4 tkimura4 deleted the fix/accel_brake_map_calib branch May 13, 2024 10:02
h-ohta pushed a commit to tier4/autoware.universe that referenced this pull request May 14, 2024
…o output invalid maps (autowarefoundation#6992)

Signed-off-by: tomoya.kimura <tomoya.kimura@tier4.jp>
h-ohta added a commit to tier4/autoware.universe that referenced this pull request May 14, 2024
chore: backport autowarefoundation#6973 and autowarefoundation#6992
vividf pushed a commit to vividf/autoware.universe that referenced this pull request May 16, 2024
…o output invalid maps (autowarefoundation#6992)

Signed-off-by: tomoya.kimura <tomoya.kimura@tier4.jp>
Signed-off-by: vividf <yihsiang.fang@tier4.jp>
karishma1911 pushed a commit to Interplai/autoware.universe that referenced this pull request Jun 3, 2024
…o output invalid maps (autowarefoundation#6992)

Signed-off-by: tomoya.kimura <tomoya.kimura@tier4.jp>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:vehicle Vehicle-specific implementations, drivers, packages. (auto-assigned) run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants