Demo task clientο
Submit JSON task sequences to the teaching orchestrator.
src.demos.hello_orchestrator_py.scripts.orchestrator_client Β· Source
Examples and demos Β· Guide Β· Symbol index
How it is usedο
Use main() to read a demo JSON file and submit it through OrchestratorClient.send_task(). The client targets orchestrator_task_py, logs feedback, and waits for the final result. Its server and result waits have no deadlines.
Demo documents use type, message, and target_pose fields. They are separate from production EROBS documents, which use task_type.
Start hereο
Callable |
Purpose |
|---|---|
Initialize the client, read sys.argv[1] as task JSON, submit and clean up before returning an exit code. |
|
JSON-serialize the supplied mapping, wait for the demo orchestrator, submit it and spin through acceptance and completion. |
Exampleο
A logging-only demo document:
{
"tasks": [
{"type": "print", "message": "Demo started"}
]
}
This is input for the demo client, not the production /beambot_execution endpoint.
Functionsο
main()ο
Initialize the client, read sys.argv[1] as task JSON, submit and clean up before returning an exit code.
Entry point Β· Source
main(args=None)
Parameter |
Meaning |
|---|---|
|
Optional ROS initialization arguments; task path is still taken directly from global sys.argv. |
Returns: 0 for successful task; 1 for missing CLI path, missing/invalid JSON or unsuccessful task.
Errors: Catches FileNotFoundError/JSONDecodeError only. Permission, type, interrupt and execution errors may propagate without cleanup because there is no encompassing finally.
Side effects: Reads JSON, starts ROS and submits robot-capable demo tasks; ordinary paths destroy node and shut down ROS.
OrchestratorClientο
Serialize a demo task mapping, submit one OrchestratorTask goal, and wait synchronously for completion.
Inherits from: Node.
OrchestratorClient.send_task()ο
JSON-serialize the supplied mapping, wait for the demo orchestrator, submit it and spin through acceptance and completion.
Method Β· Source
send_task(self, task_dict)
Parameter |
Meaning |
|---|---|
|
JSON-serializable mapping with a tasks collection; len(task_dict[βtasksβ]) is logged. |
Returns: False on rejected goal, otherwise result.success; ROS wrapper status is not independently checked.
Errors: No timeouts or exception catches. Missing tasks, serialization, future and None-result errors propagate.
Side effects: Submits demo tasks that can print or move the robot; processes callbacks and logs.
OrchestratorClient.__init__()ο
Create orchestrator_client with an OrchestratorTask client targeting orchestrator_task_py.
Lifecycle Β· Source
__init__(self)
Errors: ROS setup errors propagate.
Side effects: Creates node/action client.
Referenced in source (1)
mainβ src.demos.hello_orchestrator_py.scripts.orchestrator_client
Internal callbacks and helpersο
OrchestratorClient.feedback_callback()ο
Log the one-based current step, total step count and current action string.
Callback Β· Source
feedback_callback(self, feedback_msg)
Parameter |
Meaning |
|---|---|
|
OrchestratorTask feedback wrapper. |
Returns: None.
Errors: Malformed feedback errors propagate.
Side effects: Writes an INFO log.
Referenced in source (1)
OrchestratorClient.send_taskβ src.demos.hello_orchestrator_py.scripts.orchestrator_client