robot_upstart
can indeed be a helpful package, but due to the issues you encountered I've tended toward making my own systemd service files which gives me full control of how the services are crafted and brought up.
Anyway, to address your question:
To remove a service previously installed with robot_upstart
:
$ rosrun robot_upstart uninstall NAME_OF_SERVICE
How to modify the launch file that is tied to that service depends on whether the service was initially created with the 'symbolic' flag, in which case you can modify the launch file at the package level (i.e. in your workspace). If you didn't use the symbolic flag, then the launch file was copied when robot_upstart
created the service. This lives in /etc/ros/$ROS_DISTRO/NAME_OF_SERVICE.d/
And just for completeness sake, the service files that robot_upstart
creates live in /etc/systemd/system/multi-user.target.wants/NAME_OF_SERVICE.service
and /lib/systemd/system/NAME_OF_SERVICE.service
. The commands you can run to start/stop the service are in /usr/sbin/
with the name NAME_OF_SERVICE-{start/stop}
I'm not sure how you want to "modify the configuration of the service" but I interpret that as a combination of modifying the launch file that's brought up and the service file(s) that bring up the launch file. I've never used robot_upstart
to make modifications of the service itself, but instead have manually edited the *.service
files to do what I want, i.e. bring the service up after networking, adding delays between services, etc.
Originally posted by maxsvetlik with karma: 161 on 2021-01-20
This answer was ACCEPTED on the original site
Post score: 2
Original comments
Comment by dave on 2021-10-18:
Hi there,
You mention "adding delays between services". Do you mean by that, for example, to delay the starting of a launch file? Do you know how to do this with robot_upstart? Or does this require manual change of the *.service file?
Comment by maxsvetlik on 2021-11-01:
It may be possible to accomplish delays like that with robot_upstart
but I haven't found a way. To accomplish the delays between services / launch files, I always edited the service files directly to choreograph the execution I wanted. This is most directly accomplished with the following snippets in the .service
file.
[Service]
ExecStartPre=/bin/sleep 2
Which will sleep for 2 seconds before attempting to start the service. This can also be useful to use in conjunction with
[Unit]
Requires=ros_core.service
After=robot_base_drivers.service
for instance, which says to only start the service after robot_base_drivers
is started, and that the ros_core
service must be alive.