// // Created by gf on 23-7-21. // 自定义类型 // #ifndef NAVIGATION_CUSTOM_TYPE_H #define NAVIGATION_CUSTOM_TYPE_H ////////////////////////////////////////////////// /// 封装的enum模板类,解决原生enum无法参与位运算问题 template class MyEnum { using Self = MyEnum; using EnumType = Enum; public: MyEnum(const MyEnum &other) : i(other.i) { } MyEnum(const Enum &e) : i((int) e) { } MyEnum(const int ival) : i(ival) { } operator int() const { return i; } MyEnum operator|(const MyEnum &another) { MyEnum g; g.i = another.i | Self::i; return g; } MyEnum operator|(const EnumType f) { return *this | MyEnum(f); } MyEnum operator&(const MyEnum &another) { MyEnum g; g.i = another.i & Self::i; return g; } MyEnum operator&(const EnumType f) { return *this & MyEnum(f); } private: int i; }; ////////////////////////////////////////////////// ////////////////////////////////////////////////// /// MPC返回值 enum MpcError { success = 0, no_solution = 1, failed }; ////////////////////////////////////////////////// ////////////////////////////////////////////////// /// 基准可选方向 enum Direction { eForward = 0x0001, eBackward = 0x0002, eLeft = 0x0004, eRight = 0x0008 }; ////////////////////////////////////////////////// ////////////////////////////////////////////////// /// AGV运动模式(最低1位:0单车,1整车。低2位:0同向,1反向。低3位:0主车在前,1主车在后) enum ActionMode{ eSingle = 0x0000, eDouble = 0x0001, eMainInForward = 0x0000, eMainInBackward = 0x0008, eChildSameToMain = 0x0000, eChildOppositeToMain = 0x0002 }; //using ActionModes = MyEnum; ////////////////////////////////////////////////// ////////////////////////////////////////////////// /// AGV指令类型 enum ActionType { eReady = 0, eStop = 0, eRotation = 1, eHorizontal = 2, eVertical = 3, eClampClose = 5, eClampOpen = 6, eLifterRise = 7, //提升机构上升 eLifterDown =8, eClampFullyOpen = 9 }; /////////////////////////////////////////////// /////////////////////////////////////////////// /// 提升机构运动状态 enum LifterStatus { eInvalid = 0, eRose = 1,//上升到位 eDowned = 2//下降到位 }; ////////////////////////////////////////////////// #endif //NAVIGATION_CUSTOM_TYPE_H