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

errors running robot_state_publisher

asked 2023-02-28 22:20:41 -0600

bribri123 gravatar image

updated 2023-02-28 22:24:50 -0600

When I run ros2 run robot_state_publisher robot_state_publisher neato.urdf.xacro I get these errors

[WARN] [1677644097.206220187] [robot_state_publisher]: No robot_description parameter, but command-line argument available.  Assuming argument is name of URDF file.  This backwards compatibility fallback will be removed in the future.
Parsing robot urdf xml string.
Error:   Unable to parse component [${bodyRadius/2}] to a double (while parsing a vector value)
         at line 102 in /tmp/binarydeb/ros-foxy-urdfdom-2.3.3/urdf_parser/src/pose.cpp
Error:   Could not parse visual element for Link [body]
         at line 495 in /tmp/binarydeb/ros-foxy-urdfdom-2.3.3/urdf_parser/src/link.cpp
Error:   length [${laserHeight}] is not a valid float
         at line 183 in /tmp/binarydeb/ros-foxy-urdfdom-2.3.3/urdf_parser/src/link.cpp
Error:   Could not parse visual element for Link [sensor_laser]
         at line 495 in /tmp/binarydeb/ros-foxy-urdfdom-2.3.3/urdf_parser/src/link.cpp
Error:   Unable to parse component [${bodyHeight/2}] to a double (while parsing a vector value)
         at line 102 in /tmp/binarydeb/ros-foxy-urdfdom-2.3.3/urdf_parser/src/pose.cpp
Error:   Malformed parent origin element for joint [body_joint]
         at line 473 in /tmp/binarydeb/ros-foxy-urdfdom-2.3.3/urdf_parser/src/joint.cpp
Error:   joint xml is not initialized correctly
         at line 206 in /tmp/binarydeb/ros-foxy-urdfdom-2.3.3/urdf_parser/src/model.cpp
terminate called after throwing an instance of 'std::runtime_error'
  what():  Unable to initialize urdf::model from robot description

URDF:

<?xml version="1.0" encoding="UTF-8"?>
<robot xmlns:xacro="http://ros.org/wiki/xacro" name="neato">
   <!-- bodyRadius: half of body width -->
   <!-- bodyHeight: body height from base to top, excluding casters and wheels -->
   <!-- laserRadius: radius of outermost laser body -->
   <!-- laserHeight: distance from of top of body to top of laser body -->
   <!-- laserRearOffset: distance from rear of body to rear of laser -->
   <!-- groundClearance: body to ground at rest -->
   <!-- wheelTrack: distance between wheel centerline -->
   <!-- wheelZOffset: distance from bottom of body to center of wheel at rest -->
   <xacro:property name="bodyRadius" value="0.165" />
   <xacro:property name="bodyRadius2" value="0.0825" />
   <xacro:property name="bodyHeight" value="0.074" />
   <xacro:property name="laserRadius" value="0.048" />
   <xacro:property name="laserHeight" value="0.016" />
   <xacro:property name="laserRearOffset" value="0.024" />
   <xacro:property name="groundClearance" value="0.0095" />
   <xacro:property name="wheelRadius" value="${0.075/2}" />
   <xacro:property name="wheelWidth" value="0.015" />
   <xacro:property name="wheelTrack" value="0.238" />
   <xacro:property name="wheelZOffset" value="${wheelRadius-groundClearance}" />
   <material name="black">
      <color rgba="0 0 0 1" />
   </material>
   <material name="grey">
      <color rgba=".5 .5 .5 1" />
   </material>
   <link name="base_link" />
   <link name="body">
      <visual>
         <!--actual: <origin xyz="0 .060 0" rpy="0 0 0" /> -->
         <origin xyz="0 ${bodyRadius/2} 0" rpy="0 0 0" />
         <geometry>
            <!--actual: <box size="0.330 0.135 0.074"/> -->
            <box size="${bodyRadius*2} ${bodyRadius} ${bodyHeight}" />
         </geometry>
         <material ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2023-03-01 05:51:09 -0600

Ranjit Kathiriya gravatar image

Hello there,

This is not a urdf file you need to first convert your xacro file to urdf file

xacro model.xacro > model.urdf

You can check urdf file via below command.

check_urdf _path_to_urdf_file_
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2023-02-28 22:20:41 -0600

Seen: 334 times

Last updated: Mar 01