ROSBuzz_MISTLab/misc/cmdlinectr.sh

90 lines
3.4 KiB
Bash
Raw Normal View History

2017-02-22 09:13:23 -04:00
#! /bin/bash
function takeoff {
rosservice call /buzzcmd 0 22 0 0 0 0 0 0 0 0
2017-02-22 09:13:23 -04:00
}
function land {
rosservice call /buzzcmd 0 21 0 0 0 0 0 0 0 0
2017-02-22 09:13:23 -04:00
}
2017-06-13 14:38:28 -03:00
function arm {
rosservice call /buzzcmd 0 400 0 1 0 0 0 0 0 0
2017-06-13 14:38:28 -03:00
}
function disarm {
rosservice call /buzzcmd 0 400 0 0 0 0 0 0 0 0
2017-06-13 14:38:28 -03:00
}
2018-09-06 13:47:38 -03:00
function timesync {
rosservice call /buzzcmd 0 777 0 0 0 0 0 0 0 0
2018-09-06 13:47:38 -03:00
}
2017-06-26 15:09:33 -03:00
function testWP {
rosservice call /buzzcmd 0 16 0 0 0 0 0 45.45782 -- -73.63608 10
2017-06-26 15:09:33 -03:00
}
2017-02-22 09:13:23 -04:00
function record {
2017-06-14 14:18:00 -03:00
rosbag record $1/flight_status $1/global_position $1/users_pos $1/local_position $1/neighbours_pos /power_status /guidance/obstacle_distance /guidance/front/depth/image_rect/compressedDepth /guidance/right/depth/image_rect/compressedDepth /guidance/front/depth/points /guidance/right/depth/points /guidance/front/right/image_rect/compressed /guidance/front/left/image_rect/compressed /guidance/right/right/image_rect/compressed /guidance/right/left/image_rect/compressed /guidance/front/left/camera_info /guidance/front/right/camera_info /guidance/right/right/camera_info /guidance/right/left/camera_info
2017-06-26 15:35:15 -03:00
2017-02-22 09:13:23 -04:00
}
function clean {
sudo rm /var/log/upstart/robot*
2017-06-13 15:10:28 -03:00
sudo rm /var/log/upstart/dji*
2017-02-22 09:13:23 -04:00
sudo rm /var/log/upstart/x3s*
}
function startrobot {
2017-06-14 17:07:44 -03:00
sudo service dji start
2017-02-22 09:13:23 -04:00
}
function stoprobot {
2017-06-14 17:07:44 -03:00
sudo service dji stop
2017-02-22 09:13:23 -04:00
}
2017-06-13 14:38:28 -03:00
function updaterobot {
rosrun robot_upstart uninstall dji
if [ "$1" = 0 ] && [ "$2" = "X" ]
then
echo "Installing launch file for TX-ubuntu16 with usb2serial"
echo "With xbeemav"
rosrun robot_upstart install --logdir /media/key/ROS_WS/log/ dji_sdk_mistlab/launch_robot/m100TX16US.launch
2018-09-26 16:11:29 -03:00
elif [ "$1" = 1 ] && [ "$2" = "X" ]
then
echo "Installing launch file for TX-ubuntu16"
echo "With xbeemav"
rosrun robot_upstart install --logdir /media/key/ROS_WS/log/ dji_sdk_mistlab/launch_robot/m100TX16.launch
elif [ "$1" = 2 ] && [ "$2" = "X" ]
then
echo "Installing launch file for TK-ubuntu14"
echo "With xbeemav"
rosrun robot_upstart install --logdir /media/key/ROS_WS/log/ dji_sdk_mistlab/launch_robot/m100TKAll.launch
elif [ "$1" = 3 ] && [ "$2" = "X" ]
then
echo "Installing launch file for Solo"
echo "With xbeemav"
rosrun robot_upstart install --logdir /media/key/ROS_WS/log/ dji_sdk_mistlab/launch_robot/solo.launch
2018-09-26 16:11:29 -03:00
elif [ "$1" = 4 ] && [ "$2" = "X" ]
then
echo "Installing launch file for Spiris"
echo "With xbeemav"
rosrun robot_upstart install --logdir /media/key/ROS_WS/log/ dji_sdk_mistlab/launch_robot/spiri.launch
elif [ "$1" = 0 ] && [ "$2" = "H" ]
then
echo "Installing launch file for TX-ubuntu16 with usb2serial"
echo "With heavenmav"
rosrun robot_upstart install --logdir /media/key/ROS_WS/log/ dji_sdk_mistlab/launch_robot/m100TX16USHeaven.launch
2018-09-26 16:11:29 -03:00
elif [ "$1" = 1 ] && [ "$2" = "H" ]
then
echo "Installing launch file for TX-ubuntu16"
echo "With heavenmav"
rosrun robot_upstart install --logdir /media/key/ROS_WS/log/ dji_sdk_mistlab/launch_robot/m100TX16Heaven.launch
elif [ "$1" = 2 ] && [ "$2" = "H" ]
then
echo "Installing launch file for TK-ubuntu14"
echo "With heavenmav"
rosrun robot_upstart install --logdir /media/key/ROS_WS/log/ dji_sdk_mistlab/launch_robot/m100TKAllHeaven.launch
elif [ "$1" = 3 ] && [ "$2" = "H" ]
then
echo "Installing launch file for Solo"
echo "With heavenmav"
rosrun robot_upstart install --logdir /media/key/ROS_WS/log/ dji_sdk_mistlab/launch_robot/soloHeaven.launch
else
echo "Wrong arguments!"
fi
2017-06-13 14:38:28 -03:00
}
2017-11-22 22:59:57 -04:00
function uavstate {
let "a = $1 + 900"
rosservice call robot0/buzzcmd 0 $a 0 0 0 0 0 0 0 0
2017-06-13 14:38:28 -03:00
}