Skip to content

Commit 359c53a

Browse files
authored
Merge pull request #190 from bit-bots/feature/add_record_rosbag_launch
Add record rosbag launch
2 parents 4bc41ca + e3cca8a commit 359c53a

5 files changed

Lines changed: 98 additions & 8 deletions

File tree

bitbots_bringup/launch/teamplayer.launch

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
<?xml version="1.0"?>
22
<launch>
3+
<arg name="audio" default="true" description="Whether the audio system should be started" />
34
<arg name="behavior" default="true" description="Whether the behavior control system should be started" />
45
<arg name="game_controller" default="true" description="Whether the Gamecontroller module should be started" />
56
<arg name="ipm" default="true" description="Whether the inverse perspective mapping should be started"/>
67
<arg name="localization" default="true" description="Whether the localization system should be started" />
7-
<arg name="monitoring" default="false" description="Whether the monitoring tools should be started should be started"/>
88
<arg name="motion" default="true" description="Whether the motion control system should be started" />
99
<arg name="path_planning" default="true" description="Whether the path planning should be started"/>
1010
<arg name="sim" default="false" description="Whether the robot is running in simulation or on real hardware" />
1111
<arg name="teamcom" default="false" description="Whether the team communication system should be started" />
12+
<arg name="tools" default="false" description="Whether the tools should be started"/>
1213
<arg name="vision" default="true" description="Whether the vision system should be started" />
1314
<arg name="world_model" default="true" description="Whether the world model should be started"/>
1415

@@ -26,6 +27,7 @@
2627

2728
<!-- load the highlevel stuff -->
2829
<include file="$(find-pkg-share bitbots_bringup)/launch/highlevel.launch">
30+
<arg name="audio" value="$(var audio)" />
2931
<arg name="behavior" value="$(var behavior)" />
3032
<arg name="game_controller" value="$(var game_controller)" />
3133
<arg name="ipm" value="$(var ipm)" />
@@ -37,8 +39,10 @@
3739
<arg name="world_model" value="$(var world_model)" />
3840
</include>
3941

40-
<!-- load some monitoring tools -->
41-
<group if="$(var monitoring)">
42-
<include file="$(find-pkg-share bitbots_utils)/launch/tools.launch" />
42+
<!-- load tools -->
43+
<group if="$(var tools)">
44+
<include file="$(find-pkg-share bitbots_utils)/launch/tools.launch">
45+
<arg name="sim" value="$(var sim)" />
46+
</include>
4347
</group>
4448
</launch>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0"?>
2+
<launch>
3+
<include file="$(find-pkg-share udp_bridge)/launch/send.launch" />
4+
<include file="$(find-pkg-share system_monitor)/launch/system_monitor.launch">
5+
<arg name="required" value="false" />
6+
</include>
7+
</launch>
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<launch>
3+
<arg name="sim" default="false" description="true: Use simulation time" />
4+
<arg name="max_image_frequency" default="1.0" description="Max frequency [hz] for recording images" />
5+
<arg name="max_pointcloud_frequency" default="1.0" description="Max frequency [hz] for recording pointclouds" />
6+
7+
<node name="record_rosbag_drop_images" pkg="topic_tools" exec="throttle"
8+
args="messages /camera/image_proc $(var max_image_frequency) /camera/image_to_record" />
9+
<node name="record_rosbag_drop_pointclouds" pkg="topic_tools" exec="throttle"
10+
args="messages /line_mask_relative_pc $(var max_pointcloud_frequency) /line_mask_relative_pc_to_record" />
11+
12+
<!-- The command is a bit complicated, because we want to have a unique filename
13+
and the date command would normally include a newline at the end. -->
14+
<!-- We also set include-hidden-topics twice, because otherwise, the else case would produce some unprintable character that breaks the command. -->
15+
<executable cmd="ros2 bag record \
16+
-o $(env HOME)/rosbags/ID_$(env ROBOCUP_ROBOT_ID $(env ROBOT_NAME unknown_robot))_$(command 'bash -c &quot;date +%s |tr -d \\&quot;\\n\\&quot;&quot;') \
17+
--node-name ros2_bag_record \
18+
--include-hidden-topics \
19+
--include-unpublished-topics \
20+
--polling-interval 1000 \
21+
$(eval '\'--use_sim_time\' if \'$(var sim)\'==\'true\' else \'--include-hidden-topics\'') \
22+
/animation \
23+
/audio/audio_info \
24+
/audio/audio \
25+
/ball_obstacle_active \
26+
/ball_position_relative_filtered \
27+
/ball_relative_filtered \
28+
/ball_relative_movement \
29+
/balls_relative \
30+
/camera/camera_info \
31+
/camera/image_to_record \
32+
/clock \
33+
/cmd_vel \
34+
/cop_l \
35+
/cop_r \
36+
/core/power_switch_status \
37+
/debug_markers \
38+
/debug/approach_point \
39+
/debug/ball_twist \
40+
/debug/dsd/body_behavior \
41+
/debug/dsd/hcm \
42+
/debug/dsd/head_behavior \
43+
/debug/dsd/localization \
44+
/debug/used_ball \
45+
/debug/which_ball_is_used \
46+
/diagnostics \
47+
/diagnostics_agg \
48+
/DynamixelController/command \
49+
/field_boundary_relative \
50+
/game_controller_connected \
51+
/gamestate \
52+
/goal_pose \
53+
/head_mode \
54+
/imu_head/data \
55+
/imu/data_raw \
56+
/joint_states \
57+
/line_mask_relative_pc_to_record \
58+
/motion_odometry \
59+
/move_base/current_goal \
60+
/obstacles_relative \
61+
/pose_with_covariance \
62+
/robot_state \
63+
/robots_relative \
64+
/robots_relative_filtered \
65+
/rosout \
66+
/server_time_clock \
67+
/speak \
68+
/strategy \
69+
/system_workload \
70+
/team_data \
71+
/tf \
72+
/tf_static \
73+
/time_to_ball" output="screen" />
74+
</launch>

bitbots_utils/launch/tools.launch

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
<?xml version="1.0"?>
22
<launch>
33
<arg name="monitoring" default="true" description="true: start system monitor and udp bridge" />
4+
<arg name="record" default="true" description="true: start the ros bag recording" />
5+
<arg name="sim" default="false" description="Whether the robot is running in simulation or on real hardware" />
46

57
<group if="$(var monitoring)">
6-
<include file="$(find-pkg-share system_monitor)/launch/system_monitor.launch">
7-
<arg name="required" value="false" />
8-
</include>
8+
<include file="$(find-pkg-share bitbots_utils)/launch/monitoring.launch" />
9+
</group>
910

10-
<include file="$(find-pkg-share udp_bridge)/launch/send.launch" />
11+
<group if="$(var record)">
12+
<include file="$(find-pkg-share bitbots_utils)/launch/record_bag.launch">
13+
<arg name="sim" value="$(var sim)" />
14+
</include>
1115
</group>
1216
</launch>

bitbots_utils/package.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
<depend>python3-yaml</depend>
3030
<depend>python3-transforms3d</depend>
3131
<depend>python3-numpy</depend>
32+
<depend>topic_tools</depend>
3233

3334
<export>
3435
<bitbots_documentation>

0 commit comments

Comments
 (0)