#ifndef LOW_CONTROLLER_HPP #define LOW_CONTROLLER_HPP #include #include #include #include #define TOPIC_LOWCMD "rt/lowcmd" #define UT_CPU_ID_NONE -1 constexpr double PosStopF = (2.146E+9f); constexpr double VelStopF = (16000.0f); namespace custom { class LowController { public: LowController(); ~LowController(); bool initialize(); bool start(); bool stop(); void shutdown() { stop(); } bool isRunning() const { return running_; } void requestAutoCharge(bool enable); void powerOff(); private: void publishLoop(); void initLowCmd(); static uint32_t crc32_core(uint32_t* ptr, uint32_t len); unitree::robot::ChannelPublisherPtr lowcmd_publisher_; unitree_go::msg::dds_::LowCmd_ low_cmd_{}; unitree::common::ThreadPtr publish_thread_; std::atomic running_{false}; }; } // namespace custom #endif // LOW_CONTROLLER_HPP