I'm trying to simulate a car-like robot with a velodyne VLP16 sensor on it. So I create a car following this tutorial https://www.generationrobots.com/blog/en/robotic-simulation-scenarios-with-gazebo-and-ros/ and it works. And I also download a velodyne simulator pkg, it also works. But when I try to put the robot and sensor together it shows this error:

Error: No link elements found in urdf file at line 179 in /build/urdfdom-ACOcA8/urdfdom-1.0.0/urdf_parser/src/model.cpp Error [parser_urdf.cc:3166] Unable to call parseURDF on robot model Error [parser.cc:406] parse as old deprecated model file failed.

and this path /build/urdfdom-ACOcA8/urdfdom-1.0.0/urdf_parser/src/model.cpp doesnt even exist. I try to check_urdf my mybot.xacro file and it shows

Error: No link elements found in urdf file at line 179 in /build/urdfdom-ACOcA8/urdfdom-1.0.0/urdf_parser/src/model.cpp

And please see my mybot.xacro and mybot.gazebo .xacro <?xml version="1.0"?> <robot name="mybot" xmlns:xacro="http://www.ros.org/wiki/xacro"> <xacro:property name="M_PI" value="3.1415926535897931"/> <xacro:property name="PI" value="3.1415926535897931"/> <xacro:macro name="VLP-16" params="*origin name:=velodyne topic:=/velodyne_points hz:=10 lasers:=16 samples:=1875 collision_range:=0.3 min_range:=0.9 max_range:=130.0 noise:=0.008 min_angle:=-${M_PI} max_angle:=${M_PI} gpu:=false">

<xacro:property name="chassisHeight" value="0.1"/> <xacro:property name="chassisLength" value="0.4"/> <xacro:property name="chassisWidth" value="0.2"/> <xacro:property name="chassisMass" value="50"/>

<xacro:property name="casterRadius" value="0.05"/> <xacro:property name="casterMass" value="5"/>

<xacro:property name="wheelWidth" value="0.05"/> <xacro:property name="wheelRadius" value="0.1"/> <xacro:property name="wheelPos" value="0.2"/> <xacro:property name="wheelMass" value="5"/>

<xacro:property name="cameraSize" value="0.05"/> <xacro:property name="cameraMass" value="0.1"/>

<xacro:include filename="$(find mybot_description)/urdf/mybot.gazebo"/> <xacro:include filename="$(find mybot_description)/urdf/materials.xacro"/> <xacro:include filename="$(find mybot_description)/urdf/macros.xacro"/>

<link name="footprint"/> <joint name="base_joint" type="fixed"> <parent link="footprint"/> <child link="chassis"/> </joint> <link name="chassis"> <collision> <origin xyz="0 0 ${wheelRadius}" rpy="0 0 0"/> <geometry> <box size="${chassisLength} ${chassisWidth} ${chassisHeight}"/> </geometry> </collision> <visual> <origin xyz="0 0 ${wheelRadius}" rpy="0 0 0"/> <geometry> <box size="${chassisLength} ${chassisWidth} ${chassisHeight}"/> </geometry> <material name="orange"/> </visual> <inertial> <origin xyz="0 0 ${wheelRadius}" rpy="0 0 0"/> <mass value="${chassisMass}"/> <box_inertia m="${chassisMass}" x="${chassisLength}" y="${chassisWidth}" z="${chassisHeight}"/> </inertial> </link> <joint name="fixed" type="fixed"> <parent link="chassis"/> <child link="caster_wheel"/> </joint> <link name="VLP-16_base_link"> <inertial> <mass value="0.83"/> <origin xyz="0 0 0.15"/> <inertia ixx="${(0.83 * (3.0*0.0516*0.0516 + 0.0717*0.0717)) / 12.0}" ixy="0" ixz="0" iyy="${(0.83 * (3.0*0.0516*0.0516 + 0.0717*0.0717)) / 12.0}" iyz="0" izz="${0.5 * 0.83 * (0.0516*0.0516)}"/> </inertial> <visual> <geometry> <mesh filename="package://mybot_description/meshes/VLP16_base_1.dae"/> </geometry> </visual> <visual> <geometry> <mesh filename="package://mybot_description/meshes/VLP16_base_2.dae"/> </geometry> </visual> <collision> <origin rpy="0 0 0" xyz="0 0 0.15"/> <geometry> <cylinder radius="0.0516" length="0.0717"/> </geometry> </collision> </link>

<joint name="sensor_chassis" type="fixed"> <parent link="chassis"/> <child link="VLP-16_base_link"/> </joint>

<link name="VLP-16"> <inertial> <mass value="0.01"/> <origin xyz="0 0 0"/> <inertia ixx="1e-7" ixy="0" ixz="0" iyy="1e-7" iyz="0" izz="1e-7"/> </inertial> <visual> <origin xyz="0 0 -0.0377"/> <geometry> <mesh filename="package://mybot_description/meshes/VLP16_scan.dae"/> </geometry> </visual> </link>

<joint name="VLP_base_scan_joint" type="fixed"> <origin xyz="0 0 0.0377" rpy="0 0 0"/> <parent link="VLP-16_base_link"/> <child link="VLP-16"/> </joint>

<link name="caster_wheel"> <collision> <origin xyz="${casterRadius-chassisLength/2} 0 ${casterRadius-chassisHeight+wheelRadius}" rpy="0 0 0"/> <geometry> <sphere radius="${casterRadius}"/> </geometry> </collision> <visual> <origin xyz="${casterRadius-chassisLength/2} 0 ${casterRadius-chassisHeight+wheelRadius}" rpy="0 0 0"/> <geometry> <sphere radius="${casterRadius}"/> </geometry> <material name="red"/> </visual> <inertial> <origin xyz="${casterRadius-chassisLength/2} 0 ${casterRadius-chassisHeight+wheelRadius}" rpy="0 0 0"/> <mass value="${casterMass}"/> <sphere_inertia m="${casterMass}" r="${casterRadius}"/> </inertial> </link>

<wheel lr="left" ty="1"/> <wheel lr="right" ty="-1"/> </xacro:macro> </robot>

.gazebo

<robot name="mybot" xmlns:xacro="http://www.ros.org/wiki/xacro"> <xacro:property name="M_PI" value="3.1415926535897931"/> <xacro:macro name="VLP-16" params="*origin name:=velodyne topic:=/velodyne_points hz:=10 lasers:=16 samples:=1875 collision_range:=0.3 min_range:=0.9 max_range:=130.0 noise:=0.008 min_angle:=-${M_PI} max_angle:=${M_PI} gpu:=false">

<gazebo reference="chassis"> <material>Gazebo/Orange</material> </gazebo>

<gazebo reference="caster_wheel"> <mu1>0.0</mu1> <mu2>0.0</mu2> <material>Gazebo/Red</material> </gazebo>

<gazebo> <plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so"> <robotnamespace>/mybot</robotnamespace> </plugin> </gazebo>

<gazebo> <plugin name="differential_drive_controller" filename="libgazebo_ros_diff_drive.so"> <alwayson>true</alwayson> <updaterate>100</updaterate> <leftjoint>left_wheel_hinge</leftjoint> <rightjoint>right_wheel_hinge</rightjoint> <wheelseparation>${chassisWidth+wheelWidth}</wheelseparation> <wheeldiameter>${2*wheelRadius}</wheeldiameter> <torque>20</torque> <commandtopic>mybot/cmd_vel</commandtopic> <odometrytopic>mybot/odom_diffdrive</odometrytopic> <odometryframe>odom</odometryframe> <robotbaseframe>footprint</robotbaseframe> </plugin> </gazebo>

<gazebo reference="VLP-16"> <xacro:if value="${gpu}"> <sensor type="gpu_ray" name="velodyne-VLP16"> <pose>0 0 0 0 0 0</pose> <visualize>false</visualize> <update_rate>${hz}</update_rate> <ray> <scan> <horizontal> <samples>${samples}</samples> <resolution>1</resolution> <min_angle>${min_angle}</min_angle> <max_angle>${max_angle}</max_angle> </horizontal> <vertical> <samples>${lasers}</samples> <resolution>1</resolution> <min_angle>-${15.0M_PI/180.0}</min_angle> <max_angle> ${15.0M_PI/180.0}</max_angle> </vertical> </scan> <range> <min>${collision_range}</min> <max>${max_range+1}</max> <resolution>0.001</resolution> </range> <noise> <type>gaussian</type> <mean>0.0</mean> <stddev>0.0</stddev> </noise> </ray> <plugin name="gazebo_ros_laser_controller" filename="libgazebo_ros_velodyne_gpu_laser.so"> <topicname>${topic}</topicname> <framename>VLP-16</framename> <min_range>${min_range}</min_range> <max_range>${max_range}</max_range> <gaussiannoise>${noise}</gaussiannoise> </plugin> </sensor> </xacro:if> <xacro:unless value="${gpu}"> <sensor type="ray" name="velodyne-VLP16"> <pose>0 0 0 0 0 0</pose> <visualize>false</visualize> <update_rate>${hz}</update_rate> <ray> <scan> <horizontal> <samples>${samples}</samples> <resolution>1</resolution> <min_angle>${min_angle}</min_angle> <max_angle>${max_angle}</max_angle> </horizontal> <vertical> <samples>${lasers}</samples> <resolution>1</resolution> <min_angle>-${15.0M_PI/180.0}</min_angle> <max_angle> ${15.0M_PI/180.0}</max_angle> </vertical> </scan> <range> <min>${collision_range}</min> <max>${max_range+1}</max> <resolution>0.001</resolution> </range> <noise> <type>gaussian</type> <mean>0.0</mean> <stddev>0.0</stddev> </noise> </ray> <plugin name="gazebo_ros_laser_controller" filename="libgazebo_ros_velodyne_laser.so"> <topicname>${topic}</topicname> <framename>VLP-16</framename> <min_range>${min_range}</min_range> <max_range>${max_range}</max_range> <gaussiannoise>${noise}</gaussiannoise> </plugin> </sensor> </xacro:unless> </gazebo>

</robot>

asked 04 Sep, 10:45

peixuan_gao%40163.com's gravatar image

peixuan_gao@...
22
accept rate: 0%

I'm sorry I don't know why after I copied my code here all the enters are gone...But I think the problem should be at the beginning of those files...

(04 Sep, 10:48) peixuan_gao@...

And my launch file <?xml version="1.0" ?> <launch> <arg name="paused" default="false"/> <arg name="use_sim_time" default="true"/> <arg name="gui" default="true"/> <arg name="headless" default="false"/> <arg name="debug" default="false"/> <arg name="verbose" default="false"/> <arg name="world_name" default="$(find velodyne_description)/world/example.world"/>

<include file="$(find gazebo_ros)/launch/empty_world.launch"> <arg name="paused" value="$(arg paused)"/> <arg name="use_sim_time" value="$(arg use_sim_time)"/> <arg name="gui" value="$(arg gui)"/> <arg name="headless" value="$(arg headless)"/> <arg name="debug" value="$(arg debug)"/> <arg name="verbose" value="$(arg verbose)"/> <arg name="world_name" value="$(arg world_name)"/> </include>

<param name="robot_description" command="$(find xacro)/xacro.py '$(find mybot_description)/urdf/mybot.xacro'"/>

<node name="mybot_spawn" pkg="gazebo_ros" type="spawn_model" output="screen" args="-urdf -param robot_description -model mybot"/>

</launch>

permanent link

answered 04 Sep, 10:49

peixuan_gao%40163.com's gravatar image

peixuan_gao@...
22
accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×3

question asked: 04 Sep, 10:45

question was seen: 85 times

last updated: 04 Sep, 10:49

powered by OSQA