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

RPlidar A1M8 works when connected to laptop but does not work on Rapsberry pi 3

asked 2023-05-02 13:08:04 -0500

kowais915 gravatar image

updated 2023-05-04 11:57:24 -0500

Mike Scheutzow gravatar image

Hello Everyone.

I have installed ROS noetic on both Pi 3 and my workstation. The target is to send Lidar data over to workstation where I will visualize it via Rviz.

The issue is: the lidar works fine when connected to laptop; however when I connect it to pi and run the following: roslaunch rplidar_ros rplidar.launch

Here is the rplidar.launch file:

<launch>
    <node name="rplidarNode"          pkg="rplidar_ros"  type="rplidarNode" output="screen">
    <param name="serial_port"         type="string" value="/dev/ttyUSB0"/>
    <param name="serial_baudrate"     type="int"    value="115200"/><!--A1/A2 -->
    <!--param name="serial_baudrate"     type="int"    value="256000"--><!--A3 -->
    <param name="frame_id"            type="string" value="laser"/> 
    <param name="inverted"            type="bool"   value="false"/> 
    <param name="angle_compensate"    type="bool"   value="true"/> 
    </node>
</launch>

here is the output of lsusb:

Bus 001 Device 005: ID 10c4:ea60 Silicon Labs CP210x UART Bridge
Bus 001 Device 003: ID 0424:ec00 Microchip Technology, Inc. (formerly SMSC) SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Microchip Technology, Inc. (formerly SMSC) SMC9514 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

I get this:

"[ERROR] [1683048712.103957025]: Error, operation time out. RESULT_OPERATION_TIMEOUT! [rplidarNode-1] process has died [pid 3196, exit code 255, cmd /home/ubuntu/catkin_ws/devel/lib/rplidar_ros/rplidarNode __name:=rplidarNode __log:=/home/ubuntu/.ros/log/690e8cb0-e90e-11ed-8367-b827ebea13cf/rplidarNode-1.log]. log file: /home/ubuntu/.ros/log/690e8cb0-e90e-11ed-8367-b827ebea13cf/rplidarNode-1*.log"

Sometimes I get this:

"[ERROR] [1683050360.490752221]: Error, cannot retrieve rplidar health code: 80008002 [rplidarNode-1] process has died [pid 1607, exit code 255, cmd /home/ubuntu/catkin_ws/devel/lib/rplidar_ros/rplidarNode __name:=rplidarNode __log:=/home/ubuntu/.ros/log/0aea9212-e910-11ed-a08d-69187ab6f95b/rplidarNode-1.log]. log file: /home/ubuntu/.ros/log/0aea9212-e910-11ed-a08d-69187ab6f95b/rplidarNode-1*.log "

Note: The pi and workstation are connected as I can see a list of topics on my workstation. I have sourced the environment as well.

I do not know where is the issue. I have tried my best. Please help.

edit retag flag offensive close merge delete

Comments

What serial device name is the rplidar using on your raspberry pi? Here is what mine looks like:

$ ls -ld /dev/rp* /dev/ttyUSB*
lrwxrwxrwx 1 root root         7 Apr 20 14:52 /dev/rplidar -> ttyUSB0
crw-rw---- 1 root dialout 188, 0 Apr 20 14:52 /dev/ttyUSB0
Mike Scheutzow gravatar image Mike Scheutzow  ( 2023-05-03 07:14:31 -0500 )edit

Mine is ttyUSB0 too. I have given all the rwx permissions too. I tried powering the pi using a powerbank as well but I am still getting the same error.

kowais915 gravatar image kowais915  ( 2023-05-04 06:14:10 -0500 )edit

Which machine are you running that roslaunch command on?

Mike Scheutzow gravatar image Mike Scheutzow  ( 2023-05-04 06:27:31 -0500 )edit

The lidar is connected to raspberry pi 3 Model B+ that has ROS noetic installed. I have connected to the pi via ssh from another machine that has ROS noetic running as well. I have installed Ubuntu 20.04 via WSL2.

So I am technically running the roslaunch command on PI but via SSH on another machine.

I have been searching for everything. At this point, I am so frustrated.

kowais915 gravatar image kowais915  ( 2023-05-04 06:31:49 -0500 )edit

Using ssh in that way should be fine. The error message indicates that your ros node (rplidarNode) finds some device on the serial port, but the node is either unable to read from the device, or the values do not match the rplidar model it is looking for.

Please edit your description and copy/paste the output of the lsusb command (please do not give me a screenshot.) You edit using the "edit" button near the end of the description.

Mike Scheutzow gravatar image Mike Scheutzow  ( 2023-05-04 06:51:52 -0500 )edit

Thank you so much already for help. I have added the output to the description please check.

Furthermore, I only get the first error message now: The TImeout Error.

"[ERROR] [1683048712.103957025]: Error, operation time out. RESULT_OPERATION_TIMEOUT! [rplidarNode-1] process has died [pid 3196, exit code 255, cmd /home/ubuntu/catkin_ws/devel/lib/rplidar_ros/rplidarNode __name:=rplidarNode __log:=/home/ubuntu/.ros/log/690e8cb0-e90e-11ed-8367-b827ebea13cf/rplidarNode-1.log]. log file: /home/ubuntu/.ros/log/690e8cb0-e90e-11ed-8367-b827ebea13cf/rplidarNode-1*.log"

kowais915 gravatar image kowais915  ( 2023-05-04 09:54:16 -0500 )edit

Silicon Labs CP210x UART Bridge

This is the expected usb device label for an rplidar, so this line looks good. You will get a timeout error if something else already has the /dev/ttyUSB0 device open. Could you be launching the ros node twice?

Please edit your description and show us your complete rplidar launch file. To preserve newlines, highlight all the new text and format it by clicking the 101010 button once.

Mike Scheutzow gravatar image Mike Scheutzow  ( 2023-05-04 11:04:56 -0500 )edit

In your systemd journal, do you find a line similar to this? Do a search for: ttyUSB0

Apr 20 14:52:49 batmobile kernel: usb 1-5: cp210x converter now attached to ttyUSB0
Mike Scheutzow gravatar image Mike Scheutzow  ( 2023-05-04 11:19:54 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-05-04 14:02:01 -0500

Mike Scheutzow gravatar image

updated 2023-05-04 14:04:52 -0500

Based on our discussion in the comments, it seems like your configuration was all good.

It may be that the power supply for the raspberry pi was undersized. If you find that the rplidar startup is still unreliable, you should try 1) using a powered usb hub, or 2) to plug the rplidar directly into the raspberry pi board (so it doesn't have to share power with another device.)

edit flag offensive delete link more

Question Tools

Stats

Asked: 2023-05-02 13:08:04 -0500

Seen: 348 times

Last updated: May 04 '23