py_trees.demos.lifecycle module

A py_trees demo.

. argparse::
module:

py_trees.demos.lifecycle

func:

command_line_argument_parser

prog:

py-trees-demo-behaviour-lifecycle

images/lifecycle.gif
class py_trees.demos.lifecycle.Counter(name: str = 'Counter')

Bases: Behaviour

Simple counting behaviour.

  • Increments a counter from zero at each tick

  • Finishes with success if the counter reaches three

  • Resets the counter in the initialise() method.

initialise() None

Reset a counter variable.

setup(**kwargs: int) None

No delayed initialisation required for this example.

terminate(new_status: Status) None

Nothing to clean up in this example.

update() Status

Increment the counter and decide on a new status.

py_trees.demos.lifecycle.command_line_argument_parser() ArgumentParser

Process command line arguments.

Returns:

the argument parser

py_trees.demos.lifecycle.description() str

Print description and usage information about the program.

Returns:

the program description string

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

Print a noodly epilog for –help.

Returns:

the noodly message

py_trees.demos.lifecycle.main() None

Entry point for the demo script.