0
$\begingroup$

Rosanswers logo

Hi,

I have an rplidar and i want to launch it during the booting. I followed a rosanswer here and was able to launch roscore during the bootup. But I am unable to launch rplidar.

/etc/systemd/system/
*********************rosCore.service************
[Unit]
Description=start roscore
After=network.target
Restart=on-abort

[Service]
ExecStart=/usr/local/bin/rosCoreService.sh

[Install]
WantedBy=default.target

**********************************************
/usr/local/bin/
*******************rosCoreService.sh **********
#!/usr/bin/env bash

bash -c "source /home/bc/.bashrc && roslaunch rplidar view_rplidar.launch"

****************************************************

I tried ./rosCoreService.sh directly and its working fine. In order to have port permissions I added KERNEL="ttyUSB0", GROUP:"bc", MODE = "0666" in /etc/udev/rules.d/50-usb-serial.rules

Since i need some port permission is "After=network.target" is correct ? or any suggestions ? I replaced "roslaunch rplidar view_rplidar.launch" with "roscore" and roscore is launching while bootup.


Originally posted by BhanuKiran.Chaluvadi on ROS Answers with karma: 241 on 2018-04-13

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Posted it here in case if some one needs it in the future.

/etc/systemd/system/
******* rosCore.service *************
Unit]
Description=start roscore
Restart=on-abort

[Service]
ExecStart=/usr/local/bin/rosCoreService.sh

[Install]
WantedBy=default.target
**********************************************
/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 rplidar_ros rplidar.launch

***************************************************

Observe that i have changed #!/usr/bin/env bash to #!/bin/bash, not sure why but i just followed few online discussions.


Originally posted by BhanuKiran.Chaluvadi with karma: 241 on 2018-04-15

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.