ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Unable to launch lidar during boot

asked 2018-04-13 10:30:38 -0500

BhanuKiran.Chaluvadi gravatar image

updated 2018-04-13 10:32:29 -0500

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.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-04-15 02:13:37 -0500

BhanuKiran.Chaluvadi gravatar image

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.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2018-04-13 10:30:38 -0500

Seen: 235 times

Last updated: Apr 15 '18