Public Member Functions | Public Attributes | Private Member Functions | List of all members
openrover::OdomControl Class Reference

#include <odom_control.hpp>

Public Member Functions

 OdomControl ()
 
 OdomControl (bool use_control, PidGains pid_gains, int max, int min, std::string log_filename)
 
 OdomControl (bool use_control, PidGains pid_gains, int max, int min)
 
void reset ()
 
unsigned char run (bool e_stop_on, bool control_on, double commanded_vel, double measured_vel, double dt)
 
void start (bool use_control, PidGains pid_gains, int max, int min)
 

Public Attributes

bool at_max_motor_speed_
 
bool at_min_motor_speed_
 
unsigned char deadband_offset_
 
bool enable_file_logging_
 
std::ofstream fs_
 
double integral_value_
 
double K_D_
 
double K_I_
 
double K_P_
 
std::string log_filename_
 
const double MAX_ACCEL_CUTOFF_
 
const double MAX_VELOCITY_
 
const double MIN_VELOCITY_
 
const int MOTOR_DEADBAND_
 
const int MOTOR_MAX_
 
const int MOTOR_MIN_
 
int motor_speed_
 
bool skip_measurement_
 
bool stop_integrating_
 
bool use_control_
 
double velocity_commanded_
 
bool velocity_control_on_
 
double velocity_error_
 
double velocity_filtered_
 
std::vector< double > velocity_history_
 
double velocity_measured_
 

Private Member Functions

int boundMotorSpeed (int motor_speed, int max, int min)
 
double D (double error, double dt)
 
int deadbandOffset (int motor_speed, int deadband_offset)
 
int feedThroughControl ()
 
double filter (double left_motor_vel, double dt)
 
bool hasZeroHistory (const std::vector< double > &vel_history)
 
double I (double error, double dt)
 
double P (double error, double dt)
 
int PID (double error, double dt)
 
void velocityController ()
 

Detailed Description

Definition at line 11 of file odom_control.hpp.

Constructor & Destructor Documentation

openrover::OdomControl::OdomControl ( )

Definition at line 21 of file odom_control.cpp.

openrover::OdomControl::OdomControl ( bool  use_control,
PidGains  pid_gains,
int  max,
int  min,
std::string  log_filename 
)

Definition at line 39 of file odom_control.cpp.

openrover::OdomControl::OdomControl ( bool  use_control,
PidGains  pid_gains,
int  max,
int  min 
)

Definition at line 59 of file odom_control.cpp.

Member Function Documentation

int openrover::OdomControl::boundMotorSpeed ( int  motor_speed,
int  max,
int  min 
)
private

Definition at line 197 of file odom_control.cpp.

double openrover::OdomControl::D ( double  error,
double  dt 
)
private

Definition at line 168 of file odom_control.cpp.

int openrover::OdomControl::deadbandOffset ( int  motor_speed,
int  deadband_offset 
)
private

Definition at line 216 of file odom_control.cpp.

int openrover::OdomControl::feedThroughControl ( )
private

Definition at line 129 of file odom_control.cpp.

double openrover::OdomControl::filter ( double  left_motor_vel,
double  dt 
)
private

Definition at line 229 of file odom_control.cpp.

bool openrover::OdomControl::hasZeroHistory ( const std::vector< double > &  vel_history)
private

Definition at line 188 of file odom_control.cpp.

double openrover::OdomControl::I ( double  error,
double  dt 
)
private

Definition at line 173 of file odom_control.cpp.

double openrover::OdomControl::P ( double  error,
double  dt 
)
private

Definition at line 182 of file odom_control.cpp.

int openrover::OdomControl::PID ( double  error,
double  dt 
)
private

Definition at line 146 of file odom_control.cpp.

void openrover::OdomControl::reset ( )

Definition at line 134 of file odom_control.cpp.

unsigned char openrover::OdomControl::run ( bool  e_stop_on,
bool  control_on,
double  commanded_vel,
double  measured_vel,
double  dt 
)

Definition at line 86 of file odom_control.cpp.

void openrover::OdomControl::start ( bool  use_control,
PidGains  pid_gains,
int  max,
int  min 
)

Definition at line 14 of file odom_control.cpp.

void openrover::OdomControl::velocityController ( )
private

Member Data Documentation

bool openrover::OdomControl::at_max_motor_speed_

Definition at line 37 of file odom_control.hpp.

bool openrover::OdomControl::at_min_motor_speed_

Definition at line 38 of file odom_control.hpp.

unsigned char openrover::OdomControl::deadband_offset_

Definition at line 55 of file odom_control.hpp.

bool openrover::OdomControl::enable_file_logging_

Definition at line 33 of file odom_control.hpp.

std::ofstream openrover::OdomControl::fs_

Definition at line 44 of file odom_control.hpp.

double openrover::OdomControl::integral_value_

Definition at line 50 of file odom_control.hpp.

double openrover::OdomControl::K_D_

Definition at line 49 of file odom_control.hpp.

double openrover::OdomControl::K_I_

Definition at line 48 of file odom_control.hpp.

double openrover::OdomControl::K_P_

Definition at line 47 of file odom_control.hpp.

std::string openrover::OdomControl::log_filename_

Definition at line 41 of file odom_control.hpp.

const double openrover::OdomControl::MAX_ACCEL_CUTOFF_

Definition at line 29 of file odom_control.hpp.

const double openrover::OdomControl::MAX_VELOCITY_

Definition at line 31 of file odom_control.hpp.

const double openrover::OdomControl::MIN_VELOCITY_

Definition at line 30 of file odom_control.hpp.

const int openrover::OdomControl::MOTOR_DEADBAND_

Definition at line 27 of file odom_control.hpp.

const int openrover::OdomControl::MOTOR_MAX_

Definition at line 25 of file odom_control.hpp.

const int openrover::OdomControl::MOTOR_MIN_

Definition at line 26 of file odom_control.hpp.

int openrover::OdomControl::motor_speed_

Definition at line 54 of file odom_control.hpp.

bool openrover::OdomControl::skip_measurement_

Definition at line 63 of file odom_control.hpp.

bool openrover::OdomControl::stop_integrating_

Definition at line 39 of file odom_control.hpp.

bool openrover::OdomControl::use_control_

Definition at line 34 of file odom_control.hpp.

double openrover::OdomControl::velocity_commanded_

Definition at line 58 of file odom_control.hpp.

bool openrover::OdomControl::velocity_control_on_

Definition at line 62 of file odom_control.hpp.

double openrover::OdomControl::velocity_error_

Definition at line 51 of file odom_control.hpp.

double openrover::OdomControl::velocity_filtered_

Definition at line 60 of file odom_control.hpp.

std::vector<double> openrover::OdomControl::velocity_history_

Definition at line 61 of file odom_control.hpp.

double openrover::OdomControl::velocity_measured_

Definition at line 59 of file odom_control.hpp.


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


rr_openrover_basic
Author(s): Jack Kilian
autogenerated on Fri Jan 17 2020 03:18:17