Work in progress: this documentation is still being written and reviewed. Check details against the source code.

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

main

Initialize the client, read sys.argv[1] as task JSON, submit and clean up before returning an exit code.

OrchestratorClient.send_task

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

args

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

task_dict

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

feedback_msg

OrchestratorTask feedback wrapper.

Returns: None.

Errors: Malformed feedback errors propagate.

Side effects: Writes an INFO log.

Referenced in source (1)