SICKAG / sick_ldmrs_laser

A ROS driver for the SICK LD-MRS series of laser scanners.
BSD 3-Clause "New" or "Revised" License
24 stars 19 forks source link

connecting two ldmrs lidars #17

Closed PAWAS123 closed 4 years ago

PAWAS123 commented 4 years ago

HI, I am using SICK-LDMRS lidar and the driver sick demo node is working perfectly for 1 lidar by modifying the default ip address in the cpp file of the driver.But now i would like to connect two SICK-LDMRS lidars to visualize the data of both lidars in rviz. How can i modify the launch file to do it. Thanks in advance.

mintar commented 4 years ago

Something like this should work:

<launch>
  <!-- start first ldmrs driver -->
  <node name="sick_ldmrs_node1" pkg="sick_ldmrs_driver" type="sick_ldmrs_node" output="screen">
    <param name="frame_id" type="str" value="ldmrs1" />
    <param name="hostname" type="str" value="192.168.0.1" />
  </node>

  <!-- start second ldmrs driver -->
  <node name="sick_ldmrs_node2" pkg="sick_ldmrs_driver" type="sick_ldmrs_node" output="screen">
    <param name="frame_id" type="str" value="ldmrs2" />
    <param name="hostname" type="str" value="192.168.0.2" />
  </node>

  <!-- publish a tf transform between them. you can also use urdf/xaxro instead.

       Usage: static_transform_publisher x y z qx qy qz qw frame_id child_frame_id 
       OR 
       Usage: static_transform_publisher x y z yaw pitch roll frame_id child_frame_id 
   -->
  <node name="ldmrs1_to_ldmrs2_tf" pkg="tf2_ros" type="static_transform_publisher" output="screen"
    args="0.0 1.0 0.0 0.0 0.0 0.0 ldmrs1 ldmrs2" />
</launch>
PAWAS123 commented 4 years ago

Hi @mintar , Thanks for the reply. I tried the launch file you suggested but i could only see one rostopic /cloud and rviz shows nothing in this case. While when i run the sick_ldmrs_node.launch file individually for two lidars i can see data in rviz. Hence the problem still remains how to create a launch file which gives topics like /cloud1 and /cloud2 so that i can see lidars data simultaneously. Thanks in advance

PAWAS123 commented 4 years ago

i was able to use the suggested launch file by creating two groups ns1 and ns2 to see the cloud data individually. Thanks for your help.