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

[WIP] Set ROS_MASTER_URI to localhost in *robot*_play.sh #1612

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions jsk_data/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ if (CATKIN_ENABLE_TESTING)
roslaunch_add_file_check(launch/baxter_play.launch)
roslaunch_add_file_check(launch/baxter_record.launch)
endif()
find_package(fetch_description QUIET)
if(fetch_description_FOUND)
roslaunch_add_file_check(launch/fetch_play.launch)
roslaunch_add_file_check(launch/fetch_record.launch)
endif()
find_package(pr2_description QUIET)
if(pr2_description_FOUND)
roslaunch_add_file_check(launch/pr2_play.launch)
Expand Down
6 changes: 4 additions & 2 deletions jsk_data/launch/baxter_play.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ filenames="";
for filename in ${@:1:$#}
do
filenames=$filenames" "`pwd`/$filename;
done
done
echo $filenames

export ROS_MASTER_URI=http://localhost:11311
##for check args
##roslaunch --args rosbag_play pr2_play.launch bagfile_names:="$filenames";
roslaunch jsk_data baxter_play.launch bagfile_names:="$filenames";
roslaunch jsk_data baxter_play.launch bagfile_names:="$filenames";
34 changes: 34 additions & 0 deletions jsk_data/launch/fetch_play.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<launch>
<!-- other file args -->
<arg name="bagfile_names" />
<arg name="launch_openni2" default="true"/>
<arg name="launch_robot_model" default="true"/>
<arg name="rosbag_option" default="--clock --loop"/>
<arg name="use_xterm" default="false" />

<!-- set params for rviz -->
<param name="use_sim_time" value="true" />
<param if="$(arg launch_robot_model)"
name="robot_description" textfile="$(find fetch_description)/robots/fetch.urdf"/>

<!-- setup openni_launch -->
<include if="$(arg launch_openni2)"
file="$(find openni2_launch)/launch/openni2.launch">
<arg name="camera" value="head_camera"/>
<arg name="load_driver" value="false"/>
<arg name="depth_registration" value="true"/>
</include>

<group if="$(arg use_xterm)">
<node name="rosbag_play"
pkg="rosbag" type="play"
launch-prefix="xterm -e"
args="$(arg rosbag_option) $(arg bagfile_names)" />
</group>
<group unless="$(arg use_xterm)">
<node name="rosbag_play"
pkg="rosbag" type="play"
args="$(arg rosbag_option) $(arg bagfile_names)" />
</group>

</launch>
11 changes: 11 additions & 0 deletions jsk_data/launch/fetch_play.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash

filenames="";
for filename in ${@:1:$#}
do
filenames=$filenames" "$filename;
done
echo $filenames

export ROS_MASTER_URI=http://localhost:11311
roslaunch jsk_data fetch_play.launch bagfile_names:="$filenames";
44 changes: 44 additions & 0 deletions jsk_data/launch/fetch_record.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<launch>

<!-- for fetch -->
<arg name="save_dir" default="/tmp/fetch_rosbag"/>
<arg name="bagfile_prefix" default="data" />
<arg name="other_topics" default=""/>
<arg name="other_options" default=""/>
<arg name="save_openni2" default="true" />
<arg name="save_base_scan" default="true" />
<arg name="save_robot_model" default="true" />
<arg name="save_all_image" default="false" />
<arg name="camera_namespace" default="head_camera"/>
<arg name="machine" default="localhost" />

<!-- -->
<!-- Conditions -->
<!-- -->

<arg unless="$(arg save_base_scan)"
name="base_scan_topics" value="" />
<arg if ="$(arg save_base_scan)"
name="base_scan_topics" value="/base_scan" />

<arg unless="$(arg save_all_image)"
name="all_image_topics" value="" />
<arg if ="$(arg save_all_image)"
name="all_image_topics" value="-e .*/(image_raw|camera_info)" />

<!-- execute -->
<include file="$(find jsk_data)/launch/common_record.launch">
<arg name="save_openni" value="false" />
<arg name="save_openni2" value="$(arg save_openni2)" />
<arg name="save_robot_model" value="$(arg save_robot_model)" />
<arg name="save_all_image" value="$(arg save_all_image)" />
<arg name="camera_namespace" value="$(arg camera_namespace)" />
<arg name="save_dir" value="$(arg save_dir)" />
<arg name="bagfile_prefix" value="$(arg bagfile_prefix)" />
<arg name="other_options" value="$(arg other_options)" />
<arg name="other_topics" value="$(arg other_topics)
$(arg base_scan_topics)" />
<arg name="machine" value="$(arg machine)" />
</include>

</launch>
4 changes: 3 additions & 1 deletion jsk_data/launch/hrp2_play.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ filenames="";
for filename in ${@:1:$#}
do
filenames=$filenames" "$filename;
done
done
echo $filenames

export ROS_MASTER_URI=http://localhost:11311
##for check args
##roslaunch --args rosbag_play hrp2_play.launch bagfile_names:="$filenames";
roslaunch jsk_data hrp2_play.launch bagfile_names:="$filenames";
1 change: 1 addition & 0 deletions jsk_data/launch/pr2_play.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ while [[ $# -gt 0 ]]; do
esac
done

export ROS_MASTER_URI=http://localhost:11311
roslaunch jsk_data pr2_play.launch bagfile_names:="$FILENAMES" rosbag_option:="$OPTIONS"