ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

Trying to run Velodyne driver and a Rosbag record one button

asked 2021-03-04 21:38:22 -0500

RosLidar gravatar image

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?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-03-11 11:48:00 -0500

vinny gravatar image

If there is no particular reason to use 2 shell scripts, I would suggest adding the rosbag recording in the launch file itself. See this relevant question

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2021-03-04 21:38:22 -0500

Seen: 317 times

Last updated: Mar 11 '21