Class SingleThreadedExecutor

Inheritance Relationships

Base Type

Class Documentation

class SingleThreadedExecutor : public rclcpp::Executor

Single-threaded executor implementation.

This is the default executor created by rclcpp::spin.

Public Functions

explicit SingleThreadedExecutor(const rclcpp::ExecutorOptions &options = rclcpp::ExecutorOptions())

Default constructor. See the default constructor for Executor.

virtual ~SingleThreadedExecutor()

Default destructor.

virtual void spin() override

Single-threaded implementation of spin.

This function will block until work comes in, execute it, and then repeat the process until canceled. It may be interrupt by a call to rclcpp::Executor::cancel() or by ctrl-c if the associated context is configured to shutdown on SIGINT.

Throws:

std::runtime_error – when spin() called while already spinning