#pragma once #include #include #include #include #include #include #include #include #include #include #include "logger.hpp" namespace custom { class Controller { public: Controller(); ~Controller(); bool initialize(); bool start(); bool stop(); void shutdown() { stop(); } bool isRunning() const { return running_; } // Sport bool StandUp(); bool StandDown(); bool Sit(); bool Damp(); bool RecoveryStand(); bool StopMove(); bool BalanceStand(); bool Dance1(); bool Dance2(); bool Hello(); // Obstacle bool SwitchSet(bool enable); bool SwitchGet(bool& enable); bool UseRemoteCommandFromApi(bool isRemoteCommandsFromApi); bool MoveToAbsolutePosition(float x, float y, float yaw); bool MoveToIncrementPosition(float x, float y, float yaw); // MotionSwitcher bool CheckMode(std::string& form, std::string& name); bool SelectMode(const std::string& nameOrAlias); bool ReleaseMode(); private: template bool ExecuteSportCmd(Func&& func); template bool ExecuteObstacleCmd(Func&& func); template bool ExecuteMotionSwitchCmd(Func&& func); std::unique_ptr sc_; std::unique_ptr oac_; std::unique_ptr msc_; std::atomic running_; std::atomic initialized_; }; } // namespace custom