Skip to content

Commit

Permalink
Feat : #1 rosbag feature update
Browse files Browse the repository at this point in the history
auto launch rviz feature
bag_play.launch file take most recent bag file in bag folder


Former-commit-id: a6705a86fd66f5fd2d1c849dc2ef195404ab9d8f
  • Loading branch information
GeoChoi committed Jun 8, 2023
1 parent 80b6a28 commit beaa8e7
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 8 deletions.
Binary file added bag/2023-06-08_19:23:26.bag
Binary file not shown.
Binary file added bag/2023-06-08_19:41:45.bag
Binary file not shown.
Binary file added bag/2023-06-08_19:42:08.bag
Binary file not shown.
Binary file added bag/2023-06-08_19:43:25.bag
Binary file not shown.
11 changes: 8 additions & 3 deletions launch/bag_play.launch
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
<!-- -->
<!-- bag_filename를 인수로 주고 bag 파일을 재생, monitoring을 위한 rviz도 제공 -->

<launch>
<arg name="bag_filename" default="default"/>
<arg name="bag_filename"
default="$(eval max(eval ('_' + '_import_' + '_(\'glob\')').glob(find('zzangdol_bringup')+'/bag/*'), key=eval ('_' + '_import_' + '_(\'os\')').path.getctime))"/>
<!-- most recent bag file as bag_file -->

<param name="/use_sim_time" value="true" />

<include file="$(find zzangdol_bringup)/launch/zzangdol_state_publisher.launch"/>

<node name="playbag" pkg="rosbag" type="play"
args="$(find zzangdol_bringup)/bag/$(arg bag_filename).bag --pause --clock "/>
args="$(arg bag_filename) --pause --clock "/>

<node name="$(anon rviz)" pkg="rviz" type="rviz" required="false"
args="-d $(find zzangdol_bringup)/rviz/record_monitoring.rviz" />

</launch>
12 changes: 9 additions & 3 deletions launch/bag_record.launch
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
<!--
zzangdol_bring_minimal와 함께 하나의 launch 파일로 바로 record
-->

<launch>
<arg name="usb_config" default="false"/>
<arg name="bag_filename" default="$(eval eval ('_' + '_import_' + '_(\'datetime\')').datetime.now().strftime('%Y-%m-%d_%H:%M:%S'))"/>

<include file="$(find zzangdol_bringup)/launch/zzangdol_bring_minimal.launch"/>

<node name="rviz" pkg="rviz" type="rviz" required="false"
<include file="$(find zzangdol_bringup)/launch/zzangdol_bring_minimal.launch">
<arg name="rviz" default="false"/>
</include>

<node pkg="rosbag" type="record" name="bag_record" required="true"
args="/imu/data /scan -O $(find zzangdol_bringup)/bag/$(arg bag_filename).bag "/>

<node name="$(anon rviz)" pkg="rviz" type="rviz" required="false"
args="-d $(find zzangdol_bringup)/rviz/record_monitoring.rviz" />
</launch>
1 change: 0 additions & 1 deletion launch/zzangdol_bring_all.launch
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
-->

<launch>
<arg name="multi_robot_name" default=""/>
<arg name="usb_config" default="false"/>


Expand Down
7 changes: 6 additions & 1 deletion launch/zzangdol_bring_minimal.launch
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
-->

<launch>
<arg name="multi_robot_name" default=""/>
<arg name="usb_config" default="false"/>
<arg name="rviz" default="true"/>

<!-- 1. bringup HW state tf publisher-->
<include file="$(find zzangdol_bringup)/launch/zzangdol_state_publisher.launch"/>
Expand All @@ -18,4 +18,9 @@
<arg name="usb_config" value="$(arg usb_config)"/>
</include>

<group if="$(arg rviz)">
<node name="$(anon rviz)" pkg="rviz" type="rviz" required="false"
args="-d $(find zzangdol_bringup)/rviz/record_monitoring.rviz" />
</group>

</launch>

0 comments on commit beaa8e7

Please sign in to comment.