Onboard-SDK-ROS icon indicating copy to clipboard operation
Onboard-SDK-ROS copied to clipboard

[HELP] How to start "roslaunch dji_sdk sdk.launch" after boot in Manifold2G

Open diogon01 opened this issue 5 years ago • 4 comments

Dear friends, I would like to know how to initialize the "roslaunch dji_sdk sdk.launch" after Manifold2G Boot. I tried to create the linux services with the sh file but apparently something went wrong.

I make the service file: /etc/systemd/system/vant3d.service and write:

[Unit]
Description=start roscore
After=remote-fs.target
After=syslog.target
[Service]
ExecStart=/usr/local/bin/rosCoreService.sh
Restart=on-abort

[Install]
WantedBy=multi-user.target

This my bash file /usr/local/bin/rosCoreService.sh:

#!/bin/bash
source /home/bc/.bashrc
source /opt/ros/kinetic/setup.bash
source /home/bc/catkin_ws/devel/setup.bash
roslaunch multitower_rplidar rplidar.launch

Finally i'm add permission to execute my bash file and reload services:

sudo chmod +x  /usr/local/bin/rosCoreService.sh
sudo systemctl daemon-reload
sudo systemctl enable vant3d.service
sudo systemctl start vant3d.service

error

diogon01 avatar Sep 23 '20 19:09 diogon01

I'd suggest using the robot_upstart package. http://wiki.ros.org/robot_upstart

mhoejgaard avatar Sep 24 '20 06:09 mhoejgaard

I'd suggest using the robot_upstart package. http://wiki.ros.org/robot_upstart Dear @mhoejgaard, I read the documentation before your answer and it was not clear how to use the robot_upstart package, Could you explain how to use it?

diogon01 avatar Sep 24 '20 12:09 diogon01

I haven't used the package for a while but I believe this should work: $ rosrun robot_upstart install PATH_TO_LAUNCHFILE/file.launch

It's borrowed from the documentation: http://docs.ros.org/jade/api/robot_upstart/html/

mhoejgaard avatar Sep 25 '20 12:09 mhoejgaard

I recommend this solution: https://blog.roverrobotics.com/how-to-run-ros-on-startup-bootup/

deadman2000 avatar Oct 17 '20 08:10 deadman2000