Classes | Public Member Functions | Public Attributes | List of all members
diffbot::BaseController< TMotorController, TMotorDriver >::UpdateRate Struct Reference

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

Periodperiod ()
 
 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_
 

Detailed Description

template<typename TMotorController, typename TMotorDriver>
struct diffbot::BaseController< TMotorController, TMotorDriver >::UpdateRate

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.

Constructor & Destructor Documentation

◆ UpdateRate()

template<typename TMotorController , typename TMotorDriver >
diffbot::BaseController< TMotorController, TMotorDriver >::UpdateRate::UpdateRate ( double  imu_frequency,
double  control_frequency,
double  debug_frequency 
)
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.

Parameters
imu_frequencyDefines how often the imu is read and published.
control_frequencyDefines how ofthen the control block is run (reading encoders and writing motor commands).
debug_frequencyDefines how often debug messages are output.

Definition at line 139 of file base_controller.h.

Member Function Documentation

◆ period()

template<typename TMotorController , typename TMotorDriver >
Period& diffbot::BaseController< TMotorController, TMotorDriver >::UpdateRate::period ( )
inline

Definition at line 126 of file base_controller.h.

Member Data Documentation

◆ control_

template<typename TMotorController , typename TMotorDriver >
double diffbot::BaseController< TMotorController, TMotorDriver >::UpdateRate::control_

Definition at line 106 of file base_controller.h.

◆ debug_

template<typename TMotorController , typename TMotorDriver >
double diffbot::BaseController< TMotorController, TMotorDriver >::UpdateRate::debug_

Definition at line 107 of file base_controller.h.

◆ imu_

template<typename TMotorController , typename TMotorDriver >
double diffbot::BaseController< TMotorController, TMotorDriver >::UpdateRate::imu_

Definition at line 105 of file base_controller.h.

◆ period_

template<typename TMotorController , typename TMotorDriver >
struct diffbot::BaseController::UpdateRate::Period diffbot::BaseController< TMotorController, TMotorDriver >::UpdateRate::period_

The documentation for this struct was generated from the following file:


diffbot_base
Author(s):
autogenerated on Thu Sep 7 2023 02:35:23