Working file for communication with ROS
Dependencies: QEI2 chair_BNO055 PID VL53L1X_Filter
Dependents: wheelchaircontrolrealRosCom
Diff: wheelchair.h
- Revision:
- 17:7f3b69300bb6
- Parent:
- 16:b403082eeacd
- Child:
- 19:71a6621ee5c3
diff -r b403082eeacd -r 7f3b69300bb6 wheelchair.h --- a/wheelchair.h Mon Aug 13 21:54:31 2018 +0000 +++ b/wheelchair.h Tue Aug 28 23:24:08 2018 +0000 @@ -2,10 +2,11 @@ #define wheelchair #include "chair_BNO055.h" -#include "PID_v1.h" +#include "PID.h" #include "QEI.h" #include <ros.h> #include <geometry_msgs/Twist.h> +//#include "BufferedSerial.h" //#include "chair_MPU9250.h" @@ -34,6 +35,7 @@ /** Wheelchair class * Used for controlling the smart wheelchair */ + class Wheelchair { public: @@ -77,6 +79,9 @@ /* function to get imu data*/ void compass_thread(); + void distance_thread(); + void pid_foward(double mm); + void pid_reverse(double mm); float getDistance(); void resetDistance(); void pid_turn(int deg); @@ -86,6 +91,7 @@ PwmOut* y; chair_BNO055* imu; Serial* out; + Timer* tim; Timer* ti; QEI* wheel;