Class MockPlatform

Nested Relationships

Nested Types

Inheritance Relationships

Base Type

  • public as2::Node

Class Documentation

class MockPlatform : public as2::Node

Fake platform node used by *_mock.cpp smoke executables.

Serves the two services the controller manager needs at startup (list_control_modes, set_platform_control_mode) and, after a configurable delay, drives the controller into the requested control mode through the public controller/set_control_mode service. Replaces the ~150 lines of boilerplate that used to be duplicated verbatim in every plugin’s <plugin>_mock.cpp.

Public Functions

explicit MockPlatform(const std::vector<uint8_t> &available_modes, const ControlModeRequest &request, std::chrono::milliseconds init_delay = std::chrono::seconds(1), const rclcpp::NodeOptions &options = rclcpp::NodeOptions())

Construct the fake platform node and arm the synthetic mode request.

Parameters:
  • available_modes – Modes returned by list_control_modes (typically a HOVER input + an ACRO output bitmap).

  • request – Mode requested through controller/set_control_mode after init_delay.

  • init_delay – Delay before issuing the request, to give the manager time to advertise its services.

  • options – Standard NodeOptions (namespace, params, etc.).

struct ControlModeRequest

Configuration of the synthetic set_control_mode request fired by the mock.

Public Members

uint8_t control_mode = as2_msgs::msg::ControlMode::TRAJECTORY
uint8_t yaw_mode = as2_msgs::msg::ControlMode::YAW_ANGLE
uint8_t reference_frame = as2_msgs::msg::ControlMode::LOCAL_ENU_FRAME