How to stop a robot when crossing a laserscanner?

asked 2019-06-24 08:20:32 -0500

Hey i´m not very experienced in ROS an Gazebo, but i wanted to ask if somebody could maybe help me. I´m using the workspace from a gazebo tutorial in which a laserscanner can be used. You can find the workspace under this link: link text. I placed the Laserscanner in front of the RRBot and in the air. I changed the origin and set the parent link to "world" so that the laser is no longer attached to the robot. I would like to have a message or a topic, that can make the robot stop when it crosses the "light barrier" from the laserscanner. Is this possible?

<joint name="hokuyo_joint" type="fixed">
<axis xyz="0 0 0" />
<origin xyz="1.0 0 2.5" rpy="0 -300 0"/>
<parent link="world"/>
<child link="hokuyo_link"/>
</joint>

<!-- Hokuyo Laser -->
<link name="hokuyo_link">
<collision>
  <origin xyz="0 0 0" rpy="0 0 0"/>
  <geometry>
<box size="0.1 0.1 0.1"/>
  </geometry>
</collision>

<visual>
  <origin xyz="0 0 0" rpy="0 0 0"/>
  <geometry>
    <mesh filename="package://rrbot_description/meshes/hokuyo.dae"/>
  </geometry>
</visual>

<inertial>
  <mass value="1e-5" />
  <origin xyz="0 0 0" rpy="0 0 0"/>
  <inertia ixx="1e-6" ixy="0" ixz="0" iyy="1e-6" iyz="0" izz="1e-6" />
</inertial>

</link>

edit retag flag offensive close merge delete