Gazebo | Ignition | Community
Ask Your Question
0

Hokuyo Senser not working

asked 2017-10-11 17:25:02 -0500

Ash_100 gravatar image

updated 2017-10-12 09:19:29 -0500

Hi,

I am using ROS kinetic and Gazebo 7.8.1 I want to connect Hokuyo sensor to Turtlebot. I can see a box representing Hokuyo sensor on the Turtlebot but the sensor is not scanning the world.

Here is my specification

**kobuki_hexagons_kinect_hokuyo.urdf.xacro file**

<?xml version="1.0"?>
  <robot name="turtlebot" xmlns:xacro="http://ros.org/wiki/xacro">

  <xacro:include filename="$(find turtlebot_description)/urdf/turtlebot_common_library.urdf.xacro" />

      <xacro:include filename="$(find kobuki_description)/urdf/kobuki.urdf.xacro" />
      <xacro:include filename="$(find turtlebot_description)/urdf/stacks/hexagons.urdf.xacro"/>
      <xacro:include filename="$(find turtlebot_description)/urdf/sensors/hokuyo.urdf.xacro"/>

      <kobuki/>
      <stack_hexagons parent="base_link"/>
      <sensor_hokuyo  parent="base_link"/>
    </robot>

  **hokuyo.urdf.xacro file**

<?xml version="1.0"?>
<robot name="sensor_hokuyo" xmlns:xacro="http://ros.org/wiki/xacro">
  <xacro:include filename="$(find turtlebot_description)/urdf/turtlebot_gazebo_brass.urdf.xacro"/>
  <xacro:include filename="$(find turtlebot_description)/urdf/turtlebot_properties.urdf.xacro"/>

          <xacro:macro name="sensor_hokuyo" params="parent">
            <joint name="laser" type="fixed">
              <origin xyz="0.15 0.0 0.360" rpy="3.14159 0.0 0.0" />
              <parent link="${parent}" />
              <child link="base_laser_link" />
            </joint>

            <link name="base_laser_link">
              <visual> 
                  <geometry> 
                      <box size="0.05 0.05 0.05"/> 
                  </geometry> 
                  <material name="Green"/> 
              </visual>

              <inertial>
                <mass value="0.000001" />
                <origin xyz="0 0 0" rpy="0 0 0"/>
                <inertia ixx="0.0001" ixy="0.0" ixz="0.0"
                  iyy="0.0001" iyz="0.0"
                  izz="0.0001" />
              </inertial>
            </link>

            <!-- Set up laser gazebo details -->
            <hokuyo_laser />
      </xacro:macro>
    </robot>


 **turtlebot_gazebo_brass.urdf.xacro file**

<xacro:macro name="hokuyo_laser">
    <gazebo reference="base_laser_link">
      <sensor type="ray" name="laser">
        <pose>0 0 0 0 0 0</pose>
        <visualize>false</visualize>
        <update_rate>40</update_rate>
        <ray>
          <scan>
            <horizontal>
              <samples>720</samples>
              <resolution>1</resolution>
              <min_angle>-1.570796</min_angle>
              <max_angle>1.570796</max_angle>
            </horizontal>
          </scan>
          <range>
            <min>0.10</min>
            <max>30.0</max>
            <resolution>0.01</resolution>
          </range>
          <noise>
            <type>Gaussian</type>
            <mean>0.0</mean>
            <stddev>0.01</stddev>
          </noise>
        </ray>
        <plugin name="hokuyo_node" filename="libgazebo_ros_laser.so">
            <topicName>/hokuyo_laser</topicName>
          <frameName>base_laser_link</frameName>
        </plugin>
      </sensor>
    </gazebo>
  </xacro:macro>
</robot>
edit retag flag offensive close merge delete

Comments

Do you use the standard description package of the Turtlebot?

wentz gravatar imagewentz ( 2017-10-13 08:02:00 -0500 )edit

Please say more about what do you mean from the standard description of the Turtlebot. I am using the launch files provided with turtlebot_gazebo package (obviously with some modifications to add hokuyo sensor).

Ash_100 gravatar imageAsh_100 ( 2017-10-13 08:35:16 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2017-10-13 03:50:22 -0500

Hi. Have you tried in terminal "rostopic list" to see if /hokuyo_laser is present?

edit flag offensive delete link more

Comments

Yes, /hokuyo_laser is present. However, Gazebo crashes when I select the topic on RViZ.

Ash_100 gravatar imageAsh_100 ( 2017-10-16 08:39:41 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2017-10-11 17:25:02 -0500

Seen: 1,447 times

Last updated: Oct 12 '17