Skip to content

Project File Format

kaliemon edited this page Mar 8, 2011 · 11 revisions

Project File

YAML

For the project configuration file, I decided the best format to use was YAML. It's a file format designed around human-readability, and has a very simple yet robust syntax. With it, we can make project config files that are easy for both humans and computers to parse. In addition, ROS seems to be moving towards using YAML for both batch message publishing and message logging.

Example (in progress)

This example is based on the Object Seeking assignment from Brown University's CS148 (Building Intelligent Robots).

nodes:
    - rospy
    - std_msgs
    - irobot_create_2_1:
        type: rospkg
        roslaunch:
            - type: node
              name: driver.py
        out:
            - name: sensorPacket
              node: driver.py
              type: create_driver_2_1/SensorPacket
        in:
            - name: twist
              node: driver.py
              type: geometry_msgs/Twist
    - gscam:
        type: rospkg
        roslaunch:
            - type: node
              name: gscam
        out:
            - name: raw_image
              node: gscam
              type: sensor_msgs/Image
    - colorfile:
        type: file
        src: &cf_src colors.txt
    - cmvision:
        type: rospkg
        roslaunch:
            - type: node
              name: cmvision
              output: screen
        in:
            - name: image
              node: cmvision
              type: sensor_msgs/Image
              remap: /gscam/raw_image
        out:
            - name: blobs
              node: cmvision
              type: cmvision/Blobs
        params:
            - name: color_file
              type: string
              value: *cf_src
            - name: mean_shift_on
              type: bool
              value: false
    - arrecog:
        type: rospkg
        out:
            - name: tags
              node: arrecog
              type: ar_recog/Tags
    - object_seeking:
        type: rosnode
        in:
            - topic: blobs
              type: cmvision/Blobs
            - topic: sensorPacket
              type: irobot_create_2_1/SensorPacket
            - topic: tags
              type: ar_recog/Tags
        out:
            - topic: cmd_vel
              node: object_seeking
              type: geometry_msgs/Twist
        src: nodes/object_seeking.py
        params:
            - name: seekorder
              type: int[]
              value: [3, 1, 2, 1, 5]
Clone this wiki locally