Class MultiThreadedAgnocastExecutor

Inheritance Relationships

Base Type

Class Documentation

class MultiThreadedAgnocastExecutor : public agnocast::AgnocastExecutor

Multi-threaded executor for Stage 1 with configurable thread counts for ROS 2 and Agnocast callbacks.

Public Functions

explicit AGNOCAST_PUBLIC MultiThreadedAgnocastExecutor(const rclcpp::ExecutorOptions &options = rclcpp::ExecutorOptions(), size_t number_of_ros2_threads = 0, size_t number_of_agnocast_threads = 0, bool yield_before_execute = false, std::chrono::nanoseconds ros2_next_exec_timeout = std::chrono::nanoseconds(-1), int agnocast_next_exec_timeout_ms = 50)

Construct the executor.

Parameters:
  • options – Executor options.

  • number_of_ros2_threads – Number of threads for ROS 2 callbacks (0 = auto).

  • number_of_agnocast_threads – Number of threads for Agnocast callbacks (0 = auto).

  • yield_before_execute – If true, call std::this_thread::yield() before each callback execution to reduce CPU usage at the cost of latency.

  • ros2_next_exec_timeout – Timeout for ROS 2 executables.

  • agnocast_next_exec_timeout_ms – Timeout in ms for Agnocast executables.

virtual AGNOCAST_PUBLIC void spin () override

Block the calling thread and process callbacks in a loop until rclcpp::shutdown() is called or the executor is cancelled.