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

jade xacro macro param line breaks 'string index out of range'

asked 2015-10-22 10:05:05 -0500

lucasw gravatar image

updated 2020-11-21 11:33:49 -0500

I have been running a xacro fine in indigo and hydro but now in jade I get a string index out of range error (I also had to add the --inorder flag) from having line breaks before or after macro params:

<?xml version="1.0"?>
<robot xmlns:xacro="http://www.ros.org/wiki/xacro" name="robot">

  <xacro:macro name="all_cameras" params="
    test
    ">
  </xacro:macro>

  <xacro:all_cameras test="0.5" />

</robot>

Corrected to the following then it works in jade:

<?xml version="1.0"?>
<robot xmlns:xacro="http://www.ros.org/wiki/xacro" name="robot">

  <xacro:macro name="all_cameras" params="test">
  </xacro:macro>

  <xacro:all_cameras test="0.5" />

</robot>
edit retag flag offensive close merge delete

Comments

1

can you upload /home/lucasw/catkin_ws/src/robot_description/urdf/no_cable.xacro somewhere (or, some other minimalist example which shows similar behavior) so that we can try to replicate the failure? Thanks!

Morgan gravatar image Morgan  ( 2015-10-22 11:02:28 -0500 )edit

I've narrowed it down to a jade-specific inability to handle macro param line breaks, see the updated question.

lucasw gravatar image lucasw  ( 2015-10-23 13:41:15 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-10-23 13:55:06 -0500

lucasw gravatar image

The current answer is to eliminate all line breaks around macro params as shown in the question.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2015-10-22 10:05:05 -0500

Seen: 254 times

Last updated: Oct 23 '15