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

Launch file doesn't work after xacro update

asked 2015-04-15 05:09:21 -0500

DanielEckert gravatar image

Hello there,

After updating to version 1.9.4 of the ros-indigo-xacro package, one of my launch files doesn't work anymore, and I can't figure out why. The error mesages I get are the following:

Traceback (most recent call last):
  File "/opt/ros/indigo/share/xacro/xacro.py", line 60, in <module>
    xacro.main()
  File "/opt/ros/indigo/lib/python2.7/dist-packages/xacro/__init__.py", line 706, in main
    open_output(output_filename).write(doc.toprettyxml(indent='  '))
UnicodeEncodeError: 'ascii' codec can't encode character u'\xb7' in position 1960: ordinal not in range(128)
while processing /home/daniel/catkin_ws/src/rotors_simulator/rotors_gazebo/launch/spawn_mav.launch:
Invalid <param> tag: Cannot load command parameter [robot_description]: command [     /opt/ros/indigo/share/xacro/xacro.py '/home/daniel/catkin_ws/src/rotors_simulator/rotors_description/urdf/firefly_base.xacro'     enable_logging:=false     enable_ground_truth:=true     log_file:=firefly     mav_name:=firefly] returned with code [1]. 

Param xml is <param command="     $(find xacro)/xacro.py '$(arg model)'     enable_logging:=$(arg enable_logging)     enable_ground_truth:=$(arg enable_ground_truth)     log_file:=$(arg log_file)     mav_name:=$(arg mav_name)" name="robot_description"/>
The traceback for the exception was written to the log file

The launch file is this:

<?xml version="1.0" ?>

<launch>
  <arg name="mav_name" />
  <arg name="model" default="$(find rotors_description)/urdf/$(arg mav_name)_base.xacro"/>
  <arg name="tf_prefix" default="$(optenv ROS_NAMESPACE)"/>
  <arg name="x" default="0.0"/>
  <arg name="y" default="0.0"/>
  <arg name="z" default="0.1"/>
  <arg name="enable_logging" default="false"/>
  <arg name="enable_ground_truth" default="true"/>
  <arg name="log_file" default="$(arg mav_name)"/>

  <!-- send the robot XML to param server -->
  <param name="robot_description" command="
    $(find xacro)/xacro.py '$(arg model)'
    enable_logging:=$(arg enable_logging)
    enable_ground_truth:=$(arg enable_ground_truth)
    log_file:=$(arg log_file)
    mav_name:=$(arg mav_name)"
  />
  <param name="tf_prefix" type="string" value="$(arg tf_prefix)" />

  <!-- push robot_description to factory and spawn robot in gazebo -->
  <node name="spawn_$(arg mav_name)" pkg="gazebo_ros" type="spawn_model"
   args="-param robot_description
         -urdf
         -x $(arg x)
         -y $(arg y)
         -z $(arg z)
         -model $(arg mav_name)"
   respawn="false" output="screen">
  </node>
</launch>

Any help would be greatly appreciated!

Cheers, Daniel

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2015-04-21 15:27:18 -0500

SaiHV gravatar image

Hi Daniel, I don't know if you've already solved this issue, but this is being caused by some comments in the xacro files which have the middle dot. A solution has been posted in the github issues section of rotors_simulator.

https://github.com/PX4/rotors_simulat...

edit flag offensive delete link more

Comments

So it was middle dot after all.

gvdhoorn gravatar image gvdhoorn  ( 2015-04-22 04:07:14 -0500 )edit

Thanks, that could have been it. I just updated the repository I was working with a few days later, and reinstalled, and then things worked. Not sure what the actual issue was.

DanielEckert gravatar image DanielEckert  ( 2015-04-22 06:51:16 -0500 )edit

I had exactly the same problem as asked by Daniel for exactly the same launch file (after xarco update). I went down upto firefly.urdf.xacro and removed all middle dots from kg.m and kg.m^2 by an asterisks and then it worked. Note that all those middle dots were inside commented parts of the xml.

aamir gravatar image aamir  ( 2015-06-02 06:30:12 -0500 )edit
0

answered 2015-04-15 05:50:36 -0500

gvdhoorn gravatar image

I'd say the error is not 'caused' by the launch file, but by xacro exiting with a non-zero status:

command .. returned with code [1].

Try to see whether a standalone invocation of xacro errors out as well. If that is the case and it used to work earlier (which I gather it did), then this is either a regression in xacro (which has seen quite some development over the past few weeks) or something that was always wrong with your urdf but was never properly detected and / or reported. In either case I'd report it at xacro/issues (and link back to your post on this site).

PS: ordinal \x7b in unicode is "MIDDLE DOT" (from here). Does your xacro contain text copied from source documents that may be in unicode? Middle dot can be awfully difficult to discern from a normal dot, depending on the font used.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2015-04-15 05:09:21 -0500

Seen: 2,839 times

Last updated: Apr 21 '15