diff --git a/main.py b/main.py index 67414d6d3b478568745a87d4b62f0a4afa2bb440..0fbed9f9cf7181d219848d8b47e729ae10da210c 100644 --- a/main.py +++ b/main.py @@ -45,6 +45,22 @@ commands = { 'send-place-a-demo-objRed-blue': ('place-a/demo/move/objectRed1/blue', '1'), 'send-place-a-demo-objRed-red': ('place-a/demo/move/objectRed1/red', '1'), 'send-place-b-demo-objRed-red': ('place-b/demo/move/objectRed1/red', '1'), + + 'send-coordinator-model': ('coordinator/model', '1'), + 'send-coordinator-model-details': ('coordinator/model', 'details'), + 'send-coordinator-exit': ('coordinator/exit', '1'), + + 'send-place-a-robot-ctrl-up': ('ros-place-a/status', 'up'), + 'send-place-b-robot-ctrl-up': ('ros-place-b/status', 'up'), + 'send-place-a-rag-up': ('rag-a/status', 'up'), + 'send-place-b-rag-up': ('rag-b/status', 'up'), + 'send-dummy-up': ('random/status', 'up'), + + 'send-place-a-robot-ctrl-ready': ('ros-place-a/status', 'ready'), + 'send-place-b-robot-ctrl-ready': ('ros-place-b/status', 'ready'), + 'send-place-a-rag-ready': ('rag-a/status', 'ready'), + 'send-place-b-rag-ready': ('rag-b/status', 'ready'), + 'send-dummy-ready': ('random/status', 'ready'), } # button-id: (topic, textarea-content-id, protobuf-object) @@ -138,6 +154,25 @@ app.layout = html.Div([ html.Button('obj-Red -> Red', id='send-place-b-demo-objRed-red', style=button_style_normal), ], className="six columns"), ], className='row'), + html.Div([ # Row for commands coordinator + html.Button('Coordinator Model', id='send-coordinator-model', style=button_style_normal), + html.Button('Coordinator Model (Details)', id='send-coordinator-model-details', style=button_style_normal), + html.Button('Coordinator Exit', id='send-coordinator-exit', style=button_style_exit), + ], className='row'), + html.Div([ # Row for commands up + html.Button('Robot Control A Up', id='send-place-a-robot-ctrl-up', style=button_style_normal), + html.Button('Robot Control B Up', id='send-place-b-robot-ctrl-up', style=button_style_normal), + html.Button('RAG A Up', id='send-place-a-rag-up', style=button_style_normal), + html.Button('RAG B Up', id='send-place-b-rag-up', style=button_style_normal), + html.Button('Dummy Up', id='send-dummy-up', style=button_style_normal), + ], className='row'), + html.Div([ # Row for commands ready + html.Button('Robot Control A Ready', id='send-place-a-robot-ctrl-ready', style=button_style_normal), + html.Button('Robot Control B Ready', id='send-place-b-robot-ctrl-ready', style=button_style_normal), + html.Button('RAG A Ready', id='send-place-a-rag-ready', style=button_style_normal), + html.Button('RAG B Ready', id='send-place-b-rag-ready', style=button_style_normal), + html.Button('Dummy Ready', id='send-dummy-ready', style=button_style_normal), + ], className='row'), # dcc.Markdown("---"), html.H3("MQTT Log"), dcc.Textarea( diff --git a/utils.py b/utils.py index 49b4fe19369b7556ee9401d21eb6f3a3f4dea1ee..89fc487df674b5bd8fee48f6533546f3036b9614 100644 --- a/utils.py +++ b/utils.py @@ -46,7 +46,7 @@ def format_scene(scene: cgv_connector_pb2.Scene): def format_command(command: cgv_connector_pb2.MergedSelection): - return f"<cmd by {command.idRobot} of {command.idPick} to {command.idPlace}" + return f"<cmd by {command.idRobot} of {command.idPick} to {command.idPlace}>" def _get_reach_objects(r):