$search
00001 #ifndef _STDOUTCOMM_H_ 00002 #define _STDOUTCOMM_H_ 00003 00004 #include <iostream> 00005 00006 #include "comm.h" 00007 00008 class STDoutComm : public Comm 00009 { 00010 public: 00011 STDoutComm() : sum_ticks_a_(0), sum_ticks_b_(0) { } 00012 void send_odometry(double z, double x, double theta, double v_encoder, double v_encoder_angular, int wheel_a, int wheel_b, double v_encoder_left, double v_encoder_right) 00013 { 00014 std::cout << "Odometry: z: " << z << " x: " << x << " theta: " << theta << std::endl; 00015 std::cout << "Encoder: wheel_a: " << wheel_a << " wheel_b: " << wheel_b << std::endl; 00016 std::cout << "Encoder Speed: v_encoder: " << v_encoder << " v_encoder_angular: " << v_encoder_angular << std::endl; 00017 00018 sum_ticks_a_ += wheel_a; 00019 sum_ticks_b_ += wheel_b; 00020 v_encoder_ = v_encoder; 00021 v_encoder_left_ = v_encoder_left; 00022 v_encoder_right_ = v_encoder_right; 00023 } 00024 00025 void send_sonar_leftBack(int ir_left_back) 00026 { 00027 std::cout << "IR left back: " << ir_left_back << std::endl; 00028 } 00029 00030 void send_sonar_front_usound_leftFront_left(int ir_right_front, int usound, int ir_left_front, int ir_left) 00031 { 00032 std::cout << "IR right front: " << ir_right_front << std::endl; 00033 std::cout << "ultrasound front: " << usound << std::endl; 00034 std::cout << "IR left front: " << ir_left_front << std::endl; 00035 std::cout << "IR left: " << ir_left << std::endl; 00036 } 00037 00038 void send_sonar_back_rightBack_rightFront(int ir_back, int ir_right_back, int ir_right) 00039 { 00040 std::cout << "IR back: " << ir_back << std::endl; 00041 std::cout << "IR right back: " << ir_right_back << std::endl; 00042 std::cout << "IR right: " << ir_right << std::endl; 00043 } 00044 00045 void send_pitch_roll(double pitch, double roll) 00046 { 00047 std::cout << "pitch: " << pitch << " roll: " << roll << std::endl; 00048 } 00049 00050 void send_gyro(double theta, double sigma) 00051 { 00052 std::cout << "Gyro: theta: " << theta << " sigma: " << sigma << std::endl; 00053 } 00054 00055 void send_rotunit(double rot) 00056 { 00057 std::cout << "Rotunit" << rot << std::endl; 00058 } 00059 00060 unsigned long long K_get_sum_ticks_a() 00061 { 00062 return sum_ticks_a_; 00063 } 00064 00065 unsigned long long K_get_sum_ticks_b() 00066 { 00067 return sum_ticks_b_; 00068 } 00069 00070 double v1() 00071 { 00072 return v_encoder_; 00073 } 00074 00075 double v1_left() 00076 { 00077 return v_encoder_left_; 00078 } 00079 00080 double v1_right() 00081 { 00082 return v_encoder_right_; 00083 } 00084 00085 private: 00086 unsigned long long sum_ticks_a_; 00087 unsigned long long sum_ticks_b_; 00088 double v_encoder_; 00089 double v_encoder_left_, v_encoder_right_; 00090 }; 00091 00092 #endif