services - Kraft2k/Boris GitHub Wiki

[Unit]

Description=ROS 2 Run initial service

After=network.target

[Service]

Type=simple

Environment="SHELL=/bin/bash"

Environment="PYTHONPATH=/home/orange-pi/.local/lib/python3.10/site-packages:/usr/local/lib/python3.10/dist-packages"

Environment="HOME=/home/orange-pi

Environment="DISPLAY=:0"

ExecStart=/usr/bin/bash -c 'source /opt/ros/humble/setup.bash; source /home/orange-pi/ros2_ws/install/setup.bash; ros2 run tours basic_moving_interactive'

Restart=on-failure

User=orange-pi

WorkingDirectory=/home/orange-pi

[Install]

WantedBy=multi-user.target

[Unit]

Description= Activate virtual environment with name rover

After=network.target

[Service]

Type=simple

Environment="SHELL=/bin/bash"

Environment="HOME=/home/kraftrobotics"

ExecStart=/usr/bin/bash -c 'source /home/kraftrobotics/rover/bin/activate'

Restart=on-failure

User=kraftrobotics

WorkingDirectory=/home/kraftrobotics

[Install]

WantedBy=multi-user.target