Fawkes API Fawkes Development Version
yaw_calibration.h
1/***************************************************************************
2 * yaw_calibration.h - Calibrate yaw transform of the back laser
3 *
4 * Created: Tue 18 Jul 2017 16:58:12 CEST 16:58
5 * Copyright 2017 Till Hofmann <hofmann@kbsg.rwth-aachen.de>
6 ****************************************************************************/
7
8/* This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Library General Public License for more details.
17 *
18 * Read the full text in the LICENSE.GPL file in the doc directory.
19 */
20
21#ifndef YAW_CALIBRATION_H
22#define YAW_CALIBRATION_H
23
24#include "laser_calibration.h"
25
26#include <random>
27
29{
30public:
32 LaserInterface * front_laser,
33 fawkes::tf::Transformer * tf_transformer,
35 std::string config_path);
36 virtual void calibrate();
37
38protected:
39 float get_current_cost(float *new_yaw);
40 float get_new_yaw(float current_cost, float last_yaw);
41
42protected:
43 /** The laser interface used to read the front laser data from */
45 /** The initial step size */
46 const float init_step_ = 0.02;
47 /** The current step size */
48 float step_;
49 /** Random number generator used to compute the random reset probability */
50 std::mt19937 random_generator_;
51 /** The distribution used to compute the random reset probability */
52 std::uniform_real_distribution<float> random_float_dist_;
53 /** A map of yaw config values to costs */
54 std::map<float, float> costs_;
55 /** The minimal cost */
56 float min_cost_;
57 /** A yaw configuration with the minimal cost */
59};
60
61#endif /* !YAW_CALIBRATION_H */
Abstract base class for laser calibration.
Calibrate the yaw angle of the back laser using the front laser.
float get_new_yaw(float current_cost, float last_yaw)
Compute the new yaw.
std::map< float, float > costs_
A map of yaw config values to costs.
float min_cost_yaw_
A yaw configuration with the minimal cost.
float step_
The current step size.
std::mt19937 random_generator_
Random number generator used to compute the random reset probability.
const float init_step_
The initial step size.
std::uniform_real_distribution< float > random_float_dist_
The distribution used to compute the random reset probability.
float get_current_cost(float *new_yaw)
Get the cost of the current configuration.
LaserInterface * front_laser_
The laser interface used to read the front laser data from.
YawCalibration(LaserInterface *laser, LaserInterface *front_laser, fawkes::tf::Transformer *tf_transformer, fawkes::NetworkConfiguration *config, std::string config_path)
Constructor.
float min_cost_
The minimal cost.
virtual void calibrate()
The actual calibration.
Laser360Interface Fawkes BlackBoard Interface.
Remote configuration via Fawkes net.
Definition: netconf.h:50
Coordinate transforms between any two frames in a system.
Definition: transformer.h:65