git commit -m "first commit for v2"
This commit is contained in:
17
Devices/Packages/sick_line_guidance/turtlebotDemo/test/scripts/cleanup.bash
Executable file
17
Devices/Packages/sick_line_guidance/turtlebotDemo/test/scripts/cleanup.bash
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
|
||||
pushd ../../../../../
|
||||
source /opt/ros/melodic/setup.bash
|
||||
./src/sick_line_guidance_demo/test/scripts/killall.bash
|
||||
killall rosmaster ; sleep 1
|
||||
|
||||
echo -e "\n# cleanup.bash: Deleting ros cache and logfiles and catkin folders ./build ./devel ./install"
|
||||
rosclean purge -y
|
||||
rm -rf ./build ./devel ./install
|
||||
rm -rf ~/.ros/*
|
||||
# rm -rf ~/.ros/log/*
|
||||
catkin clean --yes --all-profiles --verbose
|
||||
catkin_make clean
|
||||
popd
|
||||
if [ -f ./sick_line_guidance_demo.avi ] ; then rm -f ./sick_line_guidance_demo.avi ; fi
|
||||
|
||||
23
Devices/Packages/sick_line_guidance/turtlebotDemo/test/scripts/clion.bash
Executable file
23
Devices/Packages/sick_line_guidance/turtlebotDemo/test/scripts/clion.bash
Executable file
@@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
|
||||
# init ros environment
|
||||
source /opt/ros/melodic/setup.bash
|
||||
source ../../../../../devel/setup.bash
|
||||
source ../../../../../install/setup.bash
|
||||
|
||||
# start edit resource-files
|
||||
gedit ./rungeneric.bash ../../sick_line_guidance_demo/launch/sick_line_guidance_demo_node.launch ../../sick_line_guidance_demo/yaml/sick_line_guidance_demo.yaml &
|
||||
|
||||
# start clion
|
||||
echo -e "Starting clion...\nNote in case of clion/cmake errors:"
|
||||
echo -e " Click 'File' -> 'Reload Cmake Project'"
|
||||
echo -e " cmake/clion: Project 'XXX' tried to find library '-lpthread' -> delete 'thread' from find_package(Boost ... COMPONENTS ...) in CMakeLists.txt"
|
||||
echo -e " rm -rf ../../../.idea # removes all clion settings"
|
||||
echo -e " rm -f ~/CMakeCache.txt"
|
||||
echo -e " 'File' -> 'Settings' -> 'CMake' -> 'CMake options' : CATKIN_DEVEL_PREFIX=~/TASK007_PA0100_ROS_Treiber_Spurfuehrungsssensor/catkin_ws/devel"
|
||||
echo -e " 'File' -> 'Settings' -> 'CMake' -> 'Generation path' : ../clion_build"
|
||||
|
||||
pushd ../../../../..
|
||||
~/Public/clion-2018.3.3/bin/clion.sh ./src &
|
||||
popd
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
#!/bin/bash
|
||||
|
||||
#
|
||||
# Get all packages for sick_line_guidance_demo,
|
||||
# build and install.
|
||||
#
|
||||
|
||||
# Clean up
|
||||
# rosclean purge -y
|
||||
# rm -rf ./build ./devel ./install
|
||||
# rm -rf ~/.ros/*
|
||||
# catkin clean --yes --all-profiles --verbose
|
||||
# catkin_make clean
|
||||
#
|
||||
# Install ros packages for turtlebot
|
||||
pushd ../../../../../src
|
||||
git clone https://github.com/ROBOTIS-GIT/turtlebot3.git
|
||||
git clone https://github.com/ROBOTIS-GIT/turtlebot3_msgs.git
|
||||
git clone https://github.com/ROBOTIS-GIT/hls_lfcd_lds_driver.git
|
||||
git clone https://github.com/ros-drivers/rosserial.git
|
||||
# Install ros packages for turtlebot simulation
|
||||
git clone https://github.com/ROBOTIS-GIT/turtlebot3_simulations
|
||||
git clone https://github.com/ROBOTIS-GIT/turtlebot3_gazebo_plugin.git
|
||||
# Install can_open packages
|
||||
git clone https://github.com/ros-industrial/ros_canopen.git
|
||||
git clone https://github.com/CANopenNode/CANopenSocket.git
|
||||
git clone https://github.com/linux-can/can-utils.git
|
||||
# Install sick_line_guidance package
|
||||
git clone https://github.com/ros-planning/random_numbers.git
|
||||
git clone https://github.com/SICKAG/sick_line_guidance.git
|
||||
# Install ros packages required for robot_fsm
|
||||
git clone https://github.com/uos/sick_tim.git
|
||||
# Install video support for sick_line_guidance_demo
|
||||
sudo apt-get install ffmpeg
|
||||
sudo apt-get install vlc
|
||||
# Install profiling and performance tools
|
||||
git clone https://github.com/catkin/catkin_simple.git
|
||||
# git clone https://github.com/ethz-asl/schweizer_messer.git # toolbox including timing utilities
|
||||
sudo svn export https://github.com/ethz-asl/schweizer_messer/trunk/sm_common # common utilities from ethz-asl "schweizer messer" toolbox
|
||||
sudo svn export https://github.com/ethz-asl/schweizer_messer/trunk/sm_timing # timing utilities from ethz-asl "schweizer messer" toolbox
|
||||
sudo apt-get install google-perftools libgoogle-perftools-dev graphviz # libprofiler for profiling
|
||||
# Build and install
|
||||
cd ..
|
||||
catkin_make install --cmake-args -DTURTLEBOT_DEMO="ON"
|
||||
source ./install/setup.bash
|
||||
popd
|
||||
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo -e "#\n# runsimu.bash: Stopping all rosnodes...\n# rosnode kill -a ; sleep 1 ; killall robot_fsm rqt_plot gzclient gzserver ; sleep 3\n#"
|
||||
rosnode kill -a ; sleep 1 ; killall robot_fsm ; killall rqt_plot gzclient ; sleep 1 ; killall gzserver ; sleep 3 # ; killall rosmaster ; sleep 1
|
||||
|
||||
41
Devices/Packages/sick_line_guidance/turtlebotDemo/test/scripts/make.bash
Executable file
41
Devices/Packages/sick_line_guidance/turtlebotDemo/test/scripts/make.bash
Executable file
@@ -0,0 +1,41 @@
|
||||
#!/bin/bash
|
||||
|
||||
#
|
||||
# Build and install sick_line_guidance_demo.
|
||||
# Use ./gitCloneInstall.bash to install required packages.
|
||||
#
|
||||
|
||||
# delete old logfiles
|
||||
pushd ../../../../..
|
||||
rm -rf install/lib/sick_line_guidance/*
|
||||
rm -rf install/lib/sick_line_guidance_demo/*
|
||||
rm -rf install/share/sick_line_guidance/*
|
||||
rm -rf install/share/sick_line_guidance_demo/*
|
||||
rm -f build/catkin_make_install.log
|
||||
|
||||
# make install, use cmake option TURTLEBOT_DEMO="ON" to include the sick_line_guidance_demo packages in folder turtlebotDemo
|
||||
source /opt/ros/melodic/setup.bash
|
||||
catkin_make --cmake-args -DTURTLEBOT_DEMO="ON" 2>&1 | tee -a build/catkin_make_install.log
|
||||
catkin_make install --cmake-args -DTURTLEBOT_DEMO="ON" 2>&1 | tee -a build/catkin_make_install.log
|
||||
source ./install/setup.bash
|
||||
|
||||
# lint, install by running
|
||||
# sudo apt-get install python-catkin-lint
|
||||
# catkin_lint -W1 src/sick_line_guidance_demo
|
||||
# catkin_lint -W1 src/sick_line_guidance
|
||||
# catkin_lint -W1 src/sick_line_guidance_demo/sick_line_guidance_demo
|
||||
|
||||
# print warnings and errors
|
||||
echo -e "\nmake.bash finished.\n"
|
||||
echo -e "catkin_make warnings:"
|
||||
cat build/catkin_make_install.log | grep -i "warning:"
|
||||
echo -e "\ncatkin_make errors:"
|
||||
cat build/catkin_make_install.log | grep -i "error:"
|
||||
|
||||
# print sick_line_guidance install files, libraries, executables
|
||||
echo -e "\ninstall/lib/sick_line_guidance:"
|
||||
ls -al install/lib/sick_line_guidance/*
|
||||
echo -e "\ninstall/share/sick_line_guidance:"
|
||||
ls install/share/sick_line_guidance/*.*
|
||||
popd
|
||||
|
||||
10
Devices/Packages/sick_line_guidance/turtlebotDemo/test/scripts/makeall.bash
Executable file
10
Devices/Packages/sick_line_guidance/turtlebotDemo/test/scripts/makeall.bash
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
echo -e "makeall.bash: build and install ros sick_line_guidance driver and demo"
|
||||
sudo echo -e "makeall.bash started."
|
||||
# sudo apt-get install python-catkin-lint
|
||||
source /opt/ros/melodic/setup.bash
|
||||
./cleanup.bash
|
||||
./makepcan.bash
|
||||
./make.bash
|
||||
echo -e "makeall.bash finished."
|
||||
|
||||
41
Devices/Packages/sick_line_guidance/turtlebotDemo/test/scripts/makepcan.bash
Executable file
41
Devices/Packages/sick_line_guidance/turtlebotDemo/test/scripts/makepcan.bash
Executable file
@@ -0,0 +1,41 @@
|
||||
#!/bin/bash
|
||||
|
||||
# install packages required for peak can device driver
|
||||
|
||||
if [ -f ../../../../../../peak_systems/pcanview-ncurses_0.8.7-0_amd64.deb ] ; then
|
||||
pushd ../../../../../../peak_systems
|
||||
sudo apt-get install libncurses5
|
||||
sudo dpkg --install pcanview-ncurses_0.8.7-0_amd64.deb
|
||||
popd
|
||||
fi
|
||||
|
||||
# build and install peak can device driver
|
||||
|
||||
if [ -d ../../../../../../peak_systems/peak-linux-driver-8.7.0 ] ; then
|
||||
pushd ../../../../../../peak_systems/peak-linux-driver-8.7.0
|
||||
# install required packages
|
||||
sudo apt-get install can-utils
|
||||
sudo apt-get install gcc-multilib
|
||||
sudo apt-get install libelf-dev
|
||||
sudo apt-get install libpopt-dev
|
||||
sudo apt-get install tree
|
||||
# build and install pcan driver
|
||||
make clean
|
||||
make NET=NETDEV_SUPPORT
|
||||
sudo make install
|
||||
# install the modules
|
||||
sudo modprobe pcan
|
||||
sudo modprobe can
|
||||
sudo modprobe vcan
|
||||
sudo modprobe slcan
|
||||
# setup and configure "can0" net device
|
||||
sudo ip link set can0 type can
|
||||
sudo ip link set can0 up type can bitrate 125000 # configure the CAN bitrate, f.e. 125000 bit/s
|
||||
# check installation
|
||||
# ./driver/lspcan --all # should print "pcanusb32" and pcan version
|
||||
# tree /dev/pcan-usb # should show a pcan-usb device
|
||||
# ip -a link # should print some "can0: ..." messages
|
||||
ip -details link show can0 # should print some details about "can0" net device
|
||||
popd
|
||||
fi
|
||||
|
||||
18
Devices/Packages/sick_line_guidance/turtlebotDemo/test/scripts/plotsimu.bash
Executable file
18
Devices/Packages/sick_line_guidance/turtlebotDemo/test/scripts/plotsimu.bash
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
|
||||
source ./simu_env.bash
|
||||
source ../../../../../install/setup.bash
|
||||
|
||||
# rosrun rviz rviz &
|
||||
# roslaunch turtlebot3_gazebo turtlebot3_empty_world.launch &
|
||||
# rqt_plot /gazebo/model_states/pose[1]/position/x /gazebo/model_states/pose[1]/position/y & # display turtlebots (x,y) position over time
|
||||
|
||||
rostopic list
|
||||
rostopic echo /cmd_vel &
|
||||
rostopic echo /fsm &
|
||||
rostopic echo /iam_state &
|
||||
# rostopic echo /odom &
|
||||
# rostopic echo /ols &
|
||||
# rostopic echo /gazebo/model_states
|
||||
# rostopic echo /gazebo/link_states
|
||||
|
||||
142
Devices/Packages/sick_line_guidance/turtlebotDemo/test/scripts/rungeneric.bash
Executable file
142
Devices/Packages/sick_line_guidance/turtlebotDemo/test/scripts/rungeneric.bash
Executable file
@@ -0,0 +1,142 @@
|
||||
#!/bin/bash
|
||||
|
||||
#
|
||||
# set environment, clear screen and logfiles
|
||||
#
|
||||
|
||||
if [ ! -d ./log ] ; then mkdir -p ./log ; fi
|
||||
if [ ! -d ~/.ros/log ] ; then mkdir -p ~/.ros/log ; fi
|
||||
printf "\033c"
|
||||
rm -rf ./log/*
|
||||
source ./simu_env.bash
|
||||
pushd ../../../../..
|
||||
rm -rf ~/.ros/log/*
|
||||
# printf "\033c"
|
||||
source /opt/ros/melodic/setup.bash
|
||||
source ./install/setup.bash
|
||||
./src/sick_line_guidance/turtlebotDemo/test/scripts/killall.bash
|
||||
export LIBPROFILER=/usr/lib/x86_64-linux-gnu/libprofiler.so.0 # path to libprofiler.so.0 may depend on os version
|
||||
|
||||
#
|
||||
# Start fsm, driver, nodes, tools and run the sick_line_guidance_demo simulation
|
||||
#
|
||||
|
||||
# roscore &
|
||||
# sleep 10 # wait for roscore startup processes
|
||||
|
||||
if [ "$TURTLEBOT_SIMULATION" == "1" ] ; then
|
||||
|
||||
# Start gazebo / turtlebot simulator
|
||||
sleep 1 ; echo -e "#\n# runsimu.bash: starting gazebo ..."
|
||||
sleep 1 ; roslaunch turtlebot3_gazebo turtlebot3_empty_world.launch &
|
||||
sleep 10 # wait until gazebo has started ...
|
||||
# Virtual navigation:
|
||||
# roslaunch turtlebot3_gazebo turtlebot3_world.launch
|
||||
# roslaunch turtlebot3_navigation turtlebot3_navigation.launch map_file:=$HOME/map.yaml
|
||||
export SICK_LINE_GUIDANCE_DEMO_LAUNCH_ARGS='ols_simu:=1'
|
||||
|
||||
else # "$TURTLEBOT_SIMULATION" == "0"
|
||||
|
||||
if [ "$TURTLEBOT_STOP_AT_START" == "1" ] ; then # Stop turtlebot (set all velocities to 0 and restart turtlebot)
|
||||
roslaunch turtlebot3_bringup turtlebot3_robot.launch &
|
||||
sleep 15 ; rostopic pub --once /cmd_vel geometry_msgs/Twist '{linear: {x: 0.0, y: 0.0, z: 0.0}, angular: {x: 0.0, y: 0.0,z: 0.0}}' # stop the turtlebot
|
||||
sleep 1 ; rosnode kill turtlebot3_core ; sleep 1 ; rosnode kill turtlebot3_diagnostics
|
||||
fi
|
||||
|
||||
# Init turtlebot
|
||||
sleep 5 ; roslaunch turtlebot3_bringup turtlebot3_robot.launch &
|
||||
sleep 15
|
||||
|
||||
# Start OLS20 driver or simulated OLS messages
|
||||
if [ "$TURTLEBOT_OLS_SIMULATION" == "1" ] ; then # Run TurtleBot with simulated OLS messages
|
||||
export SICK_LINE_GUIDANCE_DEMO_LAUNCH_ARGS='ols_simu:=1'
|
||||
else # "$TURTLEBOT_OLS_SIMULATION" == "0" # CAN initialization and start OLS20 driver
|
||||
# Init CAN and start OLS20 driver
|
||||
sudo ip link set can0 up type can bitrate 125000 # configure can0
|
||||
ip -details link show can0 # check status can0
|
||||
# Start OLS20 driver
|
||||
sleep 5 ; roslaunch -v --screen sick_line_guidance sick_line_guidance.launch yaml:=sick_line_guidance_ols20.yaml > ~/.ros/log/sick_line_guidance_ols20.log &
|
||||
sleep 10 ; export SICK_LINE_GUIDANCE_DEMO_LAUNCH_ARGS='ols_simu:=0'
|
||||
fi # "$TURTLEBOT_OLS_SIMULATION"
|
||||
|
||||
fi # "$TURTLEBOT_SIMULATION"
|
||||
|
||||
# Start sick_line_guidance_demo simulation
|
||||
export SICK_LINE_GUIDANCE_DEMO_LAUNCH_ARGS=$SICK_LINE_GUIDANCE_DEMO_LAUNCH_ARGS' visualize:='$TURTLEBOT_VISUALIZE
|
||||
echo -e "#\n# runsimu.bash: starting simulation:\n# roslaunch sick_line_guidance_demo sick_line_guidance_demo_node.launch $SICK_LINE_GUIDANCE_DEMO_LAUNCH_ARGS \n#"
|
||||
|
||||
if [ "$TURTLEBOT_PROFILING" == "1" ] ; then # debug and profile sick_line_guidance_demo
|
||||
rm -f /tmp/sick_line_guidance_demo.prof* # remove previous profile logs
|
||||
env CPUPROFILE=/tmp/sick_line_guidance_demo.prof LD_PRELOAD=$LIBPROFILER roslaunch sick_line_guidance_demo sick_line_guidance_demo_node.launch $SICK_LINE_GUIDANCE_DEMO_LAUNCH_ARGS &
|
||||
else # run sick_line_guidance_demo
|
||||
roslaunch -v --screen sick_line_guidance sick_line_guidance_demo_node.launch $SICK_LINE_GUIDANCE_DEMO_LAUNCH_ARGS 2>&1 | tee ~/.ros/log/sick_line_guidance_demo_node.log &
|
||||
fi
|
||||
sleep 10
|
||||
|
||||
# Start sick_line_guidance watchdog run emergency exit to stop the TurtleBot after line lost for more than 1 second
|
||||
if ! [ "$TURTLEBOT_START_WATCHDOG_AFTER" == "" ] && [ $TURTLEBOT_START_WATCHDOG_AFTER -ge 0 ] ; then
|
||||
sleep $TURTLEBOT_START_WATCHDOG_AFTER # start watchdog after a simulated OLS is close enough to a line
|
||||
roslaunch -v --screen sick_line_guidance sick_line_guidance_watchdog.launch 2>&1 | tee ~/.ros/log/watchdog.log & # run watchdog
|
||||
fi
|
||||
|
||||
#
|
||||
# Run sick_line_guidance_demo for a while: just wait for key 'q' or 'Q'
|
||||
# while ros nodes sick_line_guidance_demo_node and Robot_FSM are running
|
||||
#
|
||||
|
||||
while true ; do
|
||||
echo -e "FSM and sick_line_guidance_demo simulation running. Press 'q' to exit..." ; read -t 0.1 -n1 -s key
|
||||
if [[ $key = "q" ]] || [[ $key = "Q" ]]; then break ; fi
|
||||
done
|
||||
|
||||
#
|
||||
# Stop turtlebot, fsm and sick_line_guidance_demo
|
||||
#
|
||||
|
||||
rosnode kill sick_line_guidance_demo_node
|
||||
sleep 0.5 ; rostopic pub --once /cmd_vel geometry_msgs/Twist '{linear: {x: 0.0, y: 0.0, z: 0.0}, angular: {x: 0.0, y: 0.0,z: 0.0}}' ; sleep 0.5 # stop the turtlebot
|
||||
./src/sick_line_guidance/turtlebotDemo/test/scripts/killall.bash
|
||||
|
||||
#
|
||||
# Check errors and warnings in ros logfiles
|
||||
#
|
||||
echo -e "\n#\n# sick_line_guidance_demo simulation finished.\n#\n"
|
||||
grep "\[ WARN\]" ~/.ros/log/*.log ~/.ros/log/*/ros*.log ~/.ros/log/*.log >> ~/.ros/log/ros_log_warnings.txt
|
||||
grep "\[ERROR\]" ~/.ros/log/*.log ~/.ros/log/*/ros*.log ~/.ros/log/*.log >> ~/.ros/log/ros_log_errors.txt
|
||||
echo -e "\nSimulation warnings and errors:\n"
|
||||
cat ~/.ros/log/ros_log_warnings.txt
|
||||
cat ~/.ros/log/ros_log_errors.txt
|
||||
|
||||
#
|
||||
# Profiling
|
||||
#
|
||||
if [ "$TURTLEBOT_PROFILING" == "1" ] ; then
|
||||
for proffile in /tmp/robot_fsm.prof* ; do
|
||||
google-pprof --pdf ./install/lib/iam/robot_fsm $proffile > $proffile.pdf
|
||||
done
|
||||
for proffile in /tmp/sick_line_guidance_demo.prof* ; do
|
||||
google-pprof --pdf ./install/lib/sick_line_guidance_demo/sick_line_guidance_demo_node $proffile > $proffile.pdf
|
||||
done
|
||||
fi
|
||||
|
||||
#
|
||||
# Play video recorded by sick_line_guidance_demo
|
||||
#
|
||||
popd
|
||||
cp ~/.ros/log/watchdog.log ./log
|
||||
cp ~/.ros/log/robot_fsm.log ./log
|
||||
cp ~/.ros/log/sick_line_guidance_demo_node.log ./log
|
||||
if [ "$TURTLEBOT_PROFILING" == "1" ] ; then
|
||||
cp /tmp/robot_fsm.prof*.pdf ./log
|
||||
cp /tmp/sick_line_guidance_demo.prof*.pdf ./log
|
||||
fi
|
||||
if [ -f ~/.ros/sick_line_guidance_demo.avi ] ; then
|
||||
mv ~/.ros/sick_line_guidance_demo.avi ./log/sick_line_guidance_demo.avi
|
||||
echo -e "\nCreated sick_line_guidance_demo.avi:"
|
||||
ls -al ./log/sick_line_guidance_demo.avi
|
||||
echo -e "ffplay ./sick_line_guidance_demo.avi ; # Use right mouse button to seek forward/backward, 'p' for pause/resume"
|
||||
ffplay ./log/sick_line_guidance_demo.avi
|
||||
echo -e "\n"
|
||||
fi
|
||||
ls -al ./log/*
|
||||
|
||||
10
Devices/Packages/sick_line_guidance/turtlebotDemo/test/scripts/runsimu.bash
Executable file
10
Devices/Packages/sick_line_guidance/turtlebotDemo/test/scripts/runsimu.bash
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
export TURTLEBOT_SIMULATION=1
|
||||
export TURTLEBOT_OLS_SIMULATION=1
|
||||
export TURTLEBOT_VISUALIZE=2
|
||||
export TURTLEBOT_START_WATCHDOG_AFTER=-1 # 60
|
||||
export TURTLEBOT_PROFILING=0
|
||||
export TURTLEBOT_STOP_AT_START=0
|
||||
./rungeneric.bash
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
export TURTLEBOT_SIMULATION=0
|
||||
export TURTLEBOT_OLS_SIMULATION=0
|
||||
export TURTLEBOT_VISUALIZE=0
|
||||
export TURTLEBOT_START_WATCHDOG_AFTER=0
|
||||
export TURTLEBOT_PROFILING=0
|
||||
export TURTLEBOT_STOP_AT_START=0
|
||||
./rungeneric.bash
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
export TURTLEBOT_SIMULATION=0
|
||||
export TURTLEBOT_OLS_SIMULATION=1
|
||||
export TURTLEBOT_VISUALIZE=0
|
||||
export TURTLEBOT_START_WATCHDOG_AFTER=60
|
||||
export TURTLEBOT_PROFILING=0
|
||||
export TURTLEBOT_STOP_AT_START=0
|
||||
./rungeneric.bash
|
||||
|
||||
12
Devices/Packages/sick_line_guidance/turtlebotDemo/test/scripts/simu_env.bash
Executable file
12
Devices/Packages/sick_line_guidance/turtlebotDemo/test/scripts/simu_env.bash
Executable file
@@ -0,0 +1,12 @@
|
||||
#!/bin/bash
|
||||
|
||||
#
|
||||
# set environment for sick_line_guidance_demo simulation
|
||||
#
|
||||
|
||||
export ROS_MASTER_URI=http://127.0.0.1:11311
|
||||
export ROS_HOSTNAME=127.0.0.1
|
||||
export TURTLEBOT3_MODEL=waffle
|
||||
export SVGA_VGPU10=0 # otherwise "roslaunch turtlebot3_gazebo" may fail when running in VMware
|
||||
export LIBGL_ALWAYS_SOFTWARE=1 # otherwise "roslaunch turtlebot3_gazebo" may fail when running in VMware
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
#!/bin/bash
|
||||
|
||||
#
|
||||
# stop the turtlebot
|
||||
#
|
||||
|
||||
# environment
|
||||
pushd ../../../../..
|
||||
source /opt/ros/melodic/setup.bash
|
||||
source ./install/setup.bash
|
||||
echo -e "#\n#stop turtlebot...\n#"
|
||||
|
||||
# kill all ros nodes
|
||||
rosnode kill -a
|
||||
sleep 0.3
|
||||
killall -9 robot_fsm
|
||||
|
||||
# init turtlebot and send velocity 0.0
|
||||
roslaunch turtlebot3_bringup turtlebot3_robot.launch &
|
||||
sleep 1
|
||||
for ((i=1;i<=20;i++)) ; do
|
||||
rostopic pub --once /cmd_vel geometry_msgs/Twist '{linear: {x: 0.0, y: 0.0, z: 0.0}, angular: {x: 0.0, y: 0.0,z: 0.0}}'
|
||||
sleep 0.5
|
||||
done
|
||||
|
||||
# stop turtlebot ros node
|
||||
rosnode kill -a
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
#!/bin/bash
|
||||
|
||||
#
|
||||
# simple turtlebot test, drives a figure of eight
|
||||
#
|
||||
|
||||
#
|
||||
# set environment, clear screen and logfiles
|
||||
#
|
||||
|
||||
export TURTLEBOT_SIMULATION=0 # 1
|
||||
export ROS_MASTER_URI=http://127.0.0.1:11311
|
||||
export ROS_HOSTNAME=127.0.0.1
|
||||
export TURTLEBOT3_MODEL=waffle
|
||||
export SVGA_VGPU10=0 # otherwise "roslaunch turtlebot3_gazebo" may fail when running in VMware
|
||||
export LIBGL_ALWAYS_SOFTWARE=1 # otherwise "roslaunch turtlebot3_gazebo" may fail when running in VMware
|
||||
|
||||
if [ ! -d ./log ] ; then mkdir -p ./log ; fi
|
||||
if [ ! -d ~/.ros/log ] ; then mkdir -p ~/.ros/log ; fi
|
||||
printf "\033c"
|
||||
rm -rf ./log/*
|
||||
pushd ../../../../..
|
||||
rm -rf ~/.ros/log/*
|
||||
source /opt/ros/melodic/setup.bash
|
||||
source ./install/setup.bash
|
||||
rosnode kill -a
|
||||
sleep 5
|
||||
|
||||
#
|
||||
# Start turtlebot resp. turtlebot simulation
|
||||
#
|
||||
|
||||
if [ "$TURTLEBOT_SIMULATION" == "1" ] ; then
|
||||
rosnode kill -a ; sleep 1 ; killall rqt_plot gzclient ; sleep 1 ; killall gzserver ; sleep 3
|
||||
roslaunch turtlebot3_gazebo turtlebot3_empty_world.launch 2>&1 &
|
||||
else
|
||||
roslaunch turtlebot3_bringup turtlebot3_robot.launch 2>&1 | tee ~/.ros/log/turtlebot3_bringup.log &
|
||||
# Init CAN and start OLS20 driver
|
||||
sudo ip link set can0 up type can bitrate 125000 # configure can0
|
||||
ip -details link show can0 # check status can0
|
||||
sleep 1 ; roslaunch -v --screen sick_line_guidance sick_line_guidance.launch yaml:=sick_line_guidance_ols20.yaml > ~/.ros/log/sick_line_guidance_ols20.log &
|
||||
fi
|
||||
sleep 15
|
||||
|
||||
#
|
||||
# Send some cmd_vel messages to test
|
||||
#
|
||||
|
||||
# for ((i=1;i<=20;i++)) ; do
|
||||
# rostopic pub --once /cmd_vel geometry_msgs/Twist '{linear: {x: 0.1, y: 0.0, z: 0.0}, angular: {x: 0.0, y: 0.0,z: -0.4}}' &
|
||||
# sleep 0.1
|
||||
# done
|
||||
# for ((i=1;i<=20;i++)) ; do
|
||||
# rostopic pub --once /cmd_vel geometry_msgs/Twist '{linear: {x: 0.0, y: 0.0, z: 0.0}, angular: {x: 0.0, y: 0.0,z: 0.0}}' &
|
||||
# sleep 0.1
|
||||
# done
|
||||
|
||||
|
||||
#
|
||||
# Start turtlebot_test_fsm_node
|
||||
#
|
||||
|
||||
roslaunch -v --screen sick_line_guidance_demo turtlebot_test_fsm_node.launch & # 2>&1 | tee ~/.ros/log/turtlebot_test_fsm_node.log &
|
||||
# roslaunch -v --screen sick_line_guidance_demo sick_line_guidance_demo_node.launch ols_simu:=0 visualize:=0 2>&1 | tee ~/.ros/log/sick_line_guidance_demo_node.log &
|
||||
|
||||
#
|
||||
# Run turtlebot_test_fsm_node for a while: just wait for key 'q' or 'Q'
|
||||
# while ros node turtlebot_test_fsm_node is running
|
||||
#
|
||||
|
||||
while true ; do
|
||||
echo -e "turtlebot_test_fsm_node running. Press 'q' to exit..." ; read -t 1.0 -n1 -s key
|
||||
if [[ $key = "q" ]] || [[ $key = "Q" ]]; then break ; fi
|
||||
done
|
||||
|
||||
#
|
||||
# Stop turtlebot_test_fsm_node
|
||||
#
|
||||
|
||||
rosnode kill turtlebot_test_fsm_node
|
||||
sleep 0.5 ; rostopic pub --once /cmd_vel geometry_msgs/Twist '{linear: {x: 0.0, y: 0.0, z: 0.0}, angular: {x: 0.0, y: 0.0,z: 0.0}}' ; sleep 0.5 # stop the turtlebot
|
||||
rosnode kill -a
|
||||
|
||||
popd
|
||||
cp ~/.ros/log/turtlebot_test_fsm_node.log ./log
|
||||
cp ~/.ros/log/sick_line_guidance_ols20.log ./log
|
||||
cp ~/.ros/log/turtlebot3_bringup.log ./log
|
||||
ls -al ./log/*
|
||||
|
||||
|
||||
Reference in New Issue
Block a user