-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstart.sh
executable file
·44 lines (32 loc) · 1.12 KB
/
start.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
# Navigate to the ROS workspace
cd /home/dv_ws_ros1
# Install dependencies using rosdep
apt-get update
apt-get install -y python3-rosdep
rosdep init
rosdep update
rosdep install --from-paths src --ignore-src -r -y
# Install specific ROS package
apt-get install -y ros-noetic-ackermann-msgs
# Source ROS Noetic environment
source /opt/ros/noetic/setup.bash
catkin_make
cd ..
source /home/dv_ws_ros1/devel/setup.bash
# Start the ROS master in the background
roscore & # Starts roscore, the main communication hub for ROS nodes
# Allow some time for roscore to start
sleep 5
# Play rosbag in loop mode in the background
rosbag play /home/rosbag1/bag1.bag -l & # -l flag loops the playback of the bag file
# Allow some time for the rosbag to start
sleep 5
# Source the workspace again to ensure environment variables are set
source /home/dv_ws_ros1/devel/setup.bash
# Launch rviz in the background to visualize data
rviz & # Starts RViz for data visualization
# Launch the ROS node
roslaunch patchworkpp demo.launch # Replace with your specific ROS node launch command
# Wait for all background processes to finish
wait