Skip to content

Switch to YAML for work order files #86

@Yadunund

Description

@Yadunund

The work order descriptions are currently stored as JSON files. eg pick_and_place.json. This makes it easy to cat the contents when populating the ExecuteWorkOrder request from CLI. Once the request is sent to the system orchestrator, it ends up parsing the string into a YAML::Node.

To benefit from the various advantages of the YAML format, we could consider saving these descriptions as YAML files directly. For example, we can have pick_and_place.yaml

workInstructionName: Pick and Place
item:
  SkuId: productA
  description: productA
  unit: dummy_unit
  quantity: 1.0
  quantityPerPallet: 1.0
steps:
  - processId: place_on_conveyor
    name: Pick and Place
  - processId: pick_from_conveyor
    name: Pick and Place

And rely on CLI tool like yq to send the work order after parsing the yaml into a dict/json

ros2 action send_goal /system_orchestrator/execute_order nexus_orchestrator_msgs/action/ExecuteWorkOrder "{order: {work_order_id: '23', work_order: '$(yq -j "." config/pick_and_place.yaml)'}}"

If ros2 action gets support for --yaml-file similar to what was implemented for ros2 topic, we could directly call

ros2 action send_goal /system_orchestrator/execute_order nexus_orchestrator_msgs/action/ExecuteWorkOrder --yaml-file pick_and_place.yaml

But here the work_order_id field would also need to be included in the YAML file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions