ROS2 HUMBLE ROBOT UP START SERVICE PROBLEMS
Hello everyone, We are currently trying to set up an service to run ros2 nodes from a single launch file. The launch file works correctly when launching from the terminal by hand. But if we try to create a systemctl service the nodes does not launch properly. When we check the output with system service status here is the out put we got.
The output seems to be correct, but we are not able to see the topics from a new terminal. Also when we check the processes with htop we can see that the process started by the service takes a lot of cpu resources and it seems to be stuck. You can also see the htop output in the image below.
here is the repo we created for setting up the service: https://github.com/canAktas/tosbaja_bringup_service
The setup scripts are as follows.
setuptosbajastart_up.sh for setting up the service
sudo cp tosbaja_startup.service /etc/systemd/system/
sudo cp tosbaja_startup.sh /usr/local/bin/
sudo chmod 744 /usr/local/bin/tosbaja_startup.sh
sudo chmod 664 /etc/systemd/system/tosbaja_startup.service
sudo systemctl daemon-reload
sudo systemctl enable tosbaja_startup.service
tosbaja_startup.service the systemctl service file
[Unit]
After=network.target
[Service]
Type=simple
User=root
WorkingDirectory=/home/gna/ws
Environment="ROSDOMAINID=1"
Environment="LDLIBRARYPATH=/opt/ros/humble/opt/rvizogrevendor/lib:/opt/ros/humble/lib/x86_64-linux-gnu:/opt/ros/humble/lib"
Environment="PYTHONPATH=/opt/ros/humble/lib/python3.10/site-packages:/opt/ros/humble/local/lib/python3.10/dist-packages"
Environment="AMENTPREFIXPATH=/opt/ros/humble"
Environment="HOME=root"
ExecStart=/usr/bin/bash /usr/local/bin/tosbaja_startup.sh
[Install]
WantedBy=multi-user.target
tosbaja_startup.service finaly the script that is called by the systemctl service
#!/bin/bash
source /opt/ros/humble/setup.bash
source /home/gna/ws/install/setup.bash
ros2 launch start_tosbaja rsp.launch.py
Asked by kourou on 2023-06-15 14:47:53 UTC
Comments