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

Xacro unless property check -> error

asked 2015-06-29 14:16:52 -0500

thailor3 gravatar image

Running this file with roslaunch command, and passing the cam_serial and cam_index. But I'm getting error: Invalid roslaunch XML syntax: unbound prefix: line 3, column 0 The traceback for the exception was written to the log file

What is wrong?

<?xml version="1.0"?>
<launch>
   <xacro:property name="cam_serial" value="$(arg cam_serial)"/>
   <xacro:unless value="<21665943>">
   <
   <!-- Essential camera parameters -->
   <arg name="cam_serial"/>
   <arg name="cam_index"/>

   <!-- AOI Settings -->
   <arg name="aoi_width"  default="960" />
   <arg name="aoi_height" default="540" />
   <arg name="aoi_pos_x"  default="480" />
   <arg name="aoi_pos_y"  default="270" />

   <!-- Color calibration -->
   <arg name="red_gain" default="1.0" />
   <arg name="green_gain" default="1.09375" />
   <arg name="blue_gain" default="2.21075" />

   <!-- Additional parameters -->
   <arg name="auto_white_balance" default="false" />
   <arg name="bandwidth_limit" default="8000000" />
   <arg name="zoom" default="1" />
   <arg name="reverse_x"  default="false" />
   <arg name="reverse_y"  default="false" />

   <group ns="image$(arg cam_index)">
       <node name="cam$(arg cam_index)" pkg="basler" type="camera" respawn="true" respawn_delay="10"           output="screen">

          <!-- Some default parameters that probably don't need to be changed -->
          <param name="auto_exposure" value="false"/>
          <param name="auto_gain" value="false"/>
          <param name="gain" value="1.0"/>
          <param name="cam_serial" value="$(arg cam_serial)" unless="true"/>
          <param name="hardware_gamma" value="true" />
          <param name="frame_rate" value="1.0"/>
          <param name="exposure_time" value="25000.0"/>

          <!-- These parameters will probably be changed-->
          <param name="aoi_width"  value="$(arg aoi_width)" />
          <param name="aoi_height" value="$(arg aoi_height)" />
          <param name="aoi_pos_x"  value="$(arg aoi_pos_x)" />
          <param name="aoi_pos_y"  value="$(arg aoi_pos_y)" />
          <param name="zoom"       value="$(arg zoom)" />
          <param name="reverse_x" value="$(arg reverse_x)"/>
          <param name="reverse_y" value="$(arg reverse_y)"/>
          <param name="red_gain" value="$(arg red_gain)" />
          <param name="green_gain" value="$(arg green_gain)" />
          <param name="blue_gain" value="$(arg blue_gain)" />
          <param name="auto_white_balance" value="$(arg auto_white_balance)" /> 

          <!-- Remap trigger service and output topic -->
          <remap from="image_raw" to="raw"/>
          <remap from="trigger_camera" to="trigger_camera"/>
       </node>
    </group>
    >
 </xacro:unless>
 </launch>
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-06-29 15:47:38 -0500

gvdhoorn gravatar image

updated 2015-06-29 15:48:01 -0500

<?xml version="1.0"?>
<launch>
   <xacro:property name="cam_serial" value="$(arg cam_serial)"/>
   <xacro:unless value="<21665943>">
   <
   [..]
   \>
</xacro:unless>
</launch>

Why is that extra pair of <> there? The <... some xml code here ...> on the wiki/xacro - Conditional Blocks is meant as an example. You are expected to replace all of it, including the <>.

Same goes for the contents of your value attribute on the xacro:unless element.

Also: the expression inside a unless or if should evaluate to a boolean (so true or false). Now 21665943 will probably evaluate to true, but I'm not sure that is what you are after. I would expect to find something like value="something == something".

edit flag offensive delete link more

Comments

basically I'm trying to say that if the value passed to the cam_serial argument by the user is "21665943" then do not launch...so how should i change my launch file?

thailor3 gravatar image thailor3  ( 2015-06-29 16:07:00 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2015-06-29 14:16:52 -0500

Seen: 1,513 times

Last updated: Jun 29 '15