yaml vs xacro

asked 2014-08-25 03:53:12 -0600

alfa_80 gravatar image

updated 2014-08-25 04:40:21 -0600

I would like to have a configuration file that I can set some properties like in box use-case here. I have 3 questions regarding this:

  1. Which one better suits this purpose, using yaml or xacro?

  2. Let say I want to have one property (boxOK, only to illustrate as below) or some of them to be parsed with a delay (I mean it fires after some time, say 20ms after loading the launch file), how do I achieve this?

    <id="width" value="1"/>
    <id="length" value="3"/>
    <id="height" value="3"/>
    <id="boxOK" value="true"/>
    
    <id="width2" value="3"/>
    <id="length2" value="3"/>
    <id="height2" value="4"/>
    
    <id="width3" value="2"/>
    <id="length3" value="3"/>
    <id="height3" value="3"/>
    
  3. In any case, if I would set in either yaml or xacro, where in launch file normally I use something like below:

<param name="boxes_num" value="4" />

then, in the node I could invoke and assign like:

ros::param::get("boxes_num", boxes_num_);

My question is how would I do this using yaml or xacro.

Thanks in advance.

edit retag flag offensive close merge delete