📄 types.h
字号:
/* Copyright (C) 2007, 2008 by Team Apollo Nanjing University of Posts and Telecommunications, China This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.*/#ifndef TYPES_H#define TYPES_H#include <iostream>#include <string>#include <map>#include <cassert>#include <sstream>#include "./salt/vector.h"#include "./salt/gmath.h"#include "soccertypes.h"const std::string gTeamName = "Strive3D";static const int gTeamSize = 3;static const std::string ACTION_TURN = "turn";static const std::string ACTION_KICK = "kick";static const std::string ACTION_WALK = "walk";static const std::string ACTION_TRIPPLEBACKWARD = "tripplebackward";static const std::string ACTION_WALK_TO = "walkto";static const std::string ACTION_GETUP = "getup";static const std::string ACTION_GETUPFROMBACK = "getupfromback";static const std::string ACTION = "action";struct VisionSense{ /** distance perceptor to object */ double distance; /** theta is the angle in the X-Y (horizontal) plane */ double theta; /** phi is the latitude angle */ double phi; salt::Vector3f localPos; salt::Vector3f realPos; /** init with some big number to find out bug easlier */ VisionSense() : distance(-1000.0), theta(-1000.0), phi(-1000.0) {};};struct HingeJointSense{ /** joint angle */ float angle; /** joint angle rate */ float rate; HingeJointSense() : angle(0), rate(0) {};};struct UniversalJointSense{ /** joint angle axis 1*/ float angle1; /** joint angle axis 2*/ float angle2; /** joint angle rate axis 1*/ float rate1; /** joint angle rate axis 2*/ float rate2; UniversalJointSense() : angle1(0), angle2(0), rate1(0), rate2(0) {};};struct HearInfo{ float time; std::string sender; std::string message;};/** typedef */typedef int JointID;typedef int RobotPart;typedef std::map<JointID, HingeJointSense> THingeJointSenseMap;typedef std::map<JointID, UniversalJointSense> TUniversalJointSenseMap;typedef std::map<std::string, JointID> TJointIDMap;/** enum */enum EFallDir{ NO_FALL, FALL_FRONT, FALL_BACK, FALL_LEFT, FALL_RIGHT};enum VisionObject{ FLAG_1_L = 0, FLAG_1_R = 1, FLAG_2_L = 2, FLAG_2_R = 3, GOAL_1_L = 4, GOAL_1_R = 5, GOAL_2_L = 6, GOAL_2_R = 7, BALL = 8, TEAMMATE_1 = 9, TEAMMATE_2 = 10, TEAMMATE_3 = 11, TEAMMATE_4 = 12, TEAMMATE_5 = 13, TEAMMATE_6 = 14, TEAMMATE_7 = 15, TEAMMATE_8 = 16, TEAMMATE_9 = 17, TEAMMATE_10 = 18, TEAMMATE_11 = 19, OPPONENT_1 = 20, OPPONENT_2 = 21, OPPONENT_3 = 22, OPPONENT_4 = 23, OPPONENT_5 = 24, OPPONENT_6 = 25, OPPONENT_7 = 26, OPPONENT_8 = 27, OPPONENT_9 = 28, OPPONENT_10 = 29, OPPONENT_11 = 30};#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -