|
Fawkes API
Fawkes Development Version
|
Calibrate the pitch angle of the laser. More...
#include "pitch_calibration.h"

Public Member Functions | |
| PitchCalibration (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_new_pitch (float z, float old_pitch) |
| Compute the new pitch based on the old pitch and the mean z. 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.001 |
| The threshold of the mean of z to stop calibration. More... | |
Static Protected Attributes inherited from LaserCalibration | |
| static const long | sleep_time_ = 50000 |
| Time in micro seconds to sleep between iterations. More... | |
| static const uint | max_iterations_ = 100 |
| The number of iterations to run before aborting the calibration. More... | |
| static const 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 | |
| LaserInterface * | laser_ |
| The laser that provides the input data. More... | |
| fawkes::tf::Transformer * | tf_transformer_ |
| The transformer used to compute transforms. More... | |
| fawkes::NetworkConfiguration * | config_ |
| 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... | |
Calibrate the pitch angle of the laser.
Compute the angle by computing the mean z value of all points in the rear of the robot and update the angle accordingly.
Definition at line 26 of file pitch_calibration.h.
| PitchCalibration::PitchCalibration | ( | LaserInterface * | laser, |
| fawkes::tf::Transformer * | tf_transformer, | ||
| fawkes::NetworkConfiguration * | config, | ||
| std::string | config_path | ||
| ) |
Constructor.
| laser | The laser interface to fetch data from |
| tf_transformer | The transformer to use to compute transforms |
| config | The network config to read from and write updates to |
| config_path | The config path to read from and write updates to |
Definition at line 41 of file pitch_calibration.cpp.
|
virtual |
The actual calibration.
Apply the method continuously until the mean z reaches the threshold. Write the upated pitch angle to the config in each iteration.
Implements LaserCalibration.
Definition at line 54 of file pitch_calibration.cpp.
References LaserCalibration::config_, LaserCalibration::config_path_, LaserCalibration::filter_cloud_in_rear(), fawkes::NetworkConfiguration::get_float(), LaserCalibration::get_mean_z(), get_new_pitch(), LaserCalibration::laser_, LaserCalibration::laser_to_pointcloud(), fawkes::Interface::read(), fawkes::NetworkConfiguration::set_float(), LaserCalibration::sleep_time_, threshold, LaserCalibration::transform_pointcloud(), and fawkes::Exception::what_no_backtrace().
|
protected |
Compute the new pitch based on the old pitch and the mean z.
| z | The mean z value of all points in the rear of the robot. |
| old_pitch | The pitch that was configured when recording the mean z. |
Definition at line 87 of file pitch_calibration.cpp.
Referenced by calibrate().
|
staticconstexprprotected |
The threshold of the mean of z to stop calibration.
Definition at line 40 of file pitch_calibration.h.
Referenced by calibrate().