ed_sensor_integration
Functions | Variables
fitter_viz.h File Reference
#include <ed/entity.h>
#include <ed/world_model.h>
#include <ed/kinect/fitter.h>
#include <geolib/math_types.h>
#include <opencv2/highgui/highgui.hpp>
Include dependency graph for fitter_viz.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void drawLine (const cv::Mat &canvas, geo::Vec2 point1, geo::Vec2 point2, geo::Transform2 pose, float resolution, int origin_x, int origin_y, cv::Scalar colour)
 drawLine, draw a line in 2D metric space on a canvas More...
 
void drawShape2D (const cv::Mat &canvas, const Shape2D &shape, geo::Transform2 pose, float resolution, int origin_x, int origin_y, cv::Scalar colour)
 drawShape2D draw a 2D shape defined in 2D metric space on a canvas. More...
 
cv::Scalar entity_colour (0, 255, 255)
 
cv::Scalar fitted_colour (243, 192, 15)
 
cv::Scalar measurement_colour (161, 17, 187)
 
cv::Scalar sensor_colour (0, 255, 0)
 
cv::Point sensorlocation (sensor_x, sensor_y)
 
cv::Mat visualizeFitting (EntityRepresentation2D entity, geo::Transform2 sensor_pose, geo::Transform2 entity_pose, geo::Transform2 fitted_pose, FitterData fitterdata, bool estimateEntityPose)
 

Variables

int canvas_height = 600
 
float canvas_resolution = 100
 
int canvas_width = 800
 
int sensor_x = canvas_width/2
 
int sensor_y = canvas_height * 8/10
 

Function Documentation

◆ drawLine()

void drawLine ( const cv::Mat &  canvas,
geo::Vec2  point1,
geo::Vec2  point2,
geo::Transform2  pose,
float  resolution,
int  origin_x,
int  origin_y,
cv::Scalar  colour 
)

drawLine, draw a line in 2D metric space on a canvas

Parameters
canvascanvas to draw the line to
point1first point defining the line in map frame
point2second point defining the line in map frame
poseposition of the sensor in map frame.
resolutionpixels per meter
origin_xlocation in pixels of the sensor on the canvas
origin_ylocation in pixels of the sensor on the canvas
colourcolour to draw the line

Definition at line 39 of file fitter_viz.h.

◆ drawShape2D()

void drawShape2D ( const cv::Mat &  canvas,
const Shape2D shape,
geo::Transform2  pose,
float  resolution,
int  origin_x,
int  origin_y,
cv::Scalar  colour 
)

drawShape2D draw a 2D shape defined in 2D metric space on a canvas.

Parameters
canvascanvas to draw to
shape2D shape to draw
posepose in meters of the center of the shape.
resolutionpixels per meter
origin_xpostion of the origin in pixels
origin_yposition of the origin in pixels
colourcolour to draw the shape in.

Definition at line 78 of file fitter_viz.h.

◆ entity_colour()

cv::Scalar entity_colour ( ,
255  ,
255   
)

◆ fitted_colour()

cv::Scalar fitted_colour ( 243  ,
192  ,
15   
)

◆ measurement_colour()

cv::Scalar measurement_colour ( 161  ,
17  ,
187   
)

◆ sensor_colour()

cv::Scalar sensor_colour ( ,
255  ,
 
)

◆ sensorlocation()

cv::Point sensorlocation ( sensor_x  ,
sensor_y   
)

◆ visualizeFitting()

cv::Mat visualizeFitting ( EntityRepresentation2D  entity,
geo::Transform2  sensor_pose,
geo::Transform2  entity_pose,
geo::Transform2  fitted_pose,
FitterData  fitterdata,
bool  estimateEntityPose 
)

create an image displaying the fitted entity along with the information used in fitting.

Displays the fitted entity, sensor data used in fitting and the original pose of the entity prior to fitting.

Note that sensor_pose, entity_pose and fitted_pose must be expressed in the same coordinate frame

Parameters
entityshape of the entity that was fitted
sensor_posepose of the sensor
entity_poseestimated pose of the entity prior to fitting
fitted_poseestimated pose of the entity after fitting
fitterdatafitterdata used in fitting the entity.
estimateEntityPosewhether or not the fitting encountered errors
Returns

Definition at line 114 of file fitter_viz.h.

Variable Documentation

◆ canvas_height

int canvas_height = 600

Definition at line 16 of file fitter_viz.h.

◆ canvas_resolution

float canvas_resolution = 100

Definition at line 17 of file fitter_viz.h.

◆ canvas_width

int canvas_width = 800

Definition at line 15 of file fitter_viz.h.

◆ sensor_x

int sensor_x = canvas_width/2

Definition at line 19 of file fitter_viz.h.

◆ sensor_y

int sensor_y = canvas_height * 8/10

Definition at line 20 of file fitter_viz.h.