65#ifndef FilteredOneDimObject_DEFINED
66#define FilteredOneDimObject_DEFINED
83 int16_t t_distance =0,
87 bool t_isVisible=
false,
88 uint64_t t_visibilityHistory=0
89 ):
FilteredVisionObject(t_visibilityHistory, t_frameCounter, t_distance, t_x, t_y, t_yaw, t_isVisible, 0, 0)
145 float horizontal_angle(
const float guvision_width = 640.0f,
const float horiz_fov = 61.0f)
const
147 float yaw_in_radians = float(DEG2RAD(
yaw()));
148 float D = guvision_width / 2 / tanf(
float(DEG2RAD(horiz_fov/2)));
149 float alpha = atanf(
float(
x())/D);
151 return yaw_in_radians - alpha;
158 int historyLength = (length>64) ? 64 : length;
159 historyLength = (historyLength>0)?historyLength:64;
163 int position=historyLength;
166 { count +=theHistory & 0X1;
174#ifdef WHITEBOARD_POSTER_STRING_CONVERSION
176#define SEPARATOR_IS_COMMA ','
177#define SEPARATOR_IS_COLON ':'
178#define IS_VISIBLE_ID 'I'
190 std::ostringstream ss;
208 std::istringstream iss(str);
219 std::size_t found = str.find(comaDel);
220 if (std::string::npos!=found )
221 { std::string strSecond=str.substr (found+comaDel.size());
222 std::istringstream second_iss(strSecond);
225 int16_t distance_value = int16_t ( atoi(token.c_str()));
226 set_distance ( distance_value>=0? distance_value : -distance_value);
228 found = strSecond.find(comaDel);
229 if (std::string::npos!=found )
230 { std::string strThird=strSecond.substr (found+comaDel.size());
231 std::istringstream third_iss(strThird);
234 int16_t xValue=int16_t ( atoi(token.c_str()));
237 found = strThird.find(comaDel);
238 if (std::string::npos!=found )
239 { std::string strFourth=strThird.substr (found+comaDel.size());
240 std::istringstream fourth_iss(strFourth);
242 { int16_t yValue=int16_t ( atoi(token.c_str()));
245 found = strFourth.find(comaDel);
246 if (std::string::npos!=found )
247 { std::string strFifith=strFourth.substr (found+comaDel.size());
248 std::istringstream fifith_iss(strFifith);
250 { int16_t yawValue=int16_t ( atoi(token.c_str()));
254 found = strFifith.find(colonDel);
255 if (std::string::npos!=found )
256 { std::string strSixth=strFifith.substr (found+colonDel.size());
257 std::istringstream sixth_iss(strSixth);
260 int32_t frameValue=int32_t ( atoi(token.c_str()));
#define SEPARATOR_IS_COMMA
#define SEPARATOR_IS_COLON
A class to contain objects that have been filtered through localisation.
FilteredOneDimObject & operator=(const wb_filtered_vision_object &other)
copy assignment operator
FilteredOneDimObject(const char *names)
const char * constructor
void from_string(const std::string &str)
TODO: still incomplete.
FilteredOneDimObject(const wb_filtered_vision_object &other)
BASECONSTRUCTOR: INTERESTING !!!!
FilteredOneDimObject(const FilteredOneDimObject &other)
copy constructor
std::string description() const
convert to a string
FilteredOneDimObject & operator=(const FilteredOneDimObject &other)
copy assignment operator
float horizontal_angle(const float guvision_width=640.0f, const float horiz_fov=61.0f) const
Provides an estimated horizon camera angle by looking at the head yaw value.
FilteredOneDimObject(const std::string &names)
string constructor
FilteredOneDimObject(int32_t t_frameCounter=0, int16_t t_distance=0, int16_t t_x=0, int16_t t_y=0, int16_t t_yaw=0, bool t_isVisible=false, uint64_t t_visibilityHistory=0)
designated constructor
int ratioOfSightings(const int length=64) const
number of object sigthings over length
Provides a C++ wrapper around wb_filtered_vision_object.
void set_x(const int16_t &t_newValue)
void set_visibilityHistory(const uint64_t &t_newValue)
void set_y(const int16_t &t_newValue)
uint64_t & visibilityHistory()
void set_isVisible(const bool &t_newValue)
void set_frameCounter(const int32_t &t_newValue)
void set_distance(const int16_t &t_newValue)
void set_yaw(const int16_t &t_newValue)
WHITEBOARD_POSTER_STRING_CONVERSION.
int16_t x
centre x-coordinate in image (0,0) is the centre of the image, positive is to the right
int32_t frameCounter
incremented every time we do not see the object.
int16_t distance
distance to landmark in cm
uint64_t visibilityHistory
a 64-bit history of whether vision said visible 1 or not visible 0.
int16_t yaw
the Yaw in Degrees when the object was last used to generated filtered values.
int16_t y
centre y-coordinate in image, positive is upwards
bool isVisible
is this a credible sighting.