initial commit
This commit is contained in:
commit
e5961a913a
|
@ -0,0 +1,28 @@
|
|||
# Systemd Services
|
||||
|
||||
Services to run on startup
|
||||
|
||||
- Radio Listener to tune the cameras, restart TX2 or FCU with a flip of switch on the RC
|
||||
- ROSCORE start
|
||||
- MAVROS start
|
||||
- Camera start
|
||||
- GPU stereo vision start
|
||||
- RTSP broadcaster start
|
||||
|
||||
# Install
|
||||
|
||||
Copy all files inside directory sbin to `/usr/sbin/` then run `sudo chmod +x` for each file after coping
|
||||
|
||||
Copy all files inside directory services to /etc/systemd/system/
|
||||
|
||||
Copy `env.sh` to `/etc/ros/`then run `sudo chmod +x env.sh`
|
||||
|
||||
Enable all services
|
||||
|
||||
sudo systemctl enable --now roslaunch
|
||||
sudo systemctl enable --now ros_radio_listener
|
||||
sudo systemctl enable --now roscore
|
||||
sudo systemctl enable --now apriltag
|
||||
sudo systemctl enable --now camlaunch
|
||||
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
#!/bin/sh
|
||||
export ROS_HOSTNAME=$(hostname).local
|
||||
export ROS_MASTER_URI=http://$ROS_HOSTNAME:11311
|
||||
export SERVER_IP=192.168.195.50
|
|
@ -0,0 +1,7 @@
|
|||
#!/bin/bash
|
||||
source ~/catkin-ws/devel/setup.bash
|
||||
source /etc/ros/env.sh
|
||||
export ROS_HOME=$(echo ~spiri/.ros)
|
||||
roslaunch apriltag_ros continuous_detection_nodelet.launch __ns:=stereo &
|
||||
PID=$!
|
||||
wait "$PID"
|
|
@ -0,0 +1,7 @@
|
|||
#!/bin/bash
|
||||
source ~/catkin-ws/devel/setup.bash
|
||||
source /etc/ros/env.sh
|
||||
export ROS_HOME=$(echo ~spiri/.ros)
|
||||
roslaunch jetson_csi_cam video-daylight-nodelet-800x600.launch
|
||||
PID=$!
|
||||
wait "$PID"
|
|
@ -0,0 +1,7 @@
|
|||
#!/bin/bash
|
||||
source ~/catkin-ws/devel/setup.bash
|
||||
source /etc/ros/env.sh
|
||||
export ROS_HOME=$(echo ~spiri/.ros)
|
||||
roslaunch mavros_fly radio_listener.launch &
|
||||
PID=$!
|
||||
wait "$PID"
|
|
@ -0,0 +1,7 @@
|
|||
#!/bin/bash
|
||||
source ~/catkin-ws/devel/setup.bash
|
||||
source /etc/ros/env.sh
|
||||
export ROS_HOME=$(echo ~spiri/.ros)
|
||||
roslaunch mavros px4_spiri_avoid.launch &
|
||||
PID=$!
|
||||
wait "$PID"
|
|
@ -0,0 +1,10 @@
|
|||
[Unit]
|
||||
Requires=camlaunch.service
|
||||
PartOf=camlaunch.service
|
||||
After=NetworkManager.service time-sync.target roscore.service camlaunch.service
|
||||
[Service]
|
||||
Type=simple
|
||||
User=spiri
|
||||
ExecStart=/usr/sbin/apriltaglaunch
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -0,0 +1,10 @@
|
|||
[Unit]
|
||||
Requires=roscore.service
|
||||
PartOf=roscore.service
|
||||
After=NetworkManager.service time-sync.target roscore.service
|
||||
[Service]
|
||||
Type=simple
|
||||
User=spiri
|
||||
ExecStart=/usr/sbin/camlaunch
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -0,0 +1,10 @@
|
|||
[Unit]
|
||||
Requires=roscore.service
|
||||
PartOf=roscore.service
|
||||
After=NetworkManager.service time-sync.target roscore.service roslaunch.service
|
||||
[Service]
|
||||
Type=simple
|
||||
User=spiri
|
||||
ExecStart=/usr/sbin/ros_radio_listener
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -0,0 +1,15 @@
|
|||
[Unit]
|
||||
After=NetworkManager.service time-sync.target
|
||||
[Service]
|
||||
Type=forking
|
||||
User=spiri
|
||||
# Start roscore as a fork and then wait for the tcp port to be opened
|
||||
# —————————————————————-
|
||||
# Source all the environment variables, start roscore in a fork
|
||||
# Since the service type is forking, systemd doesn’t mark it as
|
||||
# ‘started’ until the original process exits, so we have the
|
||||
# non-forked shell wait until it can connect to the tcp opened by
|
||||
# roscore, and then exit, preventing conflicts with dependant services
|
||||
ExecStart=/bin/sh -c ". /opt/ros/melodic/setup.sh; . /etc/ros/env.sh; roscore & while ! echo exit | nc localhost 11311 > /dev/null; do sleep 1; done"
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -0,0 +1,10 @@
|
|||
[Unit]
|
||||
Requires=roscore.service
|
||||
PartOf=roscore.service
|
||||
After=NetworkManager.service time-sync.target roscore.service
|
||||
[Service]
|
||||
Type=simple
|
||||
User=spiri
|
||||
ExecStart=/usr/sbin/roslaunch
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
Loading…
Reference in New Issue