Fawkes API  Fawkes Development Version
roll_calibration.h
1 /***************************************************************************
2  * roll_calibration.h - Calibrate roll transform of the back laser
3  *
4  * Created: Tue 18 Jul 2017 16:28:05 CEST 16:28
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 ROLL_CALIBRATION_H
22 #define ROLL_CALIBRATION_H
23 
24 #include "laser_calibration.h"
25 
26 class RollCalibration : public LaserCalibration
27 {
28 public:
30  fawkes::tf::Transformer * tf_transformer,
32  std::string config_path);
33 
34  virtual void calibrate();
35 
36 protected:
37  float get_lr_mean_diff();
38  float get_new_roll(float mean_error, float old_roll);
39  PointCloudPtr filter_calibration_cloud(PointCloudPtr input);
40 
41 protected:
42  // TODO: make threshold and min_points configurable
43  /** The threshold of the left-right difference to stop calibration */
44  constexpr static float threshold = 0.00001;
45 };
46 
47 #endif /* !ROLL_CALIBRATION_H */
RollCalibration::calibrate
virtual void calibrate()
The actual calibration.
Definition: roll_calibration.cpp:59
RollCalibration
Definition: roll_calibration.h:25
RollCalibration::filter_calibration_cloud
PointCloudPtr filter_calibration_cloud(PointCloudPtr input)
Filter the input cloud to be useful for roll calibration.
Definition: roll_calibration.cpp:129
fawkes::tf::Transformer
Definition: transformer.h:71
LaserCalibration
Definition: laser_calibration.h:65
RollCalibration::get_lr_mean_diff
float get_lr_mean_diff()
Get the difference of the mean of z of the left and right pointclouds.
Definition: roll_calibration.cpp:86
RollCalibration::threshold
constexpr static float threshold
The threshold of the left-right difference to stop calibration.
Definition: roll_calibration.h:47
fawkes::NetworkConfiguration
Definition: netconf.h:53
RollCalibration::RollCalibration
RollCalibration(LaserInterface *laser, fawkes::tf::Transformer *tf_transformer, fawkes::NetworkConfiguration *config, std::string config_path)
Constructor.
Definition: roll_calibration.cpp:46
RollCalibration::get_new_roll
float get_new_roll(float mean_error, float old_roll)
Compute a new roll angle based on the mean error and the old roll.
Definition: roll_calibration.cpp:119
fawkes::Laser360Interface
Definition: Laser360Interface.h:37