BTRepeat

Inherits: BTDecorator < BTTask < BT

BT decorator that repeats its child a specified number of times.

Description

BTRepeat iterates its child task a specified number of times, as defined by times. If forever is true, the child’s execution will be repeated indefinitely.

Returns RUNNING if the child task results in RUNNING. If forever is true, BTRepeat will always return RUNNING.

Returns SUCCESS if the specified number of successful executions is reached. If abort_on_failure is false, a FAILURE status returned by the child is also considered a successful execution.

Returns FAILURE if the child task results in FAILURE when abort_on_failure is true.

Properties

bool

abort_on_failure

false

bool

forever

false

int

times

1


Property Descriptions

bool abort_on_failure = false

  • void set_abort_on_failure ( bool value )

  • bool get_abort_on_failure ( )

If false, FAILURE status returned by the child task is also considered as a successful execution.


bool forever = false

  • void set_forever ( bool value )

  • bool get_forever ( )

If true, the child’s execution will be repeated indefinitely, always returning RUNNING.


int times = 1

  • void set_times ( int value )

  • int get_times ( )

The number of times to repeat execution of the child task.