123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163 |
- #ifndef __COMMON_DEF_H__
- #define __COMMON_DEF_H__
- #include <vector>
- #include <string>
- #include <map>
- #include <boost/thread/shared_mutex.hpp>
- typedef boost::unique_lock<boost::shared_mutex> U_Lock;
- typedef boost::shared_lock<boost::shared_mutex> S_Lock;
- struct Point {
- float x;
- float y;
- };
- struct Pose {
- float x;
- float y;
- float theta;
- };
- struct MapPoint {
- std::string name;
- std::string id;
- std::string type;
-
- Pose pose;
- };
- struct MapPath {
- std::string name;
- std::string id;
- std::string type;
-
- MapPoint start;
- MapPoint end;
- float max_linear;
- float max_angular;
- bool enable;
- bool forward;
- bool reverse;
- bool obstacle;
- double drive_angle;
- };
- using Path = std::vector<Pose>;
- using Points = std::vector<Point>;
- using Area = std::vector<Point>;
- struct MapInfo {
- std::string name;
- std::string id;
- int floor;
- Points origin_map;
- Points shadow_map;
- Points reflector_map;
- std::map<std::string, MapPath> paths;
- std::map<std::string, MapPoint> points;
- };
- struct Map {
- std::string name;
- std::string 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;
- double x;
- double y;
- double theta;
- };
- struct ResourceInfo {
- std::string current_pose_id;
- std::string current_pose_name;
- std::vector<MapPoint> path;
- };
- struct NavigationConfigInfo {
- Area origin_obstacle_area;
- Area extend_obstacle_area;
- std::vector<Area> shield_area;
- float max_linear;
- float max_angular;
- float min_linear;
- float min_angular;
- float error_x;
- float error_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;
- std::string topic;
- float tf_x;
- float tf_y;
- float tf_z;
- float tf_roll;
- float tf_pitch;
- float tf_yaw;
- };
- struct RobotInfo {
- std::string name;
- std::string id;
- std::string type;
- std::string state;
- bool located;
- LocationInfo location;
- std::map<std::string, MapInfo> maps;
- EmcyInfo emcy;
- BatteryInfo battery;
- std::map<std::string, bool> gpio;
- ResourceInfo resource;
- NavigationConfigInfo nav_config;
- std::map<std::string, LaserConfigInfo> laser;
- };
- struct TaskInfo {
- std::string name;
- std::string id;
- std::string state;
- unsigned int priority;
- std::string start_time;
- std::string finish_time;
- std::string info;
- };
- #endif
|