libgazebo)ros_laser.so does not generate topic to publish my laser scan data
hello! I am newbie trying to learn ROS and Gazebo. I am trying to simulate iRobot create with hokuyo laser sensor. Everything is working fine except that during simulation topic to publish my laser scan data into gazebo is not generated. I reckon that the plugin does not run but I am not sure about it. I am using the xacro for laser sensor for erratic robot to simulate mine.
The attached code is
<?xml version="1.0"?>
<robot
xmlns:sensor="http://playerstage.sourceforge.net/gazebo/xmlschema/#sensor"
xmlns:controller="http://playerstage.sourceforge.net/gazebo/xmlschema/#controller"
xmlns:interface="http://playerstage.sourceforge.net/gazebo/xmlschema/#interface">
<macro name="erratic_hokuyo_laser" params="parent *origin">
<joint name="laser_base_mount_joint" type="fixed">
<insert_block name="origin" />
<parent link="${parent}"/>
<child link="laser_base_link"/>
</joint>
<link name="laser_base_link" type="fixed">
<inertial>
<mass value="0.1"/>
<origin xyz="0 0 0.0"/>
<inertia ixx="0.1" ixy="0" ixz="0" iyy="0.1" iyz="0" izz="0.1"/>
</inertial>
<visual>
<origin rpy="0 0 0" xyz="0 0 0.025"/>
<geometry>
<box size="0.05 0.05 0.05"/>
</geometry>
</visual>
<collision>
<origin rpy="0 0 0" xyz="0 0 0.025"/>
<geometry>
<box size="0.05 0.05 0.05"/>
</geometry>
</collision>
</link>
<joint name="base_scan_joint" type="fixed" >
<origin xyz="0 0 0.05" rpy="0 0 0" />
<parent link="laser_base_link" />
<child link="base_scan_link"/>
</joint>
<link name="base_scan_link" type="laser">
<inertial>
<mass value="0.1"/>
<origin xyz="0 0 0.0"/>
<inertia ixx="0.1" ixy="0" ixz="0" iyy="0.1" iyz="0" izz="0.1"/>
</inertial>
<visual>
<origin rpy="0 0 0" xyz="0 0 0.014"/>
<geometry>
<cylinder radius="0.0229" length="0.028"/>
</geometry>
</visual>
<collision>
<origin rpy="0 0 0" xyz="0 0 0.014"/>
<geometry>
<cylinder radius="0.0229" length="0.028"/>
</geometry>
</collision>
</link>
<gazebo reference="turtlebot_hardware">
<sensor:ray name="laser">
<rayCount>683</rayCount>
<rangeCount>683</rangeCount>
<laserCount>1</laserCount>
<origin>0.0 0.0 0.0</origin>
<displayRays>false</displayRays>
<minAngle>-135</minAngle>
<maxAngle> 135</maxAngle>
<minRange>0.06</minRange>
<maxRange>4.0</maxRange>
<resRange>0.001</resRange>
<updateRate>10.0</updateRate>
<controller:gazebo_ros_laser name="gazebo_ros_base_scan_link_controller" plugin="libgazebo_ros_laser.so">
<gaussianNoise>0.005</gaussianNoise>
<alwaysOn>true</alwaysOn>
<updateRate>10.0</updateRate>
<topicName>/scan</topicName>
<frameName>base_scan_link</frameName>
<interface:laser name="gazebo_ros_base_scan_link_iface"/>
</controller:gazebo_ros_laser>
</sensor:ray>
</gazebo>
<gazebo reference="laser_base_link">
<material>Erratic/Grey</material>
</gazebo>
<gazebo reference="base_scan_link">
<material>Erratic/Black</material>
</gazebo>
</macro>
</robot>
Any help will be appreciated. Regards
Asked by Mamoon on 2015-04-02 04:25:52 UTC
Comments
Can you visualize the laser in Gazebo (in the Gazebo gui, press Ctrl-T then find the laser scan topic)? Also check from the command line using
ros topic list
to see if the topic is there andros topic echo
to dump output from the topic. If those fail, check that the model is loaded properly by inspecting the model in the gazebo gui through the model tree list on the left side.Asked by nkoenig on 2015-04-02 09:12:49 UTC
I can visualize the laser on my robot but the link name is not present in model tree. There is one warning message generated on my terminal when I run the launch file " Warning [ModelDatabase.cc:205] Unable to connect to model database using [http://gazebosim.org/models//database.config]. Only locally installed models will be available " One more thing to be noticed is that I have used in my code instead of
Asked by Mamoon on 2015-04-03 08:29:37 UTC
because otherwise an error shows up "Error [parser.cc:697] XML Element[sensor:ray], child of element[link] not defined in SDF. Ignoring [link] Error [parser.cc:688] Error reading element Error [parser.cc:688] Error reading element
Error [parser.cc:348] Unable to read element
Error [parser.cc:299] parse as old deprecated model file failed. "
I referred to your answer on this link http://answers.gazebosim.org/question/4592/gazebo-plugin-for-6d-velocity-error/
Asked by Mamoon on 2015-04-03 08:32:02 UTC
@nkoenig! The problem is resolved! apparently I was using the syntax for the older version of gazebo. Thanks for your help.
Asked by Mamoon on 2015-04-04 07:08:07 UTC
Can you create an answer so that others can benefit from the solution to this question?
Asked by SL Remy on 2016-02-11 20:11:59 UTC