Transférer les fichiers vers 'Projet/pioneer_gazebo_ros/pioneer_gazebo/src'

This commit is contained in:
Hadrien 2020-06-27 10:31:50 +02:00
parent 4c0a4d166b
commit aa6ebbd834
2 changed files with 69 additions and 0 deletions

View file

@ -0,0 +1,44 @@
#!/bin/bash
PATH=$(echo $PATH | sed 's|/home/aadi-workstation/anaconda3/bin:||g')
export PATH=$PATH
my_pid=$$
echo "My process ID is $my_pid"
echo "Launching Gazebo..."
roslaunch pioneer_gazebo multi_pioneer_world.launch &
pid=$!
echo "Loading initialisation parameters..."
sleep 10s
roslaunch pioneer_description robot_description.launch
echo "Launching Pioneers in Gazebo stack..."
sleep 5s
for i in `seq 1 2`;
do
roslaunch pioneer_description generic_pioneer.launch name:=pioneer$i pose:="-x $(rosparam get /pioneer$i/x) -y $(rosparam get /pioneer$i/y) -Y $(rosparam get /pioneer$i/a)" &
pid="$pid $!"
sleep 7s
done
echo "Launching map server..."
sleep 5s
roslaunch nav_bundle map_server.launch map_name:=utm_0 &
pid="$pid $!"
echo "Advertising topics..."
sleep 5s
rosrun rocon_flip advertise-from-hub
echo "Flipping connections to rviz..."
rosrun rocon_flip flip-from-hub
#echo "Launching rviz..."
#roslaunch pioneer_description multi_pioneer_rviz.launch &
#pid="$pid $!"
trap "echo Killing all processes.; kill -2 TERM $pid; exit" SIGINT SIGTERM
sleep 24h

View file

@ -0,0 +1,25 @@
#!/bin/bash
my_pid=$$
echo "My process ID is $my_pid"
export ROBOT_NAME="pioneer"
echo "Pulling advertised topics..."
rosrun rocon_flip pull-from-hub
echo "Flipping topics from local machine..."
rosrun rocon_flip pioneer-nav-flip
echo "Loading robot parameters..."
roslaunch pioneer_description robot_description.launch
rosparam set /use_sim_time true
echo "Launching robot navigation packages..."
namespace=($ROBOT_NAME)
roslaunch nav_bundle single_navigation.launch robot_name:=${namespace[0]} x:="$(rosparam get /${namespace[0]}/x)" y:="$(rosparam get /${namespace[0]}/y)" yaw:="$(rosparam get /${namespace[0]}/a)" &
pid=$!
trap "echo Killing all processes.; kill -2 TERM $pid; exit" SIGINT SIGTERM
sleep 24h