Fawkes API  Fawkes Development Version
RollCalibration Class Reference

#include "roll_calibration.h"

Inheritance diagram for RollCalibration:

Public Member Functions

 RollCalibration (LaserInterface *laser, fawkes::tf::Transformer *tf_transformer, fawkes::NetworkConfiguration *config, std::string config_path)
 Constructor. More...
 
virtual void calibrate ()
 The actual calibration. More...
 
- Public Member Functions inherited from LaserCalibration
 LaserCalibration (LaserInterface *laser, fawkes::tf::Transformer *tf_transformer, fawkes::NetworkConfiguration *config, std::string config_path)
 Constructor. More...
 
virtual ~LaserCalibration ()
 Destructor. More...
 

Protected Member Functions

float get_lr_mean_diff ()
 Get the difference of the mean of z of the left and right pointclouds. More...
 
float get_new_roll (float mean_error, float old_roll)
 Compute a new roll angle based on the mean error and the old roll. More...
 
PointCloudPtr filter_calibration_cloud (PointCloudPtr input)
 Filter the input cloud to be useful for roll calibration. More...
 
- Protected Member Functions inherited from LaserCalibration
PointCloudPtr laser_to_pointcloud (const LaserInterface &laser)
 Convert the laser data into a pointcloud. More...
 
void transform_pointcloud (const std::string &target_frame, PointCloudPtr cloud)
 Transform the points in a pointcloud. More...
 
PointCloudPtr filter_cloud_in_rear (PointCloudPtr input)
 Remove points in the rear of the robot. More...
 
float get_mean_z (PointCloudPtr cloud)
 Compute the mean z value of all points in the given pointcloud. More...
 
PointCloudPtr filter_left_cloud (PointCloudPtr input)
 Remove all points that are left of the robot. More...
 
PointCloudPtr filter_right_cloud (PointCloudPtr input)
 Remove all points that are right of the robot. More...
 
PointCloudPtr filter_out_ground (PointCloudPtr input)
 Remove all points that belong to the ground. More...
 
float get_matching_cost (PointCloudPtr cloud1, PointCloudPtr cloud2, float *rot_yaw)
 Compare two pointclouds with ICP. More...
 
PointCloudPtr filter_center_cloud (PointCloudPtr input)
 Remove the center of a pointcloud This removes all points around the origin of the pointcloud. More...
 

Static Protected Attributes

constexpr static float threshold = 0.00001
 The threshold of the left-right difference to stop calibration. More...
 
- Static Protected Attributes inherited from LaserCalibration
const static long sleep_time_ = 50000
 Time in micro seconds to sleep between iterations. More...
 
const static uint max_iterations_ = 100
 The number of iterations to run before aborting the calibration. More...
 
const static size_t min_points = 10
 The number of points required in a pointcloud to use it as input data. More...
 

Additional Inherited Members

- Protected Attributes inherited from LaserCalibration
LaserInterfacelaser_
 The laser that provides the input data. More...
 
fawkes::tf::Transformertf_transformer_
 The transformer used to compute transforms. More...
 
fawkes::NetworkConfigurationconfig_
 The network config to use for reading and updating config values. More...
 
const std::string config_path_
 The config path to use for reading and updating config values. More...
 

Detailed Description

Calibrate the roll angle of a laser. This is done by splitting the pointcloud in the rear of the robot into a left and a right cloud, and comparing the mean z of both clouds.

Author
Till Hofmann

Definition at line 26 of file roll_calibration.h.

Constructor & Destructor Documentation

◆ RollCalibration()

RollCalibration::RollCalibration ( LaserInterface laser,
fawkes::tf::Transformer tf_transformer,
fawkes::NetworkConfiguration config,
std::string  config_path 
)

Constructor.

Parameters
laserThe laser to get the data from
tf_transformerThe transformer to use to compute transforms
configThe network config to read from and write the time offset to
config_pathThe config path to read from and write the time offset to

Definition at line 47 of file roll_calibration.cpp.

Member Function Documentation

◆ calibrate()

void RollCalibration::calibrate ( )
virtual

The actual calibration.

Iteratively run the calibration until a good roll angle has been found. The new value is written to the config in each iteration.

Implements LaserCalibration.

Definition at line 60 of file roll_calibration.cpp.

References LaserCalibration::config_, LaserCalibration::config_path_, fawkes::NetworkConfiguration::get_float(), get_lr_mean_diff(), get_new_roll(), LaserCalibration::max_iterations_, fawkes::NetworkConfiguration::set_float(), LaserCalibration::sleep_time_, threshold, and fawkes::Exception::what_no_backtrace().

◆ filter_calibration_cloud()

PointCloudPtr RollCalibration::filter_calibration_cloud ( PointCloudPtr  input)
protected

Filter the input cloud to be useful for roll calibration.

Parameters
inputThe pointcloud to filter
Returns
The same as the input but without NaN points

Definition at line 130 of file roll_calibration.cpp.

Referenced by get_lr_mean_diff().

◆ get_lr_mean_diff()

float RollCalibration::get_lr_mean_diff ( )
protected

◆ get_new_roll()

float RollCalibration::get_new_roll ( float  mean_error,
float  old_roll 
)
protected

Compute a new roll angle based on the mean error and the old roll.

Parameters
mean_errorThe mean difference between the left and right cloud
old_rollThe roll angle used to get the data
Returns
A new roll angle

Definition at line 120 of file roll_calibration.cpp.

Referenced by calibrate().

Member Data Documentation

◆ threshold

constexpr static float RollCalibration::threshold = 0.00001
staticconstexprprotected

The threshold of the left-right difference to stop calibration.

Definition at line 49 of file roll_calibration.h.

Referenced by calibrate().


The documentation for this class was generated from the following files: