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

how can I use two model in rviz ?

asked 2018-05-13 21:02:17 -0500

jo gravatar image

updated 2018-05-14 17:18:24 -0500

I use two laser sensor(sick_tim551 2050001) in my robot.

when I use two laser sensor in my robot it seems to work as one.

Also, In rviz, there is only one sensor model, and operate as one.

How can I use two sensor model in rviz and operate separately each sensor.

plz help. :(

oh. I'm sorry. Here is my launch file.

<group ns="lidar1">
         <param name="robot_description" command="$(find xacro)/xacro --inorder '$(find sick_tim)/urdf/example.urdf.xacro'" />
         <node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher" />
         <node name="sick_tim551_2050001" pkg="sick_tim" type="sick_tim551_2050001" respawn="false" output="screen">
         <param name="hostname" type="string" value="172.16.1.209" />
         <param name="port" type="string" value="2111" />
         <param name="timelimit" type="int" value="5" />
  </node>
</group>

<launch>

<group ns="lidar2">
         <param name="robot_description" command="$(find xacro)/xacro --inorder '$(find sick_tim)/urdf/example.urdf.xacro'" />
         <node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher" />
         <node name="sick_tim551_2050001" pkg="sick_tim" type="sick_tim551_2050001" respawn="false" output="screen">
         <param name="hostname" type="string" value="169.254.12.60" />
         <param name="port" type="string" value="2112" />
         <param name="timelimit" type="int" value="5" />
     </node>
<group>

</launch>

I seperate two sensors with group ns . Also I saw ,using rqt_graph, each sick_tim551_2050001 node share just one TF Node.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-05-14 04:44:21 -0500

updated 2018-05-14 17:32:44 -0500

We could do with a bit more information about your setup first. But here are my initial suggestions:

I suspect both of your lasers are publishing on the same topic. They will need different topics and different frame_ids to be shown separately in RVIZ. You'll also need to define a transformation between the frames of the two sensors, either using a URDF file or publishing a static transform.

Edit: the <launch> tag should be the first line in the file. Everything should be contained within that tag. But you'll need to add a parameter so each lidar has a different frame_id otherwise you're basically telling ROS the two lidars are in exactly the same space! Then you'll need to add a static transform publisher as I've said to define the distance between the two sensors.

edit flag offensive delete link more

Comments

I modifed my question !! <launch> tag is spaced top of line.

jo gravatar image jo  ( 2018-05-14 05:19:57 -0500 )edit

Thanks :) I should modify frame_id and tf !!

jo gravatar image jo  ( 2018-05-15 01:38:36 -0500 )edit

Yes, and fix the launch file so it starts with an open launch tag <launch> on the first line! Let us know how you get on.

PeteBlackerThe3rd gravatar image PeteBlackerThe3rd  ( 2018-05-15 13:51:08 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2018-05-13 21:02:17 -0500

Seen: 185 times

Last updated: May 14 '18