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

How to connect two rplidars on one computer

asked 2015-04-16 04:58:34 -0500

gogoo gravatar image

updated 2015-04-17 02:50:02 -0500

Hello,

I'm trying to connect two rplidars on one computer. Always starts only one node and the other ends error below:

started core service [/rosout]

process[rp/rplidarNode-2]: started with pid [23750]

RPLidar health status : 0

process[rp1/rplidarNode1-3]: started with pid [23772]

Error, cannot retrieve rplidar health code: 80008002

Thank you for your answers

my launch file:

<launch>
 <node ns="rp" 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"/>
  <param name="frame_id"            type="string" value="laser"/>
  <param name="inverted"            type="bool"   value="false"/>
  <param name="angle_compensate"    type="bool"   value="true"/>
  </node>

  <node ns="rp1" name="rplidarNode1"          pkg="rplidar_ros"  type="rplidarNode" output="screen">
  <param name="serial_port"         type="string" value="/dev/ttyUSB0"/>  
  <param name="serial_baudrate"     type="int"    value="115200"/>
  <param name="frame_id"            type="string" value="laser1"/>
  <param name="inverted"            type="bool"   value="false"/>
  <param name="angle_compensate"    type="bool"   value="true"/>
  <remap from="scan"    to="scan1"/>
  </node>
</launch>
edit retag flag offensive close merge delete

Comments

Do you connect right serial_port for the second rplidar? I think "health code: 80008002" means you try to launch one rplidar twice. type /dev/ttyUSB* in terminal, and find out serial port of both of rplidar scanners.

wmars gravatar image wmars  ( 2015-04-16 12:55:48 -0500 )edit

When I tried to change the parameter "serial_port" to value = "/ dev / ttyUSB1" or value = "/ dev / ttyUSB*" system prints Error, cannot bind to the specified serial port /dev/ttyUSB1

gogoo gravatar image gogoo  ( 2015-04-17 02:56:31 -0500 )edit

sorry, I mean type ls /dev/ttyUSB* in terminal, you will get serial port. use these serial ports to set parameter in launch file. I just have one RPLidar, so I can't test. cybory-x1 's answer looks more professional.

wmars gravatar image wmars  ( 2015-04-17 08:36:52 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-04-17 04:31:35 -0500

updated 2015-04-17 04:31:52 -0500

The one unfortunate thing on the RPLidar is that the serial number of the shipped serial adapter is not really a serial number i guess. But if you know in which order you plugged your serial interfaces, it should work. I have only one here so I can not really test.

To find the right serial port, plug in your first rplidar.

type "dmesg" into console and it should give you something like this:

[10481.535436] usb 1-1.2: new full-speed USB device number 7 using ehci-pci
[10481.630018] usb 1-1.2: New USB device found, idVendor=10c4, idProduct=ea60
[10481.630028] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[10481.630034] usb 1-1.2: Product: CP2102 USB to UART Bridge Controller
[10481.630039] usb 1-1.2: Manufacturer: Silicon Labs
[10481.630043] usb 1-1.2: SerialNumber: 0001
[10481.672731] usbcore: registered new interface driver usbserial
[10481.672763] usbcore: registered new interface driver usbserial_generic
[10481.672785] usbserial: USB Serial support registered for generic
[10481.677505] usbcore: registered new interface driver cp210x
[10481.677520] usbserial: USB Serial support registered for cp210x
[10481.677545] cp210x 1-1.2:1.0: cp210x converter detected
[10481.747400] usb 1-1.2: reset full-speed USB device number 7 using ehci-pci
[10481.840989] usb 1-1.2: cp210x converter now attached to ttyUSB0

Then do the same with the second one and do the steps again.

Unfortunately this is not really a good solution, because you would always have to do this. A final solution would be to get other serial adapters might be found here, so that you are able to change the device descriptors, especially the serial number...which requires a Windows PC/VM:

http://www.silabs.com/Support%20Docum...

When you have a serial number you could do something like this for FTDI devices http://hintshop.ludvig.co.nz/show/per...

Or you could use another serial adapter, but I guess it might be a little bit complicated, creating your own board ... A FT2232 for example, would provide 4 serial interfaces at once.

The error: Error, cannot bind to the specified serial port /dev/ttyUSB1 mostly happens when the interface is not available or already opened.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2015-04-16 04:46:08 -0500

Seen: 2,799 times

Last updated: Apr 17 '15