#ifndef __COMMON_DEF_H__ #define __COMMON_DEF_H__ #include #include #include #include typedef boost::unique_lock U_Lock; typedef boost::shared_lock S_Lock; struct Point { float x; float y; }; struct Pose { float x; float y; float theta; }; struct MapPoint { std::string name; //点名 std::string id; //点ID std::string type; //点类型 Pose pose; //点坐标 }; struct MapPath { std::string name; //路径名 std::string id; //路径ID std::string type; //类型 直线,圆弧 MapPoint start; //起始点ID MapPoint end; //终点ID float max_linear; //最大线速度 float max_angular; //最大角速度 bool enable; //能否使用 bool forward; //是否能从起点到终点行驶 bool reverse; //是否能从终点到起点行驶 bool obstacle; //是否避障 double drive_angle; //行驶角度 }; using Path = std::vector; using Points = std::vector; using Area = std::vector; struct MapInfo { std::string name; //地图名 std::string id; //地图ID int floor; //地图楼层 Points origin_map; //原始地图数据 Points shadow_map; //影子地图数据 Points reflector_map; //反光板地图数据 std::map paths; //地图路径 std::map points; //地图点 }; struct Map { //地图信息 std::string name; //地图名 std::string id; //地图ID }; struct EmcyInfo { //急停信息 bool hardware; //硬件急停 bool software; //软件急停 bool traffic; //交通管制急停 }; struct BatteryInfo { //电池信息 bool charging; //是否充电 double soc; //电量百分比 double voltage; //电压 double electric; //电流 }; struct LocationInfo { //定位信息 std::string map_id; //当前地图ID double x; //x坐标 double y; //y坐标 double theta; //角度 }; struct ResourceInfo { std::string current_pose_id; //AGV当前所在点ID std::string current_pose_name; //AGV当前所在点名 std::vector path; //AGV任务路径 }; struct NavigationConfigInfo { Area origin_obstacle_area; //原始避障区域 Area extend_obstacle_area; //扩展避障区域 std::vector shield_area; //屏蔽区域 float max_linear; //最大线速度 float max_angular; //最大角速度 float min_linear; //最小线速度 float min_angular; //最小角速度 float error_x; //到点x方向误差 float error_y; //到点y方向误差 float error_theta; //到点角度误差 float dec; //减速度 float acc; //加速度 float slow_dist; //避障减距离 float stop_dist; //避障停止距离 float look_up_dist; //前瞻距离 bool break_path; //是否分段导航 bool face_angle; //是否转到朝向角度 }; struct LaserConfigInfo { std::string frame_id; //激光frame_id std::string topic; //激光数据topic float tf_x; //tf 坐标 float tf_y; float tf_z; float tf_roll; float tf_pitch; float tf_yaw; }; struct RobotInfo { std::string name; //AGV名 std::string id; //AGV ID std::string type; //AGV类型 (二轮差速,单舵轮, 双舵轮, 四舵轮) std::string state; //AGV状态 (空闲,工作中,充电中) bool located; //AGV是否定位 LocationInfo location; //定位信息 std::map maps; //地图信息 <地图id, 地图信息> EmcyInfo emcy; //急停信息 BatteryInfo battery; //电池信息 std::map gpio; //io信息 ResourceInfo resource; //占用资源信息 NavigationConfigInfo nav_config; //导航参数 std::map laser; //雷达参数 }; struct TaskInfo { std::string name; //任务名 std::string id; //任务ID 唯一性 std::string state; //任务状态 准备中 执行中 待执行 完成 终止 unsigned int priority; //优先级 0~9 数值越大优先级越高,默认为0 std::string start_time; //任务开始时间 std::string finish_time; //任务完成时间 std::string info; //任务信息 }; #endif