Fawkes API  Fawkes Development Version
position_to_pixel.h
1 /***************************************************************************
2  * globfromrel.cpp - Implementation of the global ball position model
3  *
4  * Created: Do Apr 03 16:45:22 2014
5  * Copyright 2014 Tobias Neumann
6  *
7  ****************************************************************************/
8 
9 /* This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version. A runtime exception applies to
13  * this software (see LICENSE.GPL_WRE file mentioned below for details).
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Library General Public License for more details.
19  *
20  * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
21  */
22 
23 #ifndef _FIREVISION_PIXELFROMPOSITION_H_
24 #define _FIREVISION_PIXELFROMPOSITION_H_
25 
26 #include <tf/transformer.h>
27 #include <utils/math/types.h>
28 
29 #include <string>
30 
31 namespace firevision {
32 
33 class PositionToPixel
34 {
35 public:
37  std::string cam_frame,
38  float cam_aperture_x,
39  float cam_aperture_y,
40  unsigned int cam_width_x,
41  unsigned int cam_height_y,
42  float cam_angle_y = 0);
43 
45  std::string & frame,
46  const fawkes::Time & time);
48  std::string & frame,
49  const fawkes::Time & time);
50 
51 private:
52  std::string cam_frame_;
53  fawkes::tf::Transformer *tf_listener;
54 
55  float cam_aperture_horizontal_;
56  float cam_aperture_vertical_;
57  float cam_angle_y_;
58  unsigned int cam_resolution_x_;
59  unsigned int cam_resolution_y_;
60 
61  float cam_pixel_per_angle_horizontal_;
62  float cam_pixel_per_angle_vertical_;
63 
64  float cam_angle_max_horizontal_;
65  float cam_angle_min_horizontal_;
66  float cam_angle_max_vertical_;
67  float cam_angle_min_vertical_;
68 };
69 } // namespace firevision
70 #endif /* FIREVISION_PIXELFROMPOSITION_H__ */
fawkes::point_struct
Point with cartesian coordinates as signed integers.
Definition: types.h:41
fawkes::upoint_t
Point with cartesian coordinates as unsigned integers.
Definition: types.h:34
fawkes::tf::Transformer
Definition: transformer.h:74
fawkes::cart_coord_3d_t
Cartesian coordinates (3D).
Definition: types.h:87
firevision::PositionToPixel::get_pixel_position
fawkes::upoint_t get_pixel_position(fawkes::cart_coord_3d_t &position, std::string &frame, const fawkes::Time &time)
Definition: position_to_pixel.cpp:138
firevision::PositionToPixel::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.
Definition: position_to_pixel.cpp:50
fawkes::Time
Definition: time.h:98
firevision::PositionToPixel::get_pixel_position_unchecked
fawkes::point_t get_pixel_position_unchecked(fawkes::cart_coord_3d_t &position, std::string &frame, const fawkes::Time &time)
Definition: position_to_pixel.cpp:89