Provides locations of key field landmarks and helper functions to draw the field out in 2D and 3D. More...
#include <field_provider.h>
Public Member Functions | |
FieldProvider (float x=0.0, float y=0.0, float z=0.0) | |
Constructor with field center coordinates. | |
void | get2dField (IplImage *image, int highlightPoint=-1) |
Draws out a 2D field to scale on an OpenCV IplImage. | |
void | get3dField (pcl_visualization::PCLVisualizer &visualizer) |
Draws out a 3d field to scale in a PCLVisualizer Window. | |
Eigen::Vector3f | getGroundPoint (int index) |
Returns the true location of a landmark. | |
Private Member Functions | |
void | convertCoordinates (cv::Point2d &pos2d, int height, int width, const Eigen::Vector3f &pos3d) |
Scales the points from 3D locations to the correct pixel on an IplImage. | |
void | draw2dCenterCircle (IplImage *image, const Eigen::Vector3f ¢erPt, const Eigen::Vector3f &circlePt, const CvScalar &color, int width) |
Draws the center circle on an IplImage from 3D points using the appropriate scale. | |
void | draw2dCircle (IplImage *image, const Eigen::Vector3f &pt, int radius, const CvScalar &color, int width) |
Draws a dot (small circle) on an IplImage from 3D points using the appropriate scale. | |
void | draw2dLine (IplImage *image, const Eigen::Vector3f &ep1, const Eigen::Vector3f &ep2, const CvScalar &color, int width) |
Draws a line on an IplImage from 3D points using the appropriate scale. | |
void | draw3dCenterCircle (pcl_visualization::PCLVisualizer &visualizer, const Eigen::Vector3f ¢erPt, const Eigen::Vector3f &circlePt, double r, double g, double b, const std::string &name) |
Draws the center circle in 3d space. | |
void | draw3dLine (pcl_visualization::PCLVisualizer &visualizer, const Eigen::Vector3f &ep1, const Eigen::Vector3f &ep2, double r, double g, double b, const std::string &name) |
Draws a line in 3D space. | |
Private Attributes | |
Eigen::Vector3f | centerField |
Coordinates for the field center. | |
Eigen::Vector3f | groundPoints [NUM_GROUND_PLANE_POINTS] |
True locations of landmarks on the ground plane. | |
Eigen::Vector3f | highPoints [NUM_HIGH_POINTS] |
True locations of the top points in a goal (for visualization) |
Provides locations of key field landmarks and helper functions to draw the field out in 2D and 3D.
Definition at line 84 of file field_provider.h.
ground_truth::FieldProvider::FieldProvider | ( | float | x = 0.0 , |
float | y = 0.0 , |
||
float | z = 0.0 |
||
) |
Constructor with field center coordinates.
This constructor always assumes the xy plane to be the ground
Definition at line 35 of file field_provider.cpp.
void ground_truth::FieldProvider::convertCoordinates | ( | cv::Point2d & | pos2d, |
int | height, | ||
int | width, | ||
const Eigen::Vector3f & | pos3d | ||
) | [private] |
Scales the points from 3D locations to the correct pixel on an IplImage.
Definition at line 114 of file field_provider.cpp.
void ground_truth::FieldProvider::draw2dCenterCircle | ( | IplImage * | image, |
const Eigen::Vector3f & | centerPt, | ||
const Eigen::Vector3f & | circlePt, | ||
const CvScalar & | color, | ||
int | width | ||
) | [private] |
Draws the center circle on an IplImage from 3D points using the appropriate scale.
Draws a dot (small circle) on an IplImage from 3D points using the appropriate scale.
Definition at line 94 of file field_provider.cpp.
void ground_truth::FieldProvider::draw2dCircle | ( | IplImage * | image, |
const Eigen::Vector3f & | pt, | ||
int | radius, | ||
const CvScalar & | color, | ||
int | width | ||
) | [private] |
Draws a dot (small circle) on an IplImage from 3D points using the appropriate scale.
Draws the center circle on an IplImage from 3D points using the appropriate scale.
Definition at line 105 of file field_provider.cpp.
void ground_truth::FieldProvider::draw2dLine | ( | IplImage * | image, |
const Eigen::Vector3f & | ep1, | ||
const Eigen::Vector3f & | ep2, | ||
const CvScalar & | color, | ||
int | width | ||
) | [private] |
Draws a line on an IplImage from 3D points using the appropriate scale.
Definition at line 84 of file field_provider.cpp.
void ground_truth::FieldProvider::draw3dCenterCircle | ( | pcl_visualization::PCLVisualizer & | visualizer, |
const Eigen::Vector3f & | centerPt, | ||
const Eigen::Vector3f & | circlePt, | ||
double | r, | ||
double | g, | ||
double | b, | ||
const std::string & | name | ||
) | [private] |
Draws the center circle in 3d space.
This method currently uses the PCLVisualizer API for drawing circles. Currently a wireframe of the center circle in the form of a Hexagon is drawn
Definition at line 214 of file field_provider.cpp.
void ground_truth::FieldProvider::draw3dLine | ( | pcl_visualization::PCLVisualizer & | visualizer, |
const Eigen::Vector3f & | ep1, | ||
const Eigen::Vector3f & | ep2, | ||
double | r, | ||
double | g, | ||
double | b, | ||
const std::string & | name | ||
) | [private] |
Draws a line in 3D space.
This function also draw out 2 small spheres at the end of the line
Definition at line 203 of file field_provider.cpp.
void ground_truth::FieldProvider::get2dField | ( | IplImage * | image, |
int | highlightPoint = -1 |
||
) |
Draws out a 2D field to scale on an OpenCV IplImage.
image | The image on which the field is to be drawn |
highlightPoint | Indicates which landmark is to be highlighted(default is none) |
Definition at line 124 of file field_provider.cpp.
void ground_truth::FieldProvider::get3dField | ( | pcl_visualization::PCLVisualizer & | visualizer | ) |
Draws out a 3d field to scale in a PCLVisualizer Window.
visualizer | the PCLVisualizer window object |
Definition at line 227 of file field_provider.cpp.
Eigen::Vector3f ground_truth::FieldProvider::getGroundPoint | ( | int | index | ) | [inline] |
Returns the true location of a landmark.
index | Identifier for the landmark |
Definition at line 161 of file field_provider.h.
Eigen::Vector3f ground_truth::FieldProvider::centerField [private] |
Coordinates for the field center.
Definition at line 88 of file field_provider.h.
Eigen::Vector3f ground_truth::FieldProvider::groundPoints[NUM_GROUND_PLANE_POINTS] [private] |
True locations of landmarks on the ground plane.
Definition at line 89 of file field_provider.h.
Eigen::Vector3f ground_truth::FieldProvider::highPoints[NUM_HIGH_POINTS] [private] |
True locations of the top points in a goal (for visualization)
Definition at line 90 of file field_provider.h.