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

To show a .urdf in gazebo gui [closed]

asked 2019-03-20 00:40:07 -0500

arifle gravatar image

updated 2019-03-20 02:30:04 -0500

gvdhoorn gravatar image

Hello,

I am trying to build my own robot to make work in gazebo. The model is a .urdf file in which I put a few .xacro files with <xacro:include> tag and the model works, I think, quite well. The model can be shown in rviz, but it failed in Gazebo.

In the launch file, I use the following line to load the model

<param name="robot_description" command="cat '$(find omniprobe_description)/urdf/omniprobe_test.urdf'" />

The error:

Error:   No link elements found in urdf file
         at line 180 in /build/buildd/urdfdom-0.2.10+dfsg/urdf_parser/src/model.cpp
Error [parser_urdf.cc:2608] Unable to call parseURDF on robot model
Error [parser.cc:299] parse as old deprecated model file failed.
Error [World.cc:1527] Unable to read sdf string[<!-- Omniprobe project, Version 1.0. --><!-- URDF model --><robot xmlns:xacro="http://ros.org/wiki/xacro" name="robot"><!-- The materials --><xacro:include filename="$(find omniprobe_description)/urdf/materials.xacro" /><!-- Math & physic items --><xacro:include filename="$(find omniprobe_description)/urdf/chassis.xacro" /><!--  Components  --><!-- Base link (chassis) --><xacro:chassis chas_name="base" /><!-- Motors --><xacro:motor cha_name="base" mot_name="Fwd" mot_pos="0" reflect="1" mot_sig="1" mot_no="0" /><xacro:motor cha_name="base" mot_name="left" mot_pos="1" reflect="-1" mot_sig="-1" mot_no="1" /><xacro:motor cha_name="base" mot_name="right" mot_pos="1" reflect="-1" mot_sig="1" mot_no="2" /><!-- Wheel-coupling --><xacro:wcoupling cha_name="base" mot_name="Fwd" wcopl_name="fwcopl" /><xacro:wcoupling cha_name="base" mot_name="left" wcopl_name="lwcopl" /><xacro:wcoupling cha_name="base" mot_name="right" wcopl_name="rwcopl" /><!-- Wheels --><xacro:twheel cha_name="base" mot_name="Fwd" wcopl_name="fwcopl" twhl_name="F" /><xacro:twheel cha_name="base" mot_name="left" wcopl_name="lwcopl" twhl_name="L" /><xacro:twheel cha_name="base" mot_name="right" wcopl_name="rwcopl" twhl_name="R" /><origin xyz="0 0 0" rpy="0 -0 0" /></robot>]
edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by tfoote
close date 2022-10-12 04:48:58.776920

Comments

You say it failed in gazebo. Can you elaborate a little more about exactly what did or didn't happen. You will need to use a spawner to create the model in gazeob, setting the robot_description alone isn't enough.

PeteBlackerThe3rd gravatar image PeteBlackerThe3rd  ( 2019-03-20 08:00:43 -0500 )edit

@PeteBlackerThe3rd Thanks, Pete. I have modified it to add some physic description in the .urdf file, and use .xacro to replace .urdf when using it in gazebo.

arifle gravatar image arifle  ( 2019-03-20 22:10:30 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-05-10 10:13:44 -0500

Have you tried the following set of XML commands:

<!--  Set robot_description on the Parameter Server -->
    <param name="robot_description" textfile="$(find omniprobe_description)/urdf/omniprobe_test.urdf" />

<!-- Spawn the bot in Gazebo -->
    <node name="spawn_urdf" pkg="gazebo_ros" type="spawn_model" output="screen"
 args="-param robot_description -urdf -model your_robot_name" />
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2019-03-20 00:40:07 -0500

Seen: 532 times

Last updated: May 10 '21