Trying to run Velodyne driver and a Rosbag record one button
I would like to run the velodyne launch file and a rosbag record from a single desktop icon. I can get either script on its own to work but not both. I need a pause of a couple seconds between when the velodyne starts and the rosbag starts to record. If call two scrips from the desktop icon it skips the velodyne and starts recording the bag. No matter which order. [
Desktop Entry]
Type=Application
Terminal=true $ true opens extra gnome-terminal
Name=TLSbagR
Icon=/home/lbackpack/catkin_ws/.launchscripts/TLSbagR.png
Exec=gnome-terminal -e "bash -c '/home/lbackpack/catkin_ws/.launchscripts/LaunchVelodyne.sh;$SHELL'"
Exec=gnome-terminal -e "bash -c '/home/lbackpack/catkin_ws/.launchscripts/TLSbagR.sh;$SHELL'"
Name[en_US]=TLSbagR
Here is the LaunchVelodyne.sh
#!/usr/bin/env bash
# Turn on Velodyne Packets
source /opt/ros/melodic/setup.bash
source /home/lbackpack/catkin_ws/devel/setup.bash
echo "Launching Velodyne, please wait!"
roslaunch velodyne_pointcloud VLP16_points.launch
And the rosbag record script
#!/usr/bin/env bash
# Launch TLS bag record
source /opt/ros/melodic/setup.bash
source /home/lbackpack/catkin_ws/devel/setup.bash
echo "Launching Rosbag Record, please wait!"
sleep 5
rosbag record --duration=30s -O /media/lbackpack/AGXSSD500/roscloud/TLS/360TLS6m.bag /velodyne_points
I have tried putting sleep between the two Exec in the desktop scripts but it still blows right by the velodyne and launched the bag record. Any suggestions?