|
@@ -0,0 +1,81 @@
|
|
|
+#ifndef DATA_INTERFACE_HPP__
|
|
|
+#define DATA_INTERFACE_HPP__
|
|
|
+
|
|
|
+#include "common.h"
|
|
|
+#include "data_struct.hpp"
|
|
|
+
|
|
|
+namespace saturn_ros2 {
|
|
|
+namespace data_interface {
|
|
|
+
|
|
|
+// 状态获取接口
|
|
|
+class StatusInterface {
|
|
|
+public:
|
|
|
+ virtual ~StatusInterface() = default;
|
|
|
+ virtual bool
|
|
|
+ getCommonStatus(robot_control::common::ROBOT_COMMON_STATUS *status) = 0;
|
|
|
+ virtual bool getJointsStatus(
|
|
|
+ robot_control::common::ROBOT_JOINTS_STATUS *joints_status) = 0;
|
|
|
+};
|
|
|
+
|
|
|
+// IMU数据接口
|
|
|
+class ImuInterface {
|
|
|
+public:
|
|
|
+ virtual ~ImuInterface() = default;
|
|
|
+ virtual bool
|
|
|
+ getImuData(robot_control::common::MC_MOTION_IMU_DATA *imu_data) = 0;
|
|
|
+};
|
|
|
+
|
|
|
+// 运动控制接口
|
|
|
+class MotionControlInterface {
|
|
|
+public:
|
|
|
+ virtual ~MotionControlInterface() = default;
|
|
|
+ virtual bool
|
|
|
+ setDirectionMovement(robot_control::common::CONTROL_SOURCE_MODE mode,
|
|
|
+ const robot_control::common::ROBOT_TWIST &twist,
|
|
|
+ long heartbeat) = 0;
|
|
|
+ virtual bool setScene(robot_control::common::CONTROL_SOURCE_MODE mode,
|
|
|
+ robot_control::common::SCENE_TYPE scene) = 0;
|
|
|
+};
|
|
|
+
|
|
|
+// 守护模式接口
|
|
|
+class GuardianInterface {
|
|
|
+public:
|
|
|
+ virtual ~GuardianInterface() = default;
|
|
|
+ virtual bool setGuardian(robot_control::common::CONTROL_SOURCE_MODE mode,
|
|
|
+ float velocity_decay_ratio,
|
|
|
+ const std::string &trigger_source) = 0;
|
|
|
+};
|
|
|
+
|
|
|
+// 充电控制接口
|
|
|
+class ChargeControlInterface {
|
|
|
+public:
|
|
|
+ virtual ~ChargeControlInterface() = default;
|
|
|
+ virtual bool
|
|
|
+ enterOrExitCharge(robot_control::common::CONTROL_SOURCE_MODE mode,
|
|
|
+ bool is_on_dock) = 0;
|
|
|
+ enterOrExitCharge(robot_control::common::CONTROL_SOURCE_MODE mode,
|
|
|
+ bool is_on_dock) = 0;
|
|
|
+};
|
|
|
+
|
|
|
+// 高度调整接口
|
|
|
+class HeightAdjustInterface {
|
|
|
+public:
|
|
|
+ virtual ~HeightAdjustInterface() = default;
|
|
|
+ virtual bool setBodyHeight(int height) = 0;
|
|
|
+ // virtual bool bodyHighAdjust(robot_control::common::CONTROL_SOURCE_MODE
|
|
|
+ // mode,
|
|
|
+ // int height) = 0;
|
|
|
+};
|
|
|
+
|
|
|
+// 控制模式接口
|
|
|
+class ControlModeInterface {
|
|
|
+public:
|
|
|
+ virtual ~ControlModeInterface() = default;
|
|
|
+ virtual bool setControlMode(CONTROL_SOURCE_MODE mode) = 0;
|
|
|
+ // setNavOrJoyControl(robot_control::common::CONTROL_SOURCE_MODE mode) = 0;
|
|
|
+};
|
|
|
+
|
|
|
+} // namespace data_interface
|
|
|
+} // namespace saturn_ros2
|
|
|
+
|
|
|
+#endif // !DATA_INTERFACE_HPP__
|