API

ros_bt_py.debug_manager module

class ros_bt_py.debug_manager.DebugManager(ros_node, node_diagnostics_publish_callback=None)[source]

Bases: object

Manages the collection and publishing of the node diagnostics.

report_state(node_instance, state)[source]

Collect debug state from Node execution.

It measures the time between the beginning and the end of the setup/shutdown/reset/untick function (which includes that of any children).

Additionally, it publishes the node state and execution time to a node diagnostics topic.

Parameters:
  • instance – The node

  • state – The state of the node

report_tick(node_instance)[source]

Collect debug data during ticks from Node execution.

It measures the time between the beginning and the end of the tick function (which includes the ticks of any children) and calculates a moving window average of execution times as well as a minimum and maximum value.

Parameters:

instance – The node that’s executing

set_collect_node_diagnostics(request, response)[source]
Return type:

Response

ros_bt_py.exceptions module

exception ros_bt_py.exceptions.AssignmentException[source]

Bases: Exception

exception ros_bt_py.exceptions.BehaviorTreeException[source]

Bases: Exception

exception ros_bt_py.exceptions.MigrationException[source]

Bases: BehaviorTreeException

exception ros_bt_py.exceptions.MissingParentError[source]

Bases: BehaviorTreeException

exception ros_bt_py.exceptions.NodeConfigError[source]

Bases: BehaviorTreeException

exception ros_bt_py.exceptions.NodeStateError[source]

Bases: BehaviorTreeException

exception ros_bt_py.exceptions.TreeTopologyError[source]

Bases: BehaviorTreeException

ros_bt_py.helpers module

ros_bt_py.node module

ros_bt_py.node_config module

class ros_bt_py.node_config.NodeConfig(options, inputs, outputs, max_children, optional_options=None, version='', tags=None)[source]

Bases: object

extend(other)[source]

Extend the input, output and option dicts with values from other.

Raises:

KeyError, ValueError If any of the dicts in other contains keys that already exist, raise KeyError. If max_children has a value different from ours, raise ValueError.

class ros_bt_py.node_config.OptionRef(option_key)[source]

Bases: object

Mark an input or output type as dependent on an option value.

Can be used instead of an actual type in the maps passed to a :class:NodeConfig

ros_bt_py.node_data module

ros_bt_py.ros_helpers module

class ros_bt_py.ros_helpers.EnumValue(enum_value='')[source]

Bases: object

Data class containing an enum value.

class ros_bt_py.ros_helpers.LoggerLevel(logger_level=rclpy.logging.LoggingSeverity.INFO)[source]

Bases: object

Data class containing a logging level.

ros_bt_py.ros_helpers.get_interface_name(msg_metaclass)[source]

Extract the interface name from a ROS2 message metaclass.

Parameters:

msg_metaclass (type) – The ROS2 message metaclass.

Return type:

str

Returns:

The interface name in the format ‘package_name/message_type/message_name’.

ros_bt_py.ros_helpers.get_message_constant_fields(message_class)[source]

Return all constant fields of a message as a list.

ros_bt_py.ros_helpers.publish_message_channels(node, publisher)[source]

Return all known topic-, service-, and action-names.

ros_bt_py.tree_manager module