-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
191 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
# Determine the directory where the script is located | ||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" | ||
|
||
# Source ROS 2 setup | ||
source /opt/ros/humble/setup.bash | ||
|
||
# Export ROS environment variables | ||
export ROS_DOMAIN_ID=0 | ||
export ROS_LOCALHOST_ONLY=0 | ||
|
||
# Execute the Python script, using the script's directory to find it | ||
exec python3 "$SCRIPT_DIR/record_data.py" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,149 @@ | ||
[Unit] | ||
Description=launch recording of data | ||
After=network.target | ||
|
||
[Service] | ||
ExecStart= python3 /home/vortex/rose_test_ws/src/vortex-asv/mission/blackbox/record_data.py | ||
RemainAfterExit=yes | ||
WorkingDirectory=/home/vortex/rose_test_ws | ||
StandardOutput=journal+console | ||
|
||
|
||
Environment="HOME=root" | ||
Environment="ROS_DOMAIN_ID=1" | ||
Environment="ROS_LOCALHOST_ONLY=1" | ||
Environment="_colcon_cd_root=/top/ros/rolling/" | ||
|
||
User=vortex | ||
|
||
Restart=no | ||
RestartSec=2 | ||
|
||
[Install] | ||
WantedBy=multi-user.target | ||
|
||
-------------------------------------------------------------------------------------------- | ||
|
||
[Unit] | ||
Description=launch recording of data | ||
After=network.target | ||
|
||
[Service] | ||
ExecStart=/usr/bin/python3 /home/vortex/rose_test_ws/src/vortex-asv/mission/blackbox/record_data.py | ||
RemainAfterExit=yes | ||
WorkingDirectory=/home/vortex/rose_test_ws | ||
StandardOutput=journal+console | ||
|
||
|
||
Environment="HOME=root" | ||
Environment="ROS_DOMAIN_ID=1" | ||
Environment="ROS_LOCALHOST_ONLY=1" | ||
Environment="_colcon_cd_root=/top/ros/rolling/" | ||
|
||
User=vortex | ||
|
||
Restart=no | ||
RestartSec=2 | ||
|
||
[Install] | ||
WantedBy=multi-user.target | ||
|
||
--------------------------------------------------------------------------------------------- | ||
|
||
[Unit] | ||
Description=launch recording of data | ||
After=network.target | ||
|
||
[Service] | ||
ExecStart=/bin/bash -c 'source /opt/ros/humble/setup.bash; source /home/vortex/david_test_ws/install/setup.bash; python3 record_data.py' | ||
RemainAfterExit=yes | ||
WorkingDirectory=/home/vortex/rose_test_ws | ||
StandardOutput=journal+console | ||
|
||
|
||
Environment="HOME=root" | ||
Environment="ROS_DOMAIN_ID=1" | ||
Environment="ROS_LOCALHOST_ONLY=1" | ||
Environment="_colcon_cd_root=/top/ros/rolling/" | ||
|
||
User=vortex | ||
|
||
Restart=no | ||
RestartSec=2 | ||
|
||
[Install] | ||
WantedBy=multi-user.target | ||
|
||
--------------------------------------------------------------------------------------------- | ||
|
||
[Unit] | ||
Description=launch ros2 bms node | ||
After=network.target | ||
|
||
[Service] | ||
ExecStart=/bin/bash -c 'source /opt/ros/humble/setup.bash; source /usr/share/colcon_argcomplete/hook/colcon-argcomplete.bash; source /usr/share/colcon_cd/function/colcon_cd.sh colcon build; source /home/vortex/david_test_ws/install/setup.bash; ros2 launch bms bms_launch.py; sleep 60' | ||
RemainAfterExit=yes | ||
WorkingDirectory=/home/vortex/david_test_ws | ||
StandardOutput=journal+console | ||
|
||
|
||
Environment="HOME=root" | ||
Environment="ROS_DOMAIN_ID=1" | ||
Environment="ROS_LOCALHOST_ONLY=1" | ||
Environment="_colcon_cd_root=/top/ros/rolling/" | ||
|
||
User=vortex | ||
|
||
Restart=no | ||
RestartSec=2 | ||
|
||
[Install] | ||
WantedBy=multi-user.target | ||
--------------------------------------------------------------------------------------------- | ||
|
||
[Unit] | ||
Description=My Custom Service | ||
After=network.target | ||
|
||
[Service] | ||
ExecStart=/path/to/your/executable | ||
Restart=always | ||
|
||
[Install] | ||
WantedBy=default.target | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
------------------------------------------------------- | ||
|
||
[Unit] | ||
Description=launch recording of data | ||
After=network.target | ||
|
||
[Service] | ||
ExecStart=/bin/bash -c 'source /opt/ros/humble/setup.bash; source /home/vortex/rose_test_ws/install/setup.bash; python3 /home/vortex/rose_test_ws/src/vortex-asv/mission/blackbox/record_data.py' | ||
RemainAfterExit=yes | ||
WorkingDirectory=/home/vortex/rose_test_ws | ||
StandardOutput=journal+console | ||
|
||
|
||
Environment="HOME=root" | ||
Environment="ROS_DOMAIN_ID=1" | ||
Environment="ROS_LOCALHOST_ONLY=1" | ||
Environment="_colcon_cd_root=/top/ros/rolling/" | ||
|
||
User=vortex | ||
|
||
Restart=no | ||
RestartSec=2 | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[Unit] | ||
Description=Launch recording of ROS 2 data | ||
After=network.target | ||
|
||
[Service] | ||
# Use the wrapper script for ExecStart | ||
ExecStart=/bin/bash <path-to-home-directory>/<your-worskpace-name>/src/vortex-asv/mission/blackbox/blackbox.sh | ||
WorkingDirectory=/home/vortex/ | ||
StandardOutput=journal+console | ||
User=vortex | ||
Restart=no | ||
RestartSec=2 | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters