Fawkes API  Fawkes Development Version
firevision::PositionToPixel Class Reference

Compute a pixel position in the camera image from a cartesian world coordinate. More...

Public Member Functions

 PositionToPixel (fawkes::tf::Transformer *tf, std::string cam_frame, float cam_aperture_x, float cam_aperture_y, unsigned int cam_width_x, unsigned int cam_height_y, float cam_angle_y=0)
 Construct a PositionToPixel model with the required camera geometry. More...
 
fawkes::upoint_t get_pixel_position (fawkes::cart_coord_3d_t &position, std::string &frame, const fawkes::Time &time)
 
fawkes::point_t get_pixel_position_unchecked (fawkes::cart_coord_3d_t &position, std::string &frame, const fawkes::Time &time)
 

Detailed Description

Compute a pixel position in the camera image from a cartesian world coordinate.

Definition at line 33 of file position_to_pixel.h.

Constructor & Destructor Documentation

◆ PositionToPixel()

firevision::PositionToPixel::PositionToPixel ( fawkes::tf::Transformer tf,
std::string  cam_frame,
float  cam_aperture_x,
float  cam_aperture_y,
unsigned int  cam_width_x,
unsigned int  cam_height_y,
float  cam_angle_y = 0 
)

Construct a PositionToPixel model with the required camera geometry.

Parameters
tfThe transform listener used by the calling code
cam_frameReference frame of the camera coordinate system
cam_aperture_xHorizontal opening angle (rad)
cam_aperture_yVertical opening angle (rad)
cam_width_xHorizontal pixel resolution
cam_height_yVertical pixel resolution
cam_angle_yVertical camera mounting angle

Definition at line 44 of file position_to_pixel.cpp.

Member Function Documentation

◆ get_pixel_position()

fawkes::upoint_t firevision::PositionToPixel::get_pixel_position ( fawkes::cart_coord_3d_t position,
std::string &  frame,
const fawkes::Time time 
)
Parameters
positionthe 3dimential position (x, y, z) in the given frame
framethe frame where the data are in
timethe timestamp of position
Returns
the pixel in the camera
Exceptions
OutOfBoundsExceptionConnectivityException ExtrapolationException LookupException

Definition at line 124 of file position_to_pixel.cpp.

References get_pixel_position_unchecked(), fawkes::upoint_t::x, fawkes::point_struct::x, fawkes::upoint_t::y, and fawkes::point_struct::y.

◆ get_pixel_position_unchecked()

fawkes::point_t firevision::PositionToPixel::get_pixel_position_unchecked ( fawkes::cart_coord_3d_t position,
std::string &  frame,
const fawkes::Time time 
)
Parameters
positionthe 3dimential position (x, y, z) in the given frame
framethe frame where the data are in
timethe timestamp of position
Returns
the pixel in the camera (may be negative or > resolution!)
Exceptions
OutOfBoundsExceptionConnectivityException ExtrapolationException LookupException

Definition at line 80 of file position_to_pixel.cpp.

References fawkes::cart2polar3d(), fawkes::tf::Stamped< T >::frame_id, fawkes::polar_coord_3d_t::phi, fawkes::polar_coord_3d_t::r, fawkes::tf::Stamped< T >::stamp, fawkes::polar_coord_3d_t::theta, fawkes::tf::Transformer::transform_point(), fawkes::point_struct::x, fawkes::cart_coord_3d_t::x, fawkes::point_struct::y, fawkes::cart_coord_3d_t::y, and fawkes::cart_coord_3d_t::z.

Referenced by get_pixel_position().


The documentation for this class was generated from the following files: