Odometry communication
Dependencies: PID QEI chair_BNO055 ros_lib_kinetic3
Dependents: wheelchaircontrolrealtime1
Fork of wheelchaircontrol by
Diff: wheelchair.cpp
- Revision:
- 27:17783779a954
- Parent:
- 24:6c5b4b82f874
- Child:
- 28:889fc0e5f8c4
diff -r 6c5b4b82f874 -r 17783779a954 wheelchair.cpp --- a/wheelchair.cpp Fri Nov 02 02:15:30 2018 +0000 +++ b/wheelchair.cpp Fri Nov 02 21:52:29 2018 +0000 @@ -10,10 +10,7 @@ volatile double vInS, vOutS, vDesiredS; volatile double yIn, yOut, yDesired; -double z_angular, dist_old, curr_pos; -double x_position = 0; -double y_position = 0; - +double dist_old, curr_pos; PID myPID(&pid_yaw, &Output, &Setpoint, 5.5, .00, 0.0036, P_ON_E, DIRECT); // Angle PID object constructor @@ -50,6 +47,8 @@ } Wheelchair::Wheelchair(PinName xPin, PinName yPin, Serial* pc, Timer* time, QEI* qei, QEI* qeiS) // Function Constructor for Wheelchair class { + x_position = 0; + y_position = 0; //Initializes X and Y variables to Pins x = new PwmOut(xPin); y = new PwmOut(yPin);