Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
kobuki::DockDrive Class Reference

#include <dock_drive.hpp>

Public Member Functions

bool canRun () const
 
void disable ()
 
 DockDrive ()
 
void enable ()
 
std::string getDebugStr () const
 
std::string getDebugStream ()
 
RobotDockingState::State getState () const
 
std::string getStateStr () const
 
double getVX () const
 
double getWZ () const
 
bool init ()
 
bool isEnabled () const
 
void modeShift (const std::string &mode)
 
void setMinAbsV (double mav)
 
void setMinAbsW (double maw)
 
void update (const std::vector< unsigned char > &signal, const unsigned char &bumper, const unsigned char &charger, const ecl::LegacyPose2D< double > &pose)
 Updates the odometry from firmware stamps and encoders. More...
 
void velocityCommands (const double &vx, const double &wz)
 
 ~DockDrive ()
 

Protected Member Functions

void aligned (RobotDockingState::State &state, double &vx, double &wz, const std::vector< unsigned char > &signal_filt, std::string &debug_str)
 
void bumped (RobotDockingState::State &nstate, double &nvx, double &nwz, int &bump_count)
 
void computePoseUpdate (ecl::LegacyPose2D< double > &pose_update, const ecl::LegacyPose2D< double > &pose)
 compute pose update from previouse pose and current pose More...
 
RobotDockingState::State determineRobotLocation (const std::vector< unsigned char > &signal_filt, const unsigned char &charger)
 
void filterIRSensor (std::vector< unsigned char > &signal_filt, const std::vector< unsigned char > &signal)
 
void find_stream (RobotDockingState::State &state, double &vx, double &wz, const std::vector< unsigned char > &signal_filt)
 
void generateDebugMessage (const std::vector< unsigned char > &signal_filt, const unsigned char &bumper, const unsigned char &charger, const ecl::LegacyPose2D< double > &pose_update, const std::string &debug_str)
 
void get_stream (RobotDockingState::State &state, double &vx, double &wz, const std::vector< unsigned char > &signal_filt)
 
void idle (RobotDockingState::State &state, double &vx, double &wz)
 
void processBumpChargeEvent (const unsigned char &bumper, const unsigned char &charger)
 
void scan (RobotDockingState::State &state, double &vx, double &wz, const std::vector< unsigned char > &signal_filt, const ecl::LegacyPose2D< double > &pose_update, std::string &debug_str)
 
void updateVelocity (const std::vector< unsigned char > &signal_filt, const ecl::LegacyPose2D< double > &pose_update, std::string &debug_str)
 
bool validateSignal (const std::vector< unsigned char > &signal_filt, const unsigned int state)
 

Private Member Functions

std::string binary (unsigned char number) const
 
void setVel (double v, double w)
 

Private Attributes

int bump_remainder
 
bool can_run
 
std::string debug_output
 
std::string debug_str
 
int dock_detector
 
int dock_stabilizer
 
bool is_enabled
 
double min_abs_v
 
double min_abs_w
 
std::vector< std::vector< unsigned char > > past_signals
 
ecl::LegacyPose2D< double > pose_priv
 
std::vector< std::string > ROBOT_STATE_STR
 
double rotated
 
unsigned int signal_window
 
RobotDockingState::State state
 
std::string state_str
 
double vx
 
double wz
 

Detailed Description

Definition at line 72 of file dock_drive.hpp.

Constructor & Destructor Documentation

◆ DockDrive()

kobuki::DockDrive::DockDrive ( )

Definition at line 60 of file dock_drive.cpp.

◆ ~DockDrive()

kobuki::DockDrive::~DockDrive ( )

Definition at line 90 of file dock_drive.cpp.

Member Function Documentation

◆ aligned()

void kobuki::DockDrive::aligned ( RobotDockingState::State state,
double &  vx,
double &  wz,
const std::vector< unsigned char > &  signal_filt,
std::string &  debug_str 
)
protected

Definition at line 250 of file dock_drive_states.cpp.

◆ binary()

std::string kobuki::DockDrive::binary ( unsigned char  number) const
private

Definition at line 102 of file dock_drive_debug.cpp.

◆ bumped()

void kobuki::DockDrive::bumped ( RobotDockingState::State nstate,
double &  nvx,
double &  nwz,
int &  bump_count 
)
protected

Definition at line 321 of file dock_drive_states.cpp.

◆ canRun()

bool kobuki::DockDrive::canRun ( ) const
inline

Definition at line 87 of file dock_drive.hpp.

◆ computePoseUpdate()

void kobuki::DockDrive::computePoseUpdate ( ecl::LegacyPose2D< double > &  pose_update,
const ecl::LegacyPose2D< double > &  pose 
)
protected

compute pose update from previouse pose and current pose

Parameters
poseupdate. this variable get filled after this function
pose- current pose

Definition at line 151 of file dock_drive.cpp.

◆ determineRobotLocation()

RobotDockingState::State kobuki::DockDrive::determineRobotLocation ( const std::vector< unsigned char > &  signal_filt,
const unsigned char &  charger 
)
protected

◆ disable()

void kobuki::DockDrive::disable ( )
inline

Definition at line 90 of file dock_drive.hpp.

◆ enable()

void kobuki::DockDrive::enable ( )
inline

Definition at line 89 of file dock_drive.hpp.

◆ filterIRSensor()

void kobuki::DockDrive::filterIRSensor ( std::vector< unsigned char > &  signal_filt,
const std::vector< unsigned char > &  signal 
)
protected

@breif pushing into signal into signal window. and go through the signal window to find what has detected

Parameters
signal_filt- this get filled out after the function.
signal- the raw data from robot

Definition at line 170 of file dock_drive.cpp.

◆ find_stream()

void kobuki::DockDrive::find_stream ( RobotDockingState::State state,
double &  vx,
double &  wz,
const std::vector< unsigned char > &  signal_filt 
)
protected

Definition at line 149 of file dock_drive_states.cpp.

◆ generateDebugMessage()

void kobuki::DockDrive::generateDebugMessage ( const std::vector< unsigned char > &  signal_filt,
const unsigned char &  bumper,
const unsigned char &  charger,
const ecl::LegacyPose2D< double > &  pose_update,
const std::string &  debug_str 
)
protected

Definition at line 50 of file dock_drive_debug.cpp.

◆ get_stream()

void kobuki::DockDrive::get_stream ( RobotDockingState::State state,
double &  vx,
double &  wz,
const std::vector< unsigned char > &  signal_filt 
)
protected

Definition at line 199 of file dock_drive_states.cpp.

◆ getDebugStr()

std::string kobuki::DockDrive::getDebugStr ( ) const
inline

Definition at line 111 of file dock_drive.hpp.

◆ getDebugStream()

std::string kobuki::DockDrive::getDebugStream ( )
inline

Definition at line 120 of file dock_drive.hpp.

◆ getState()

RobotDockingState::State kobuki::DockDrive::getState ( ) const
inline

Definition at line 109 of file dock_drive.hpp.

◆ getStateStr()

std::string kobuki::DockDrive::getStateStr ( ) const
inline

Definition at line 110 of file dock_drive.hpp.

◆ getVX()

double kobuki::DockDrive::getVX ( ) const
inline

Definition at line 103 of file dock_drive.hpp.

◆ getWZ()

double kobuki::DockDrive::getWZ ( ) const
inline

Definition at line 104 of file dock_drive.hpp.

◆ idle()

void kobuki::DockDrive::idle ( RobotDockingState::State state,
double &  vx,
double &  wz 
)
protected

Definition at line 65 of file dock_drive_states.cpp.

◆ init()

bool kobuki::DockDrive::init ( )
inline

Definition at line 85 of file dock_drive.hpp.

◆ isEnabled()

bool kobuki::DockDrive::isEnabled ( ) const
inline

Definition at line 86 of file dock_drive.hpp.

◆ modeShift()

void kobuki::DockDrive::modeShift ( const std::string &  mode)

Definition at line 98 of file dock_drive.cpp.

◆ processBumpChargeEvent()

void kobuki::DockDrive::processBumpChargeEvent ( const unsigned char &  bumper,
const unsigned char &  charger 
)
protected

Definition at line 201 of file dock_drive.cpp.

◆ scan()

void kobuki::DockDrive::scan ( RobotDockingState::State state,
double &  vx,
double &  wz,
const std::vector< unsigned char > &  signal_filt,
const ecl::LegacyPose2D< double > &  pose_update,
std::string &  debug_str 
)
protected

Definition at line 82 of file dock_drive_states.cpp.

◆ setMinAbsV()

void kobuki::DockDrive::setMinAbsV ( double  mav)
inline

Definition at line 116 of file dock_drive.hpp.

◆ setMinAbsW()

void kobuki::DockDrive::setMinAbsW ( double  maw)
inline

Definition at line 117 of file dock_drive.hpp.

◆ setVel()

void kobuki::DockDrive::setVel ( double  v,
double  w 
)
private

Definition at line 92 of file dock_drive.cpp.

◆ update()

void kobuki::DockDrive::update ( const std::vector< unsigned char > &  signal,
const unsigned char &  bumper,
const unsigned char &  charger,
const ecl::LegacyPose2D< double > &  pose 
)

Updates the odometry from firmware stamps and encoders.

Really horrible - could do with an overhaul.

Parameters
dock_irsignal
bumpersensor
chargersensor
currentpose

Definition at line 117 of file dock_drive.cpp.

◆ updateVelocity()

void kobuki::DockDrive::updateVelocity ( const std::vector< unsigned char > &  signal_filt,
const ecl::LegacyPose2D< double > &  pose_update,
std::string &  debug_str 
)
protected

Definition at line 241 of file dock_drive.cpp.

◆ validateSignal()

bool kobuki::DockDrive::validateSignal ( const std::vector< unsigned char > &  signal_filt,
const unsigned int  state 
)
protected

Definition at line 291 of file dock_drive.cpp.

◆ velocityCommands()

void kobuki::DockDrive::velocityCommands ( const double &  vx,
const double &  wz 
)

Definition at line 187 of file dock_drive.cpp.

Member Data Documentation

◆ bump_remainder

int kobuki::DockDrive::bump_remainder
private

Definition at line 153 of file dock_drive.hpp.

◆ can_run

bool kobuki::DockDrive::can_run
private

Definition at line 146 of file dock_drive.hpp.

◆ debug_output

std::string kobuki::DockDrive::debug_output
private

Definition at line 165 of file dock_drive.hpp.

◆ debug_str

std::string kobuki::DockDrive::debug_str
private

Definition at line 149 of file dock_drive.hpp.

◆ dock_detector

int kobuki::DockDrive::dock_detector
private

Definition at line 155 of file dock_drive.hpp.

◆ dock_stabilizer

int kobuki::DockDrive::dock_stabilizer
private

Definition at line 154 of file dock_drive.hpp.

◆ is_enabled

bool kobuki::DockDrive::is_enabled
private

Definition at line 146 of file dock_drive.hpp.

◆ min_abs_v

double kobuki::DockDrive::min_abs_v
private

Definition at line 157 of file dock_drive.hpp.

◆ min_abs_w

double kobuki::DockDrive::min_abs_w
private

Definition at line 158 of file dock_drive.hpp.

◆ past_signals

std::vector<std::vector<unsigned char> > kobuki::DockDrive::past_signals
private

Definition at line 151 of file dock_drive.hpp.

◆ pose_priv

ecl::LegacyPose2D<double> kobuki::DockDrive::pose_priv
private

Definition at line 159 of file dock_drive.hpp.

◆ ROBOT_STATE_STR

std::vector<std::string> kobuki::DockDrive::ROBOT_STATE_STR
private

Definition at line 166 of file dock_drive.hpp.

◆ rotated

double kobuki::DockDrive::rotated
private

Definition at line 156 of file dock_drive.hpp.

◆ signal_window

unsigned int kobuki::DockDrive::signal_window
private

Definition at line 152 of file dock_drive.hpp.

◆ state

RobotDockingState::State kobuki::DockDrive::state
private

Definition at line 148 of file dock_drive.hpp.

◆ state_str

std::string kobuki::DockDrive::state_str
private

Definition at line 149 of file dock_drive.hpp.

◆ vx

double kobuki::DockDrive::vx
private

Definition at line 150 of file dock_drive.hpp.

◆ wz

double kobuki::DockDrive::wz
private

Definition at line 150 of file dock_drive.hpp.


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


kobuki_dock_drive
Author(s): Younghun Ju
autogenerated on Wed Mar 2 2022 00:26:13