Class MockPlatform
Defined in File mock_platform.hpp
Nested Relationships
Nested Types
Inheritance Relationships
Base Type
public as2::Node
Class Documentation
-
class MockPlatform : public as2::Node
Fake platform node used by
*_mock.cppsmoke 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 publiccontroller/set_control_modeservice. 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_modeafterinit_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_moderequest fired by the mock.
-
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())