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

Revision history [back]

click to hide/show revision 1
initial version

Hello @NEET,

My XML File: colors.yaml

  color_0: "1 1 1 1.0"
  color_1: "0 0 0 1.0"
  color_2: "0.84 0 0 1.0"
  color_3: "0.55 0.24 1 1.0"
  color_4: "0.01 0.53 0 1.0"

For accessing Yaml file data,

<xacro:property name="properties" value="${load_yaml(package + '/<path>/colors.yaml')}"/>
<xacro:property name="color_0" value="${properties['color_0']}"/>

I hope It will work, If you having any issues feel free to drop a comment.

Hello @NEET,

My XML File: colors.yaml

  color_0: "1 1 1 1.0"
  color_1: "0 0 0 1.0"
  color_2: "0.84 0 0 1.0"
  color_3: "0.55 0.24 1 1.0"
  color_4: "0.01 0.53 0 1.0"

For accessing Yaml file data,

<xacro:property name="properties" value="${load_yaml(package + '/<path>/colors.yaml')}"/>
<xacro:property name="color_0" value="${properties['color_0']}"/>

I hope It will work, If you having any issues feel free to drop a comment. comment.

Hello @NEET,

My XML File: colors.yaml

  color_0: "1 1 1 1.0"
  color_1: "0 0 0 1.0"
  color_2: "0.84 0 0 1.0"
  color_3: "0.55 0.24 1 1.0"
  color_4: "0.01 0.53 0 1.0"

For accessing Yaml file data,

<xacro:property name="properties" value="${load_yaml(package + '/<path>/colors.yaml')}"/>
<xacro:property name="color_0" value="${properties['color_0']}"/>

OR You can also load Yaml file like this way,

<xacro:property name="properties" value="${load_yaml($(find package)/filename.yaml)}"/>

I hope It will work, If you having any issues feel free to drop a comment.