📄 visionobject.h
字号:
// These objects are just what Vision tells the world.
#ifndef _VisionObject_h_DEFINED
#define _VisionObject_h_DEFINED
#include "../VISION/VisionData.h"
// corresponds to below enum...
const static long beaconCoords[16][2] = {{-1,-1}, {-1,-1}, {-145,-220}, {-145,0}, {-145,220}, {145,-220}, {145,0}, {145,220}, {-30,220}, {30,220}, {30,-220}, {-30,-220}, {-1,-1}, {-1,-1}, {-1,-1}, {-1,-1}};
//Field Direction Definition:
//y-axis from Goal to Goal
//Blue Goal at Top of Field (+ve y)
//Orientation: 0 degrees = Heading Towards Blue Goal
//Positive Orientation = Left (-ve x)
//NOTE! WM makes it so +y is always the opposition half of the field ...
class VisionObject
{
public:
enum ObjectType
{
OT_INVALID = 0,
OT_BALL = 1,
// OT_BEACON_<TOPCOLOR><BOTTOMCOLOR>
OT_BEACON_YP = 2,
OT_BEACON_GP = 3,
OT_BEACON_BP = 4,
OT_BEACON_PY = 5,
OT_BEACON_PG = 6,
OT_BEACON_PB = 7,
OT_GOAL_B_L = 8,
OT_GOAL_B_R = 9,
OT_GOAL_Y_L = 10,//This is the post at (20,-210) ie left yellow post if facing the YELLOW goal
OT_GOAL_Y_R = 11,
OT_GOAL_B = 12,
OT_GOAL_Y = 13,
OT_ROBOT_RED = 14,
OT_ROBOT_BLUE = 15,
OT_GOAL_CORNER_IN = 16, // Indicates that the object represent the corner of the penalty box
OT_GOAL_CORNER_OUT = 17, // Indicates that the object represent the corner of the penalty box
OT_CENTRE_POINT = 18, // Position of the centre circle on the field
OT_CENTRE_LINE_CORNER = 19, // Intersection point of the centre field line and side line
};
VisionObject();
~VisionObject();
// Note: For any other blob other than the beacons top and bottom blob are set to be equal
void SetData(ObjectType type, Blob* topBlob, Blob* bottomBlob, double heading, double elevation, double distance, int cx, int cy, int confidence);
ObjectType type_;
double heading_;
double elevation_;
double distance_;
int centreX_;
int centreY_;
Blob* topBlob_;
Blob* bottomBlob_;
int confidence_;
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -