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(perception_replyer): fix dying when no traffic signals #14

Merged
merged 1 commit into from
Mar 11, 2024

Conversation

kosuke55
Copy link
Contributor

@kosuke55 kosuke55 commented Mar 11, 2024

Description

fix dying when no traffic signals

before

$ ros2 run planning_debug_tools perception_replayer.py -b Pn_UCv2.0_Pedestrian_Tracking/result_bag_0.db3
Stared loading rosbag
[INFO 1710178110.720895793] [rosbag2_storage]: Opened database 'Pn_UCv2.0_Pedestrian_Tracking/result_bag_0.db3' for READ_ONLY. (open() at ./src/rosbag2_storage_default_plugins/sqlite/sqlite_storage.cpp:227)
Ended loading rosbag
Start timer callback
Traceback (most recent call last):
  File "/home/kosuke55/pilot-auto.latest/install/planning_debug_tools/lib/planning_debug_tools/perception_replayer.py", line 198, in <module>
    rclpy.spin_once(node, timeout_sec=0.01)
  File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/__init__.py", line 202, in spin_once
    executor.spin_once(timeout_sec=timeout_sec)
  File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/executors.py", line 713, in spin_once
    raise handler.exception()
  File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/task.py", line 239, in __call__
    self._handler.send(None)
  File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/executors.py", line 418, in handler
    await call_coroutine(entity, arg)
  File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/executors.py", line 332, in _execute_timer
    await await_or_execute(tmr.callback)
  File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/executors.py", line 107, in await_or_execute
    return callback(*args)
  File "/home/kosuke55/pilot-auto.latest/install/planning_debug_tools/lib/planning_debug_tools/perception_replayer.py", line 77, in on_timer
    msgs = copy.deepcopy(self.find_topics_by_timestamp(self.bag_timestamp))
  File "/home/kosuke55/pilot-auto.latest/src/tools/planning/planning_debug_tools/scripts/perception_replayer/perception_replayer_common.py", line 179, in find_topics_by_timestamp
    traffic_signals_data = self.binary_search(self.rosbag_traffic_signals_data, timestamp)
  File "/home/kosuke55/pilot-auto.latest/src/tools/planning/planning_debug_tools/scripts/perception_replayer/perception_replayer_common.py", line 156, in binary_search
    if data[-1][0] < timestamp:
IndexError: list index out of range
[ros2run]: Process exited with failure 1

after

$ ros2 run planning_debug_tools perception_replayer.py -b Pn_UCv2.0_Pedestrian_Tracking/result_bag_0.db3
Stared loading rosbag
[INFO 1710178283.318049921] [rosbag2_storage]: Opened database 'Pn_UCv2.0_Pedestrian_Tracking/result_bag_0.db3' for READ_ONLY. (open() at ./src/rosbag2_storage_default_plugins/sqlite/sqlite_storage.cpp:227)
Ended loading rosbag
Start timer callback

Related links

Tests performed

ros2 run planning_debug_tools perception_replayer.py

Notes for reviewers

Interface changes

none

Effects on system behavior

none

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.

@kosuke55 kosuke55 enabled auto-merge (squash) March 11, 2024 17:56
Copy link

codecov bot commented Mar 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 0.00%. Comparing base (e90db5d) to head (c06e1e0).

Additional details and impacted files
@@          Coverage Diff          @@
##            main     #14   +/-   ##
=====================================
  Coverage   0.00%   0.00%           
=====================================
  Files         22      22           
  Lines       1445    1445           
=====================================
  Misses      1445    1445           
Flag Coverage Δ *Carryforward flag
differential 0.00% <ø> (?)
total 0.00% <ø> (ø) Carriedforward from e90db5d

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kosuke55 kosuke55 merged commit 6443b68 into main Mar 11, 2024
41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants