6 b2Transform displacement=b2Transform_zero;
11 TrackingResult(
const Disturbance& d,
const b2Transform & tr=b2Transform_zero): displacement(tr), observed_disturbance(d){}
23 b2Transform deltaTransform=b2Transform_zero;
38 b2Transform getDeltaTransform(){
return deltaTransform;}
73 virtual void init(
const Task & goal)=0;
75 virtual bool hasTaskEnded(
Task & t);
86 void log_thresholds(){
87 FILE *f= fopen(
"/tmp/thresholds.txt",
"a");
88 fprintf(f,
"%f\t%f\t%f\t%f\t%f\n", threshold.
for_Di().get_x(),
89 threshold.
for_Di().get_y(),
90 threshold.
for_Di().get_angle(),
91 threshold.
for_Di().get_width(),
92 threshold.
for_Di().get_length());
111 void init(
const Task & goal){}
123 b2PolygonShape attention_window;
124 bool hasReading=
false;
163 virtual std::vector <BodyFeatures>::const_iterator
find_disturbance(std::vector <BodyFeatures>::const_iterator objects_begin, std::vector <BodyFeatures>::const_iterator objects_end,
const BodyFeatures & dist, b2Transform t,
float * _least_square=NULL);
180 void set_attention(b2PolygonShape ps){
184 void init(
const Task & goal){
185 attention_window=sensor_box(
Robot::get_vertices(),b2Transform_zero, goal.get_disturbance());
189 virtual bool hasTaskEnded(
Task & t);
206 float distance=std::max(Threshold::FIXED_ENDPOSE, s.distance()/2);
207 return Threshold(distance, Threshold::FIXED_ANGLE, Threshold::FIXED_DISTPOS, Threshold::FIXED_AFFORDANCE, Threshold::FIXED_DIMENSIONS);
Definition: tracker.h:203
Tracks task execution by observing changes in tracked disturbance.
Definition: tracker.h:120
TrackingResult get_transform(const Task &t, const CoordinateContainer &pts, const std::vector< BodyFeatures > &objects) override
returns 2d transformation matrix between one scan and the next based on the displacement of disturban...
Definition: tracker.cpp:55
void on_new_task(const Task &task, const Task &goal) override
Uses the goal to reset tracked disturbance at each task.
Definition: tracker.cpp:134
void makeAttentionWindow(const Task &goal, const Task ¤tTask)
Updates the attention window at each sensor reading.
Definition: tracker.cpp:153
cv::Rect2f real_world_focus(const Task *)
returns an upright rectangle which represents a focus of attention for finding points corresponding t...
Definition: tracker.cpp:40
virtual std::vector< BodyFeatures >::const_iterator find_disturbance(std::vector< BodyFeatures >::const_iterator objects_begin, std::vector< BodyFeatures >::const_iterator objects_end, const BodyFeatures &dist, b2Transform t, float *_least_square=NULL)
Get disturbance to be tracked among the worldbuilder objects.
Definition: tracker.cpp:93
TrackingResult track(const Task &t, const CoordinateContainer &pts, const std::vector< BodyFeatures > &objects)
Tracks task execution.
Definition: tracker.cpp:29
void correctAngle(BodyFeatures &found, const BodyFeatures &dist)
Sets angle to be smallest possible increment compared to dist.
Definition: tracker.cpp:123
float window_area()
gets the area of the attention window (for debugging)
Definition: tracker.cpp:145
Definition: configurator.h:17
Tracks task execution through dead reckoning.
Definition: tracker.h:103
TrackingResult track(const Task &t, const CoordinateContainer &pts, const std::vector< BodyFeatures > &objects)
Tracks task execution.
Definition: tracker.cpp:23
void on_new_task(const Task &task, const Task &goal) override
Called every time a new task is created.
Definition: tracker.h:109
static std::vector< b2Vec2 > get_vertices()
Returns vertices in local frame. Order: bl, br, tl, tr.
Definition: robot.h:52
A closed hybrid control loop. It has an initial disturbance representing the continuous state and a d...
Definition: task.h:47
Definition: threshold.h:155
Definition: threshold.h:91
Bundle for_Di() const
Returns a bundle of thresholds for the initial disturbance.
Definition: threshold.h:119
Tracking interface: Bridge between the real world and the simulation. Is used for tracking execution ...
Definition: tracker.h:19
void make_log()
opens file where all the data is dumped
Definition: tracker.cpp:85
virtual TrackingResult get_transform(const Task &t, const CoordinateContainer &pts, const std::vector< BodyFeatures > &objects)
Definition: tracker.cpp:3
virtual void on_new_task(const Task &task, const Task &goal)=0
Called every time a new task is created.
virtual TrackingResult track(const Task &t, const CoordinateContainer &pts, const std::vector< BodyFeatures > &objects)=0
Tracks task execution.
virtual void on_new_reading(const Task &goal, const Task &task)
Called every time a new reading is available.
Definition: tracker.h:71
Given points, makes rotated bounding box.
std::set< Pointf > CoordinateContainer
container for LIDAR coordinates
Definition: sensor.h:61
Definition: disturbance.h:47
Definition: disturbance.h:113
Hybrid states in the transition system.
Definition: graphTools.h:69