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

Trying to run Velodyne driver and a Rosbag record one button

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

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]
Terminal=true $ true opens extra gnome-terminal
Exec=gnome-terminal -e "bash -c '/home/lbackpack/catkin_ws/.launchscripts/;$SHELL'"
Exec=gnome-terminal -e "bash -c '/home/lbackpack/catkin_ws/.launchscripts/;$SHELL'"

Here is the

#!/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

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

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


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

Seen: 301 times

Last updated: Mar 11 '21