Stores update rate frequencies (Hz) for the main control loop, (optinal) imu and debug output. More...
#include <base_controller.h>
Classes | |
struct | Period |
Inverse of the update rates for control, (optional) imu and debug output. More... | |
Public Member Functions | |
Period & | period () |
UpdateRate (double imu_frequency, double control_frequency, double debug_frequency) | |
Construct a new Update Rate object. More... | |
Public Attributes | |
double | control_ |
double | debug_ |
double | imu_ |
struct diffbot::BaseController::UpdateRate::Period | period_ |
Stores update rate frequencies (Hz) for the main control loop, (optinal) imu and debug output.
The UpdateRate contains a nested strcut period_ T, which define the inverse of the rate T = 1/f HZ in seconds. The period (and indirectly the rate) is used together with last_update_time_ to compare if enought time elapsed for a new update. The comparison is done in the main loop (see, main.cpp).
Definition at line 103 of file base_controller.h.
|
inline |
Construct a new Update Rate object.
Using the frequency parameters imu_frequency
, control_frequency
and debug_frequency
the corresponding periods of period_ are initilized.
imu_frequency | Defines how often the imu is read and published. |
control_frequency | Defines how ofthen the control block is run (reading encoders and writing motor commands). |
debug_frequency | Defines how often debug messages are output. |
Definition at line 139 of file base_controller.h.
|
inline |
Definition at line 126 of file base_controller.h.
double diffbot::BaseController< TMotorController, TMotorDriver >::UpdateRate::control_ |
Definition at line 106 of file base_controller.h.
double diffbot::BaseController< TMotorController, TMotorDriver >::UpdateRate::debug_ |
Definition at line 107 of file base_controller.h.
double diffbot::BaseController< TMotorController, TMotorDriver >::UpdateRate::imu_ |
Definition at line 105 of file base_controller.h.
struct diffbot::BaseController::UpdateRate::Period diffbot::BaseController< TMotorController, TMotorDriver >::UpdateRate::period_ |