10 #include <Eigen/StdVector>
11 #include <config_server/parameter.h>
37 typedef std::vector<Eigen::Vector2d, Eigen::aligned_allocator<Eigen::Vector2d> > PointsType;
47 inline Eigen::Vector3d
pose()
const {
return m_pos; }
50 inline const PointsType&
points()
const {
return m_points; }
56 void setPose(
const Eigen::Vector3d&
pose);
64 Eigen::Vector3d m_pos;
86 static const std::string FieldTypeName[NumFieldTypes];
87 static const std::string& fieldTypeName(FieldType
type) {
if(type >= UnknownField && type < NumFieldTypes)
return FieldTypeName[
type];
else return FieldTypeName[UnknownField]; }
90 inline FieldType
type()
const
95 {
return fieldTypeName(m_type); }
107 {
return m_boundary; }
111 {
return m_goalWidth; }
115 {
return m_goalAreaWidth; }
119 {
return m_goalAreaDepth; }
121 inline double centerCircleDiameter()
const
122 {
return m_centerCircleDiameter; }
126 {
return m_penaltyMarkerDist; }
130 {
return m_ballDiameter; }
134 {
return m_borderTop; }
138 {
return m_borderBottom; }
142 {
return m_borderLeft; }
146 {
return m_borderRight; }
150 {
return m_objects[
type]; }
152 void setMagneticHeading(
double heading);
153 double magneticHeading()
const;
163 MirrorAll = MirrorX | MirrorY
165 WorldObject* addObject(
WorldObject::Type type,
double x,
double y,
double t,
int flags = MirrorX | MirrorY);
166 void addLine(
const WorldObject::PointsType& points,
int flags = MirrorX | MirrorY);
168 static FieldModel* m_instance;
175 double m_goalAreaWidth;
176 double m_goalAreaDepth;
177 double m_centerCircleDiameter;
178 double m_penaltyMarkerDist;
179 double m_ballDiameter;
181 double m_borderBottom;
183 double m_borderRight;
185 std::vector<WorldObject> m_objects[WorldObject::NumTypes];
187 WorldObject* m_magneticHeading;
188 void updateMagneticHeading();
189 config_server::Parameter<float> m_attEstMagCalibX;
190 config_server::Parameter<float> m_attEstMagCalibY;
double goalWidth() const
Goal width.
Definition: field_model.h:110
double borderBottom() const
Border for the bottom(negative) part of the field.
Definition: field_model.h:137
Magnetic heading towards X+.
Definition: field_model.h:33
const PointsType & points() const
Points belonging to the object (e.g. line start and end)
Definition: field_model.h:50
double goalAreaWidth() const
Width of the penalty area before each goal.
Definition: field_model.h:114
Definition: field_model.h:19
Model of the soccer field.
Definition: field_model.h:73
FieldType type() const
Field type.
Definition: field_model.h:90
L-crossing of two lines.
Definition: field_model.h:32
Type type() const
Object type.
Definition: field_model.h:53
double ballDiameter() const
Diameter of the ball.
Definition: field_model.h:129
Goal (center position)
Definition: field_model.h:26
X-crossing of two lines.
Definition: field_model.h:31
const std::string & typeName() const
Field type name.
Definition: field_model.h:94
double goalAreaDepth() const
Depth of the penalty area before each goal.
Definition: field_model.h:118
One of the two penalty markers.
Definition: field_model.h:28
A single goal post.
Definition: field_model.h:27
Type
Object type.
Definition: field_model.h:23
double boundary() const
Field boundary (amount of green outside the field boundary)
Definition: field_model.h:106
Center circle.
Definition: field_model.h:25
T-crossing of two lines.
Definition: field_model.h:30
const std::vector< WorldObject > & objects(WorldObject::Type type) const
Objects for a specific WorldObject::Type.
Definition: field_model.h:149
Eigen::Vector3d pose() const
Object pose (x, y, theta)
Definition: field_model.h:47
Field line.
Definition: field_model.h:29
double borderRight() const
Border for the right(when looking to positive goal) part of the field.
Definition: field_model.h:145
double width() const
Field width (inside the lines)
Definition: field_model.h:98
double borderTop() const
Border for the top(positive) part of the field.
Definition: field_model.h:133
double penaltyMarkerDist() const
Distance from the goal line to the penalty marker.
Definition: field_model.h:125
double borderLeft() const
Border for the left(when looking to positive goal) part of the field.
Definition: field_model.h:141
double length() const
Field length (inside the lines)
Definition: field_model.h:102