py_trees.demos.action module

A py_trees demo.

images/action.gif
class py_trees.demos.action.Action(name: str)

Bases: Behaviour

Demonstrates the at-a-distance style action behaviour.

This behaviour connects to a separately running process (initiated in setup()) and proceeeds to work with that subprocess to initiate a task and monitor the progress of that task at each tick until completed. While the task is running the behaviour returns RUNNING.

On completion, the the behaviour returns with success or failure (depending on success or failure of the task itself).

Key point - this behaviour itself should not be doing any work!

initialise() None

Reset a counter variable.

setup(**kwargs: int) None

Kickstart the separate process this behaviour will work with.

Ordinarily this process will be already running. In this case, setup is usually just responsible for verifying it exists.

terminate(new_status: Status) None

Nothing to clean up in this example.

update() Status

Increment the counter, monitor and decide on a new status.

py_trees.demos.action.command_line_argument_parser() ArgumentParser

Process command line arguments.

Returns:

the argument parser

py_trees.demos.action.description() str

Print description and usage information about the program.

Returns:

the program description string

py_trees.demos.action.epilog() str | None

Print a noodly epilog for –help.

Returns:

the noodly message

py_trees.demos.action.main() None

Entry point for the demo script.

py_trees.demos.action.planning(pipe_connection: Connection) None

Emulate a (potentially) long running external process.

Args:

pipe_connection: connection to the planning process