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

Make the travis script more robust #204

Merged
merged 1 commit into from
Nov 30, 2015
Merged
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
1 change: 1 addition & 0 deletions test/examples/setup_examples.launch
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<include file="$(find rosbridge_server)/launch/rosbridge_websocket.launch" />
<node name="tf_publisher" pkg="tf" type="static_transform_publisher" args="0 0 0 0 0 0 /world /turtle1 100" />
<node name="tf2_web_republisher" pkg="tf2_web_republisher" type="tf2_web_republisher" />
<node name="fibonacci_server" pkg="actionlib_tutorials" type="fibonacci_server" />
<node name="add_two_ints_server" pkg="rospy_tutorials" type="add_two_ints_server" />
<node name="hello_world_publisher" pkg="rostopic" type="rostopic" args='pub /listener std_msgs/String "Hello, World"' />
</launch>
30 changes: 17 additions & 13 deletions test/examples/setup_examples.sh
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
if command -v rosrun 2>/dev/null; then
echo "Shutting everything down"
ps aux | grep ros | awk '{print $2}' | xargs kill -9
ps aux | grep [r]os | awk '{print $2}' | xargs kill -9
sleep 1

echo "Starting roscore and various examples in background processes"
roslaunch test/examples/setup_examples.launch > roslaunch.log &

nohup roscore > /dev/null 2>&1&
sleep 2
nohup rosrun tf static_transform_publisher 0 0 0 0 0 0 world turtle1 100 > /dev/null 2>&1&
nohup rosrun tf2_web_republisher tf2_web_republisher > /dev/null 2>&1&
nohup rosrun actionlib_tutorials fibonacci_server > /dev/null 2>&1&
nohup rosrun rospy_tutorials add_two_ints_server > /dev/null 2>&1&
nohup rostopic pub /listener std_msgs/String "Hello, World" > /dev/null 2>&1&
# wait a moment then start up bridge
sleep 3
nohup roslaunch rosbridge_server rosbridge_websocket.launch > /dev/null 2>&1&
sleep 3
echo "Ready for lift off"
LAUNCHED=false
for i in 1 2 3 4 5 6 7 8 9 10
do
echo "Waiting for /hello_world_publisher...$i"
sleep 1
rostopic info /listener > /dev/null && LAUNCHED=true && break
done
if [ "$LAUNCHED" = true ] ; then
echo "Ready for lift off"
exit 0
else
echo "/hello_world_publisher not launched"
exit 1
fi
else
echo "Couldn't find ROS on path (try to source it)"
echo "source /opt/ros/indigo/setup.bash"
exit 1
fi