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.
The work order descriptions are currently stored as JSON files. eg pick_and_place.json. This makes it easy to
catthe contents when populating theExecuteWorkOrderrequest 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.yamlAnd rely on CLI tool like
yqto send the work order after parsing the yaml into a dict/jsonros2 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 actiongets support for--yaml-filesimilar to what was implemented forros2 topic, we could directly callBut here the
work_order_idfield would also need to be included in the YAML file.