How to connect two rplidars on one computer
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>
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.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
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.