diff --git a/nexus_demos/README.md b/nexus_demos/README.md index 32e6c343..8f2739b2 100644 --- a/nexus_demos/README.md +++ b/nexus_demos/README.md @@ -54,12 +54,12 @@ ros2 launch nexus_demos workcell.launch.py workcell_id:=workcell_2 ros_domain_id `place_on_conveyor` work order: ```bash -ros2 action send_goal /system_orchestrator/execute_order nexus_orchestrator_msgs/action/ExecuteWorkOrder "{order: {work_order_id: '23', work_order: '$(cat config/place_on_conveyor.json)'}}" +ros2 action send_goal /system_orchestrator/execute_order nexus_orchestrator_msgs/action/ExecuteWorkOrder "{order: {work_order_id: '23', work_order: '$(cat config/place_on_conveyor.yaml)'}}" ``` `pick_from_conveyor` work order: ```bash -ros2 action send_goal /system_orchestrator/execute_order nexus_orchestrator_msgs/action/ExecuteWorkOrder "{order: {work_order_id: '24', work_order: '$(cat config/pick_from_conveyor.json)'}}" +ros2 action send_goal /system_orchestrator/execute_order nexus_orchestrator_msgs/action/ExecuteWorkOrder "{order: {work_order_id: '24', work_order: '$(cat config/pick_from_conveyor.yaml)'}}" ``` ## Debugging diff --git a/nexus_demos/config/pick_and_place.json b/nexus_demos/config/pick_and_place.json deleted file mode 100644 index c00fccf1..00000000 --- a/nexus_demos/config/pick_and_place.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "workInstructionName": "Pick and Place", - "steps": [ - { - "processId": "place_on_conveyor", - "outputItems": [ - { - "guid": "productA", - "metadata": { - "quantity": 1, - "state": "state_1" - } - } - ] - }, - { - "processId": "pick_from_conveyor", - "inputItems": [ - { - "guid": "productA", - "metadata": { - "quantity": 1, - "state": "state_1" - } - } - ] - } - ] -} diff --git a/nexus_demos/config/pick_and_place.yaml b/nexus_demos/config/pick_and_place.yaml new file mode 100644 index 00000000..52123ec1 --- /dev/null +++ b/nexus_demos/config/pick_and_place.yaml @@ -0,0 +1,14 @@ +workInstructionName: "Pick and Place" +steps: + - processId: "place_on_conveyor" + outputItems: + - guid: "productA" + metadata: + quantity: 1 + state: "state_1" + - processId: "pick_from_conveyor" + inputItems: + - guid: "productA" + metadata: + quantity: 1 + state: "state_1" diff --git a/nexus_demos/config/pick_from_conveyor.json b/nexus_demos/config/pick_from_conveyor.json deleted file mode 100644 index 81f912cf..00000000 --- a/nexus_demos/config/pick_from_conveyor.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "workInstructionName": "Pick from conveyor", - "steps": [ - { - "processId": "pick_from_conveyor", - "inputItems": [ - { - "guid": "productA", - "metadata": { - "quantity": 1, - "state": "state_1" - } - } - ] - } - ] -} diff --git a/nexus_demos/config/pick_from_conveyor.yaml b/nexus_demos/config/pick_from_conveyor.yaml new file mode 100644 index 00000000..75d8ca4e --- /dev/null +++ b/nexus_demos/config/pick_from_conveyor.yaml @@ -0,0 +1,8 @@ +workInstructionName: "Pick from conveyor" +steps: + - processId: "pick_from_conveyor" + inputItems: + - guid: "productA" + metadata: + quantity: 1 + state: "state_1" diff --git a/nexus_demos/config/place_on_conveyor.json b/nexus_demos/config/place_on_conveyor.json deleted file mode 100644 index 2fed6635..00000000 --- a/nexus_demos/config/place_on_conveyor.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "workInstructionName": "Place on conveyor", - "steps": [ - { - "processId": "place_on_conveyor", - "outputItems": [ - { - "guid": "productA", - "metadata": { - "quantity": 1, - "state": "state_1" - } - } - ] - } - ] -} diff --git a/nexus_demos/config/place_on_conveyor.yaml b/nexus_demos/config/place_on_conveyor.yaml new file mode 100644 index 00000000..6c7ad116 --- /dev/null +++ b/nexus_demos/config/place_on_conveyor.yaml @@ -0,0 +1,8 @@ +workInstructionName: "Place on conveyor" +steps: + - processId: "place_on_conveyor" + outputItems: + - guid: "productA" + metadata: + quantity: 1 + state: "state_1" diff --git a/nexus_demos/package.xml b/nexus_demos/package.xml index 885aa85a..4bfbc4fc 100644 --- a/nexus_demos/package.xml +++ b/nexus_demos/package.xml @@ -66,6 +66,7 @@ ament_cmake_catch2 ament_index_cpp rcpputils + python3-yaml ament_cmake diff --git a/nexus_demos/test_invalid_place_on_conveyor.py b/nexus_demos/test_invalid_place_on_conveyor.py index 0391e149..957e8c5a 100644 --- a/nexus_demos/test_invalid_place_on_conveyor.py +++ b/nexus_demos/test_invalid_place_on_conveyor.py @@ -68,7 +68,7 @@ async def test_abort_invalid_place_on_conveyor_wo(self): self.action_client.wait_for_server() goal_msg = ExecuteWorkOrder.Goal() goal_msg.order.work_order_id = "1" - with open(f"{os.path.dirname(__file__)}/config/place_on_conveyor.json") as f: + with open(f"{os.path.dirname(__file__)}/config/place_on_conveyor.yaml") as f: goal_msg.order.work_order = f.read() feedbacks: list[ExecuteWorkOrder.Feedback] = [] fb_fut = Future() diff --git a/nexus_demos/test_parallel_duplicated_wo.py b/nexus_demos/test_parallel_duplicated_wo.py index 8b3198fc..c85c5478 100644 --- a/nexus_demos/test_parallel_duplicated_wo.py +++ b/nexus_demos/test_parallel_duplicated_wo.py @@ -66,7 +66,7 @@ async def test_reject_jobs_over_max(self): """ goal_msg = ExecuteWorkOrder.Goal() goal_msg.order.work_order_id = "1" - with open(f"{os.path.dirname(__file__)}/config/pick_and_place.json") as f: + with open(f"{os.path.dirname(__file__)}/config/pick_and_place.yaml") as f: goal_msg.order.work_order = f.read() goal_handle = cast( ClientGoalHandle, await self.action_client.send_goal_async(goal_msg) @@ -75,7 +75,7 @@ async def test_reject_jobs_over_max(self): goal_msg_2 = ExecuteWorkOrder.Goal() goal_msg_2.order.work_order_id = "2" - with open(f"{os.path.dirname(__file__)}/config/pick_and_place.json") as f: + with open(f"{os.path.dirname(__file__)}/config/pick_and_place.yaml") as f: goal_msg_2.order.work_order = f.read() goal_handle_2 = cast( ClientGoalHandle, await self.action_client.send_goal_async(goal_msg_2) diff --git a/nexus_demos/test_parallel_pick_and_place_rmf.py.disabled b/nexus_demos/test_parallel_pick_and_place_rmf.py.disabled index 018f0761..dcd0d1bd 100644 --- a/nexus_demos/test_parallel_pick_and_place_rmf.py.disabled +++ b/nexus_demos/test_parallel_pick_and_place_rmf.py.disabled @@ -78,7 +78,7 @@ class ParallelPickAndPlaceRmfTest(NexusTestCase): self.action_client.wait_for_server() goal_msg = ExecuteWorkOrder.Goal() - with open(f"{os.path.dirname(__file__)}/config/pick_and_place.json") as f: + with open(f"{os.path.dirname(__file__)}/config/pick_and_place.yaml") as f: goal_msg.order.work_order = f.read() # First goal diff --git a/nexus_demos/test_parallel_wo.py b/nexus_demos/test_parallel_wo.py index 265c4cfc..6a7ec98b 100644 --- a/nexus_demos/test_parallel_wo.py +++ b/nexus_demos/test_parallel_wo.py @@ -66,7 +66,7 @@ async def test_reject_jobs_over_max(self): """ goal_msg = ExecuteWorkOrder.Goal() goal_msg.order.work_order_id = "1" - with open(f"{os.path.dirname(__file__)}/config/place_on_conveyor.json") as f: + with open(f"{os.path.dirname(__file__)}/config/place_on_conveyor.yaml") as f: goal_msg.order.work_order = f.read() goal_handle = cast( ClientGoalHandle, await self.action_client.send_goal_async(goal_msg) @@ -75,7 +75,7 @@ async def test_reject_jobs_over_max(self): goal_msg_2 = ExecuteWorkOrder.Goal() goal_msg_2.order.work_order_id = "2" - with open(f"{os.path.dirname(__file__)}/config/pick_from_conveyor.json") as f: + with open(f"{os.path.dirname(__file__)}/config/pick_from_conveyor.yaml") as f: goal_msg_2.order.work_order = f.read() goal_handle_2 = cast( ClientGoalHandle, await self.action_client.send_goal_async(goal_msg_2) diff --git a/nexus_demos/test_pick_and_place.py b/nexus_demos/test_pick_and_place.py index e138c939..5d34c6a6 100644 --- a/nexus_demos/test_pick_and_place.py +++ b/nexus_demos/test_pick_and_place.py @@ -68,7 +68,7 @@ async def test_pick_and_place_wo(self): self.action_client.wait_for_server() goal_msg = ExecuteWorkOrder.Goal() goal_msg.order.work_order_id = "1" - with open(f"{os.path.dirname(__file__)}/config/place_on_conveyor.json") as f: + with open(f"{os.path.dirname(__file__)}/config/place_on_conveyor.yaml") as f: goal_msg.order.work_order = f.read() feedbacks: list[ExecuteWorkOrder.Feedback] = [] fb_fut = Future() diff --git a/nexus_demos/test_pick_and_place_rmf.py b/nexus_demos/test_pick_and_place_rmf.py index 403983ff..89ab385a 100644 --- a/nexus_demos/test_pick_and_place_rmf.py +++ b/nexus_demos/test_pick_and_place_rmf.py @@ -75,7 +75,7 @@ async def test_pick_and_place_wo_with_rmf(self): self.action_client.wait_for_server() goal_msg = ExecuteWorkOrder.Goal() goal_msg.order.work_order_id = "1" - with open(f"{os.path.dirname(__file__)}/config/pick_and_place.json") as f: + with open(f"{os.path.dirname(__file__)}/config/pick_and_place.yaml") as f: goal_msg.order.work_order = f.read() feedbacks: list[ExecuteWorkOrder.Feedback] = [] fb_fut = Future()