Skip to content

Commit

Permalink
Arc 231 fix ros2 bag record (#2453)
Browse files Browse the repository at this point in the history
* set shell false

* add subscriber qos transient local topics

* add topic profile overrides
  • Loading branch information
adev4a authored Nov 1, 2024
1 parent 72620e0 commit b8c34c3
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
31 changes: 31 additions & 0 deletions carma/config/rosbag2_qos_overrides.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,38 @@
## This file defines Quality of Service settings for subscribers created in rosbag2 recording.
## Topics defined here have multiple publishers with different QoS settings which may lead to the rosbag ignoring messages.
## The QoS settings defined here give the subscriber less restrictive settings, so all messages from the topic are retained.

/rosout:
history: keep_all
reliability: reliable
durability: volatile

/environment/lanelet2_map_viz:
history: keep_last
reliability: reliable
durability: transient_local
depth: 1

/environment/lanelet_map_bin:
history: keep_last
reliability: reliable
durability: transient_local
depth: 1

/localization/map_param_loader/georeference:
history: keep_last
reliability: reliable
durability: transient_local
depth: 1

/localization/points_map:
history: keep_last
reliability: reliable
durability: transient_local
depth: 1

/message/incoming_geofence_control:
history: keep_last
reliability: reliable
durability: transient_local
depth: 1
5 changes: 4 additions & 1 deletion carma/launch/ros2_rosbag.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ def record_ros2_rosbag(context: LaunchContext, vehicle_config_param_file, rosbag
exclude_topics_regex += str(topic) + "|"

proc = ExecuteProcess(
cmd=['ros2', 'bag', 'record', '-s', 'mcap', '--qos-profile-overrides-path', overriding_qos_profiles, '-o', '/opt/carma/logs/rosbag2_' + str(datetime.now().strftime('%Y-%m-%d_%H%M%S')), '-a', '-x', exclude_topics_regex],
cmd=['ros2', 'bag', 'record', '-a', '-s', 'mcap',
'--qos-profile-overrides-path', overriding_qos_profiles,
'-o', '/opt/carma/logs/rosbag2_' + str(datetime.now().strftime('%Y-%m-%d_%H%M%S')),
'-x', exclude_topics_regex],
output='screen',
shell='true'
)
Expand Down

0 comments on commit b8c34c3

Please sign in to comment.