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(control_data_collecting_tool): add safety measures and rosbag recording and loading #134

Conversation

YoshihiroKogure
Copy link
Contributor

Description

Add following two functionalities in this PR.

  • Add a feature to stop when crossing the green line.
pr_safety_measure.webm
  • Rosbag2 recording and loading functionalities
    • When nodes are launched, topics in config/topics.yaml are automatically recorded and the data is saved in the directory where nodes are launched.
    • The data from /localization/kinematic_state and /localization/acceleration located in the current directory. You can switch-off this functionality if LOAD_ROSBAG2_FILES in config/param.yaml is set to false.
      Following demo shows control data collecting tool loads data in the current directory and automatically reflects data counting plots.
pr_load_data.webm

Related links

Tests performed

Notes for reviewers

Interface changes

Effects on system behavior

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.

if not target_topic_included:
return target_topic_included

#
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
#

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for your suggestions. I fixed in 24d4175.

@YoshihiroKogure
Copy link
Contributor Author

In the 00b3e0b commit, I modified it to count data only when the operation mode is set to 3.

@kosuke55
Copy link
Contributor

I confirmed that I can read the collection status from rosbag

image

self._present_acceleration = msg

def subscribe_operation_mode(self, msg):
self.present_peration_mode_ = msg.mode
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
self.present_peration_mode_ = msg.mode
self.present_operation_mode_ = msg.mode

Copy link
Contributor

Choose a reason for hiding this comment

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

could you please some typos?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for your feedback. I have made the changes in c95cdfb.

Copy link
Contributor

Choose a reason for hiding this comment

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

Please fix typo again 🙇
collectig

Copy link
Contributor

Choose a reason for hiding this comment

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

I rebased on main so please force push if you fix

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for repeatedly pointing out my mistakes. I have made the corrections.

Comment on lines 149 to 193
def record_message(self):
# Start subscribing to topics and recording if the operation mode is 3(LOCAL)
if self.present_operation_mode_ == 3 and not self.subscribed and not self.recording:
self.writer.create_writer()
self.writer.subscribe_topics()
self.subscribed = True

# Start recording if topics are subscribed and the operation mode is 3
if self.present_operation_mode_ == 3 and self.subscribed and not self.recording:
self.writer.start_record()
self.recording = True

# Stop recording if the operation mode changes from 3
if self.present_operation_mode_ != 3 and self.subscribed and self.recording:
self.writer.stop_record()
self.subscribed = False
self.recording = False
Copy link
Contributor

Choose a reason for hiding this comment

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

please add message print in the terminal when start/stop record

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for your feedback. I have made the changes in c95cdfb.

@YoshihiroKogure YoshihiroKogure force-pushed the feat/add-safety-measures-and-rosbag-record-load branch from c95cdfb to 73ea788 Compare October 21, 2024 02:18
@kosuke55 kosuke55 force-pushed the feat/add-safety-measures-and-rosbag-record-load branch from 7e53291 to dc3b034 Compare October 23, 2024 14:38
@YoshihiroKogure YoshihiroKogure force-pushed the feat/add-safety-measures-and-rosbag-record-load branch from dc3b034 to 8b76f11 Compare October 23, 2024 19:13
@kosuke55 kosuke55 force-pushed the feat/add-safety-measures-and-rosbag-record-load branch from 6ca20b3 to e2bf900 Compare October 23, 2024 23:45
Copy link
Contributor

@kosuke55 kosuke55 left a comment

Choose a reason for hiding this comment

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

LGTM!

@kosuke55 kosuke55 enabled auto-merge (squash) October 23, 2024 23:47
@kosuke55 kosuke55 merged commit dd938c8 into autowarefoundation:main Oct 23, 2024
16 checks passed
Copy link

codecov bot commented Oct 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 0.00%. Comparing base (ad0b811) to head (e2bf900).
Report is 56 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff            @@
##            main    #134      +/-   ##
========================================
- Coverage   2.12%   0.00%   -2.13%     
========================================
  Files        163       1     -162     
  Lines       9402      84    -9318     
  Branches     383       0     -383     
========================================
- Hits         200       0     -200     
+ Misses      9045      84    -8961     
+ Partials     157       0     -157     
Flag Coverage Δ
differential 0.00% <ø> (?)
total ?

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

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