96 bool init(){
return true; }
97 bool isEnabled()
const {
return is_enabled; }
98 bool canRun()
const {
return can_run; }
100 void enable() { modeShift(
"enable"); }
101 void disable() { modeShift(
"disable"); }
102 void modeShift(
const std::string& mode);
104 void update(
const std::vector<unsigned char> &signal
105 ,
const unsigned char &bumper
106 ,
const unsigned char &charger
107 ,
const ecl::linear_algebra::Vector3d &pose);
109 void velocityCommands(
const double &vx,
const double &wz);
114 double getVX()
const {
return vx; }
115 double getWZ()
const {
return wz; }
120 RobotDockingState::State getState()
const {
return state; }
121 std::string getStateStr()
const {
return state_str; }
122 std::string getDebugStr()
const {
return debug_str; }
127 void setMinAbsV(
double mav) { min_abs_v = mav; }
128 void setMinAbsW(
double maw) { min_abs_w = maw; }
131 std::string getDebugStream() {
return debug_output; }
135 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
138 void processBumpChargeEvent(
const unsigned char& bumper,
const unsigned char& charger);
139 void computePoseUpdate(ecl::linear_algebra::Vector3d& pose_update,
const ecl::linear_algebra::Vector3d& pose);
140 void filterIRSensor(std::vector<unsigned char>& signal_filt,
const std::vector<unsigned char> &signal );
141 void generateDebugMessage(
const std::vector<unsigned char>& signal_filt,
const unsigned char &bumper,
const unsigned char &charger,
const std::string& debug_str);
142 void updateVelocity(
const std::vector<unsigned char>& signal_filt,
const ecl::linear_algebra::Vector3d& pose_update, std::string& debug_str);
143 RobotDockingState::State determineRobotLocation(
const std::vector<unsigned char>& signal_filt,
const unsigned char& charger);
144 bool validateSignal(
const std::vector<unsigned char>& signal_filt,
const unsigned int state);
148 void idle(RobotDockingState::State& state,
double& vx,
double& wz);
149 void scan(RobotDockingState::State& state,
double& vx,
double& wz,
const std::vector<unsigned char>& signal_filt,
const ecl::linear_algebra::Vector3d& pose_update, std::string& debug_str);
150 void find_stream(RobotDockingState::State& state,
double& vx,
double& wz,
const std::vector<unsigned char>& signal_filt);
151 void get_stream(RobotDockingState::State& state,
double& vx,
double& wz,
const std::vector<unsigned char>& signal_filt);
152 void aligned(RobotDockingState::State& state,
double& vx,
double& wz,
const std::vector<unsigned char>& signal_filt, std::string& debug_str);
153 void bumped(RobotDockingState::State& nstate,
double& nvx,
double& nwz,
int& bump_count);
157 bool is_enabled, can_run;
159 RobotDockingState::State state;
160 std::string state_str, debug_str;
162 std::vector<std::vector<unsigned char> > past_signals;
163 unsigned int signal_window;
170 ecl::linear_algebra::Vector3d pose_priv;
172 void setVel(
double v,
double w);
174 std::string binary(
unsigned char number)
const;
176 std::string debug_output;
177 std::vector<std::string> ROBOT_STATE_STR;
void update(const std::vector< unsigned char > &signal, const unsigned char &bumper, const unsigned char &charger, const ecl::linear_algebra::Vector3d &pose)
Updates the odometry from firmware stamps and encoders.
Definition dock_drive.cpp:89
void computePoseUpdate(ecl::linear_algebra::Vector3d &pose_update, const ecl::linear_algebra::Vector3d &pose)
compute pose update from previouse pose and current pose
Definition dock_drive.cpp:124
void filterIRSensor(std::vector< unsigned char > &signal_filt, const std::vector< unsigned char > &signal)
pushing into signal into signal window. and go through the signal window to find what has detected
Definition dock_drive.cpp:145