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(elevation_map_loader): add error handling for std::runtime_error #4187

Conversation

Shin-kyoto
Copy link
Contributor

Description

  • The error occurs if there are appropriate .db3 files in directory for elevation map.
  • I want to add error-handling code for this. After this PR, if the appropriate .db3 files are not found in the directory, elevation_map_loader removes directory and creates elevation map.

Related links

TIER IV INTERNAL LINK
TIER IV INTERNAL LINK2

Tests performed

  • Normal situations
❯ ros2 launch elevation_map_loader elevation_map_loader.launch.xml
[INFO] [launch]: All log files can be found below /autoware/.ros/log/2023-07-06-10-18-10-560789-dpc2006001-398871
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [elevation_map_loader-1]: process started with pid [398872]
[elevation_map_loader-1] [INFO 1688606290.997290375] [elevation_map_loader]: subscribe map_hash
[elevation_map_loader-1] [INFO 1688606291.000977180] [elevation_map_loader]: subscribe vector_map
[elevation_map_loader-1] [INFO 1688606291.008255707] [elevation_map_loader]: subscribe pointcloud_map
[elevation_map_loader-1] [INFO 1688606291.012054258] [elevation_map_loader]: Create elevation map from pointcloud map 
[elevation_map_loader-1] [INFO 1688606291.441975551] [elevation_map_loader]: Finish creating elevation map. Total time: 0.425 sec
[elevation_map_loader-1] [INFO 1688606296.565674220] [rosbag2_storage]: Opened database '/autoware/install/elevation_map_loader/share/elevation_map_loader/data/elevation_maps/63cfc18d32c9a46db0b7546b75be522e307abef6af08e207f792f6c2a09d126a/63cfc18d32c9a46db0b7546b75be522e307abef6af08e207f792f6c2a09d126a_0.db3' for READ_WRITE.
[elevation_map_loader-1] [INFO 1688606296.574933011] [elevation_map_loader]: Saving elevation map successful: true
  • Error handling
    • Case1: Directory exists, but .db3 does not exist.
    • ❯ ros2 launch elevation_map_loader elevation_map_loader.launch.xml
      [INFO] [launch]: All log files can be found below /autoware/.ros/log/2023-07-06-10-19-34-406132-dpc2006001-399009
      [INFO] [launch]: Default logging verbosity is set to INFO
      [INFO] [elevation_map_loader-1]: process started with pid [399010]
      [elevation_map_loader-1] [INFO 1688606374.818641867] [elevation_map_loader]: subscribe map_hash
      [elevation_map_loader-1] [INFO 1688606374.832530801] [elevation_map_loader]: subscribe vector_map
      [elevation_map_loader-1] [INFO 1688606374.840596968] [elevation_map_loader]: subscribe pointcloud_map
      [elevation_map_loader-1] [INFO 1688606374.844793917] [elevation_map_loader]: Load elevation map from: /autoware/install/elevation_map_loader/share/elevation_map_loader/data/elevation_maps/63cfc18d32c9a46db0b7546b75be522e307abef6af08e207f792f6c2a09d126a
      [elevation_map_loader-1] [ERROR 1688606374.844948582] [elevation_map_loader]: Try to load bag, but bag is broken. Remove /autoware/install/elevation_map_loader/share/elevation_map_loader/data/elevation_maps/63cfc18d32c9a46db0b7546b75be522e307abef6af08e207f792f6c2a09d126a
      [elevation_map_loader-1] [INFO 1688606374.845057987] [elevation_map_loader]: Create elevation map from pointcloud map 
      [elevation_map_loader-1] [INFO 1688606375.280030493] [elevation_map_loader]: Finish creating elevation map. Total time: 0.431 sec
      [elevation_map_loader-1] [INFO 1688606380.401162748] [rosbag2_storage]: Opened database '/autoware/install/elevation_map_loader/share/elevation_map_loader/data/elevation_maps/63cfc18d32c9a46db0b7546b75be522e307abef6af08e207f792f6c2a09d126a/63cfc18d32c9a46db0b7546b75be522e307abef6af08e207f792f6c2a09d126a_0.db3' for READ_WRITE.
      [elevation_map_loader-1] [INFO 1688606380.410786282] [elevation_map_loader]: Saving elevation map successful: true
    • Case2: .db3 file exists, but .db3 file is broken.
    • ❯ ros2 launch elevation_map_loader elevation_map_loader.launch.xml
      [INFO] [launch]: All log files can be found below /autoware/.ros/log/2023-07-06-10-19-55-486981-dpc2006001-399122
      [INFO] [launch]: Default logging verbosity is set to INFO
      [INFO] [elevation_map_loader-1]: process started with pid [399123]
      [elevation_map_loader-1] [INFO 1688606395.925484773] [elevation_map_loader]: subscribe map_hash
      [elevation_map_loader-1] [INFO 1688606395.928416679] [elevation_map_loader]: subscribe vector_map
      [elevation_map_loader-1] [INFO 1688606395.935859834] [elevation_map_loader]: subscribe pointcloud_map
      [elevation_map_loader-1] [INFO 1688606395.940428703] [elevation_map_loader]: Load elevation map from: /autoware/install/elevation_map_loader/share/elevation_map_loader/data/elevation_maps/63cfc18d32c9a46db0b7546b75be522e307abef6af08e207f792f6c2a09d126a
      [elevation_map_loader-1] [ERROR 1688606395.940626094] [elevation_map_loader]: Try to load bag, but bag is broken. Remove /autoware/install/elevation_map_loader/share/elevation_map_loader/data/elevation_maps/63cfc18d32c9a46db0b7546b75be522e307abef6af08e207f792f6c2a09d126a
      [elevation_map_loader-1] [INFO 1688606395.940764167] [elevation_map_loader]: Create elevation map from pointcloud map 
      [elevation_map_loader-1] [INFO 1688606396.392422123] [elevation_map_loader]: Finish creating elevation map. Total time: 0.448 sec
      [elevation_map_loader-1] [INFO 1688606401.662828475] [rosbag2_storage]: Opened database '/autoware/install/elevation_map_loader/share/elevation_map_loader/data/elevation_maps/63cfc18d32c9a46db0b7546b75be522e307abef6af08e207f792f6c2a09d126a/63cfc18d32c9a46db0b7546b75be522e307abef6af08e207f792f6c2a09d126a_0.db3' for READ_WRITE.
      [elevation_map_loader-1] [INFO 1688606401.672855534] [elevation_map_loader]: Saving elevation map successful: true

Effects on system behavior

elevation_map_loader will be able to handle error for the case when the appropriate .db3 files are not found in the directory.

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: Shin-kyoto <58775300+Shin-kyoto@users.noreply.github.com>
@Shin-kyoto Shin-kyoto requested a review from h-ohta July 6, 2023 05:53
@Shin-kyoto Shin-kyoto requested a review from kosuke55 as a code owner July 6, 2023 05:53
@github-actions github-actions bot added the component:perception Advanced sensor data processing and environment understanding. (auto-assigned) label Jul 6, 2023
@Shin-kyoto Shin-kyoto changed the title feat(elevation_map_loader): Add error handling for std::runtime_error feat(elevation_map_loader): add error handling for std::runtime_error Jul 6, 2023
@codecov
Copy link

codecov bot commented Jul 6, 2023

Codecov Report

Patch coverage has no change and project coverage change: -0.01 ⚠️

Comparison is base (d905e38) 15.23% compared to head (21507d3) 15.23%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4187      +/-   ##
==========================================
- Coverage   15.23%   15.23%   -0.01%     
==========================================
  Files        1469     1469              
  Lines      101781   101782       +1     
  Branches    31396    31396              
==========================================
  Hits        15505    15505              
- Misses      69414    69415       +1     
  Partials    16862    16862              
Flag Coverage Δ *Carryforward flag
differential 0.00% <0.00%> (?)
total 15.23% <ø> (+<0.01%) ⬆️ Carriedforward from 15e5387

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

Impacted Files Coverage Δ
...ation_map_loader/src/elevation_map_loader_node.cpp 0.00% <0.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Signed-off-by: Shin-kyoto <58775300+Shin-kyoto@users.noreply.github.com>
@Shin-kyoto Shin-kyoto requested a review from h-ohta July 6, 2023 06:42
Copy link
Contributor

@h-ohta h-ohta left a comment

Choose a reason for hiding this comment

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

LGTM

@miursh miursh merged commit cde4c92 into autowarefoundation:main Jul 6, 2023
h-ohta pushed a commit to tier4/autoware.universe that referenced this pull request Jul 7, 2023
…autowarefoundation#4187)

* feat(elevation_map_loader): Add error handling for std::runtime_error

Signed-off-by: Shin-kyoto <58775300+Shin-kyoto@users.noreply.github.com>

* feat(elevation_map_loader): add error message output

Signed-off-by: Shin-kyoto <58775300+Shin-kyoto@users.noreply.github.com>

---------

Signed-off-by: Shin-kyoto <58775300+Shin-kyoto@users.noreply.github.com>
h-ohta added a commit to tier4/autoware.universe that referenced this pull request Jul 14, 2023
… (backport autowarefoundation#4187) (#652)

feat(elevation_map_loader): add error handling for std::runtime_error (autowarefoundation#4187)

* feat(elevation_map_loader): Add error handling for std::runtime_error



* feat(elevation_map_loader): add error message output



---------

Signed-off-by: Shin-kyoto <58775300+Shin-kyoto@users.noreply.github.com>
Co-authored-by: Shintaro Tomie <58775300+Shin-kyoto@users.noreply.github.com>
asa-naki pushed a commit to tier4/autoware.universe that referenced this pull request Aug 14, 2024
… (backport autowarefoundation#4187) (#652)

feat(elevation_map_loader): add error handling for std::runtime_error (autowarefoundation#4187)

* feat(elevation_map_loader): Add error handling for std::runtime_error



* feat(elevation_map_loader): add error message output



---------

Signed-off-by: Shin-kyoto <58775300+Shin-kyoto@users.noreply.github.com>
Co-authored-by: Shintaro Tomie <58775300+Shin-kyoto@users.noreply.github.com>
asa-naki added a commit to tier4/autoware.universe that referenced this pull request Aug 29, 2024
* feat(system_error_monitor): manual modules (#793)

* feat(rviz_plugin): console meter is too large on the Rviz with FHD display, isn't it? (#587)

* feat(tier4_planning/vehicle_plugin): make plugins size scalable

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

* remove space

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

* scaling

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

* change diag message

Signed-off-by: asa-naki <akihisa.nagata@tier4.jp>

* fix module name

Signed-off-by: asa-naki <akihisa.nagata@tier4.jp>

* add manual module and ignoring modules

Signed-off-by: asa-naki <akihisa.nagata@tier4.jp>

* Revert "feat(rviz_plugin): console meter is too large on the Rviz with FHD display, isn't it? (#587)"

This reverts commit f96169c.

* Revert "change diag message"

This reverts commit dff01ce.

* ci(pre-commit): autofix

* fix spell check

Signed-off-by: asa-naki <akihisa.nagata@tier4.jp>

* Revert "fix spell check"

This reverts commit 208aa1e.

* Revert "fix module name"

This reverts commit cec7653.

* revert ignore module

Signed-off-by: asa-naki <akihisa.nagata@tier4.jp>

* current_mode check update

Signed-off-by: asa-naki <akihisa.nagata@tier4.jp>

* ci(pre-commit): autofix

* delete margin

Signed-off-by: asa-naki <akihisa.nagata@tier4.jp>

---------

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>
Signed-off-by: asa-naki <akihisa.nagata@tier4.jp>
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>

* feat(ad_service_state_monitor): change configs name (#876)

change configs name

Signed-off-by: asa-naki <akihisa.nagata@tier4.jp>

* feat(plannig_error_monitor): update error sharp angle threshold (#681)

* fix error_sharp_angle

Signed-off-by: Shigekazu Fukuta <shigekazu.fukuta@tier4.jp>

* update readme

Signed-off-by: Shigekazu Fukuta <shigekazu.fukuta@tier4.jp>

---------

Signed-off-by: Shigekazu Fukuta <shigekazu.fukuta@tier4.jp>

* fix: add error handling when path is invalid (#934)

* fix(behavior_path): delete duplicated

* add error handling

* fix: when path size is 1

* fix(detection_area): search collision index only in lanelet (#695)

* fix(detection_area): search collision index only in lanelet

* ci(pre-commit): autofix

---------

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

* fix(detection_area): fix overline function (#930)

* fix(detection_area): fix overline function

* ci(pre-commit): autofix

---------

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

* fix(route_handler): fix threshold for removing overlapping points (#1015)

* fix(route_handler): fix threshold for removing overlapping points

* fix

* fix(ntp_monitor): move chronyc command execution to a timer (backport autowarefoundation#4634) (#880)

fix(ntp_monitor): move chronyc command execution to a timer (autowarefoundation#4634)

* fix(ntp_monitor): move chronyc command execution to a timer



* add newly added parameter timeout to config

---------

Signed-off-by: ito-san <fumihito.ito@tier4.jp>
Co-authored-by: ito-san <57388357+ito-san@users.noreply.github.com>

* feat(elevation_map_loader): add error handling for std::runtime_error (backport autowarefoundation#4187) (#652)

feat(elevation_map_loader): add error handling for std::runtime_error (autowarefoundation#4187)

* feat(elevation_map_loader): Add error handling for std::runtime_error



* feat(elevation_map_loader): add error message output



---------

Signed-off-by: Shin-kyoto <58775300+Shin-kyoto@users.noreply.github.com>
Co-authored-by: Shintaro Tomie <58775300+Shin-kyoto@users.noreply.github.com>

* fix(system_monitor): extend command line to display (backport autowarefoundation#4553) (#768)

fix(system_monitor): extend command line to display (autowarefoundation#4553)

Signed-off-by: ito-san <fumihito.ito@tier4.jp>
Co-authored-by: ito-san <57388357+ito-san@users.noreply.github.com>

* fix(system_monitor): high-memory process are not provided in MEM order (backport autowarefoundation#4654) (#769)

fix(system_monitor): high-memory process are not provided in MEM order (autowarefoundation#4654)

* fix(process_monitor): high-memory process are not being provided in %MEM order



* changed option from 'g' to 'n'



---------

Signed-off-by: ito-san <fumihito.ito@tier4.jp>
Co-authored-by: ito-san <57388357+ito-san@users.noreply.github.com>

* fix(system_monitor): fix program command line reading (backport autowarefoundation#5191, autowarefoundation#5430) (#995)

* perf(system_monitor): fix program command line reading (autowarefoundation#5191)

* Fix program command line reading

Signed-off-by: Owen-Liuyuxuan <uken.ryu@tier4.jp>

* style(pre-commit): autofix

* fix spelling commandline->command_line

Signed-off-by: Owen-Liuyuxuan <uken.ryu@tier4.jp>

---------

Signed-off-by: Owen-Liuyuxuan <uken.ryu@tier4.jp>
Co-authored-by: Owen-Liuyuxuan <uken.ryu@tier4.jp>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* fix(system_monitor): output command line (autowarefoundation#5430)

* fix(system_monitor): output command line

Signed-off-by: takeshi.iwanari <takeshi.iwanari@tier4.jp>

* style(pre-commit): autofix

---------

Signed-off-by: takeshi.iwanari <takeshi.iwanari@tier4.jp>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

---------

Signed-off-by: Owen-Liuyuxuan <uken.ryu@tier4.jp>
Signed-off-by: takeshi.iwanari <takeshi.iwanari@tier4.jp>
Co-authored-by: Yuxuan Liu <619684051@qq.com>
Co-authored-by: Owen-Liuyuxuan <uken.ryu@tier4.jp>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: takeshi-iwanari <takeshi.iwanari@tier4.jp>
Co-authored-by: Akihisa Nagata <54956813+asa-naki@users.noreply.github.com>

* feat(imu_corrector): add gyro_bias_validator (backport autowarefoundation#4729) (#856)

* feat(imu_corrector): add gyro_bias_validator (backport autowarefoundation#4729)
* feat(imu_corrector): add gyro_bias_validator
Signed-off-by: kminoda <koji.minoda@tier4.jp>
* style(pre-commit): autofix
* update
Signed-off-by: kminoda <koji.minoda@tier4.jp>
* revert launch
Signed-off-by: kminoda <koji.minoda@tier4.jp>
* updat
Signed-off-by: kminoda <koji.minoda@tier4.jp>
* style(pre-commit): autofix
* add debug publisher
Signed-off-by: kminoda <koji.minoda@tier4.jp>
* minor fix
Signed-off-by: kminoda <koji.minoda@tier4.jp>
* style(pre-commit): autofix
* style(pre-commit): autofix
* add gtest
Signed-off-by: kminoda <koji.minoda@tier4.jp>
* style(pre-commit): autofix
* updat e readme
Signed-off-by: kminoda <koji.minoda@tier4.jp>
* style(pre-commit): autofix
* add diagnostics
Signed-off-by: kminoda <koji.minoda@tier4.jp>
* style(pre-commit): autofix
* update
Signed-off-by: kminoda <koji.minoda@tier4.jp>
* style(pre-commit): autofix
* validator -> estimator
Signed-off-by: kminoda <koji.minoda@tier4.jp>
* fix build
Signed-off-by: kminoda <koji.minoda@tier4.jp>
* update default parameter
Signed-off-by: kminoda <koji.minoda@tier4.jp>
* update comment
Signed-off-by: kminoda <koji.minoda@tier4.jp>
* update readme
Signed-off-by: kminoda <koji.minoda@tier4.jp>
* style(pre-commit): autofix
* updated
Signed-off-by: kminoda <koji.minoda@tier4.jp>
* minor update in readme
Signed-off-by: kminoda <koji.minoda@tier4.jp>
* style(pre-commit): autofix
* fix pre-commit
Signed-off-by: kminoda <koji.minoda@tier4.jp>
* update readme
Signed-off-by: kminoda <koji.minoda@tier4.jp>
* style(pre-commit): autofix
* Fix NG -> WARN
Signed-off-by: kminoda <koji.minoda@tier4.jp>
---------
Signed-off-by: kminoda <koji.minoda@tier4.jp>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

Signed-off-by: asa-naki <akihisa.nagata@tier4.jp>

* build(imu_corrector): add missing diagnostic_updater dependency (autowarefoundation#4980)

Signed-off-by: Esteve Fernandez <esteve.fernandez@tier4.jp>

* add gyro_bias estimation in diag ( autowarefoundation#5054)

Signed-off-by: asa-naki <akihisa.nagata@tier4.jp>

* ci(pre-commit): autofix

---------

Signed-off-by: asa-naki <akihisa.nagata@tier4.jp>
Signed-off-by: Esteve Fernandez <esteve.fernandez@tier4.jp>
Co-authored-by: kminoda <44218668+kminoda@users.noreply.github.com>
Co-authored-by: Esteve Fernandez <33620+esteve@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* feat(imu_corrector): add gyro bias log (#918)

add gyro_bias log

Signed-off-by: asa-naki <akihisa.nagata@tier4.jp>

* feat(system_error_monitor): add ignore_until_waiting_for_route module (#888)

* add ignore_module

Signed-off-by: asa-naki <akihisa.nagata@tier4.jp>

* add description

Signed-off-by: asa-naki <akihisa.nagata@tier4.jp>

* ci(pre-commit): autofix

* change name ignore_until_waiting_for_route

Signed-off-by: asa-naki <akihisa.nagata@tier4.jp>

* update description

Signed-off-by: asa-naki <akihisa.nagata@tier4.jp>

* rename function name and delete planning state

Signed-off-by: asa-naki <akihisa.nagata@tier4.jp>

* update description

Signed-off-by: asa-naki <akihisa.nagata@tier4.jp>

* Update

---------

Signed-off-by: asa-naki <akihisa.nagata@tier4.jp>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Hiroki OTA <hiroki.ota@tier4.jp>

* feat(system_error_monitor): add ignore hartbeat timeout in initializing state (#972)

* add ignore hartbeat timeout in initializing state

Signed-off-by: asa-naki <akihisa.nagata@tier4.jp>

* fix typo

* Update comment

* ci(pre-commit): autofix

* fix typo

* ci(pre-commit): autofix

* update comment

* ci(pre-commit): autofix

---------

Signed-off-by: asa-naki <akihisa.nagata@tier4.jp>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

---------

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>
Signed-off-by: asa-naki <akihisa.nagata@tier4.jp>
Signed-off-by: Shigekazu Fukuta <shigekazu.fukuta@tier4.jp>
Signed-off-by: ito-san <fumihito.ito@tier4.jp>
Signed-off-by: Shin-kyoto <58775300+Shin-kyoto@users.noreply.github.com>
Signed-off-by: Owen-Liuyuxuan <uken.ryu@tier4.jp>
Signed-off-by: takeshi.iwanari <takeshi.iwanari@tier4.jp>
Signed-off-by: Esteve Fernandez <esteve.fernandez@tier4.jp>
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: Shigekazu Fukuta <107168699+sfukuta@users.noreply.github.com>
Co-authored-by: Hiroki OTA <hiroki.ota@tier4.jp>
Co-authored-by: ito-san <57388357+ito-san@users.noreply.github.com>
Co-authored-by: Shintaro Tomie <58775300+Shin-kyoto@users.noreply.github.com>
Co-authored-by: Yuxuan Liu <619684051@qq.com>
Co-authored-by: Owen-Liuyuxuan <uken.ryu@tier4.jp>
Co-authored-by: takeshi-iwanari <takeshi.iwanari@tier4.jp>
Co-authored-by: kminoda <44218668+kminoda@users.noreply.github.com>
Co-authored-by: Esteve Fernandez <33620+esteve@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:perception Advanced sensor data processing and environment understanding. (auto-assigned)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants