examples_rclpy_executors.custom_executor module

class examples_rclpy_executors.custom_executor.Estopper(*args: Any, **kwargs: Any)

Bases: Node

estop_callback(msg)
class examples_rclpy_executors.custom_executor.PriorityExecutor(*args: Any, **kwargs: Any)

Bases: Executor

Execute high priority callbacks in multiple threads, all others in a single thread.

This is an example of a custom exectuor in python. Executors are responsible for managing how callbacks get mapped to threads. Rclpy provides two executors: one which runs all callbacks in the main thread, and another which runs callbacks in a pool of threads. A custom executor should be written if neither are appropriate for your application.

add_high_priority_node(node)
spin_once(timeout_sec=None)

Execute a single callback, then return.

This is the only function which must be overridden by a custom executor. Its job is to start executing one callback, then return. It uses the method wait_for_ready_callbacks to get work to execute.

Parameters:

timeout_sec (float or None) – Seconds to wait. Block forever if None. Don’t wait if <= 0

examples_rclpy_executors.custom_executor.main(args=None)