Revised for integration

Dependencies:   QEI2 chair_BNO055 PID VL53L1X_Filter

Files at this revision

API Documentation at this revision

Comitter:
t1jain
Date:
Wed Jun 26 18:20:11 2019 +0000
Parent:
22:fb99cce6b9b5
Commit message:
Revised for integration

Changed in this revision

ros_lib_kinetic.lib Show diff for this revision Revisions of this file
wheelchair.cpp Show annotated file Show diff for this revision Revisions of this file
wheelchair.h Show annotated file Show diff for this revision Revisions of this file
--- a/ros_lib_kinetic.lib	Fri Apr 19 23:06:53 2019 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-https://developer.mbed.org/users/garyservin/code/ros_lib_kinetic/#a849bf78d77f
--- a/wheelchair.cpp	Fri Apr 19 23:06:53 2019 +0000
+++ b/wheelchair.cpp	Wed Jun 26 18:20:11 2019 +0000
@@ -12,6 +12,8 @@
 
 double dist_old, curr_pos;                                                             // Variables for odometry position
 
+DigitalOut signal(D5);
+DigitalIn button(D4, PullDown);
  
 PID myPID(&pid_yaw, &Output, &Setpoint, 5.5, .00, 0.0036, P_ON_E, DIRECT);             // Angle PID object constructor
 PID myPIDDistance(&Input, &Output, &Setpoint, 5.5, .00, 0.002, P_ON_E, DIRECT);        // Distance PID object constructor
@@ -35,6 +37,26 @@
     curr_pos = wheel->getDistance(53.975);
 }
 
+void Wheelchair::emergencyButton_thread () {
+    while(1) {
+        signal = 0;
+        while(!button) {
+                    
+            //Send something to stop wheelchair
+            signal = 1;
+            
+            printf("Hello there!\n");
+            printf("I'm dead\n\n\n");
+            
+            //Reset Board
+            NVIC_SystemReset();
+
+        }
+    
+    }
+}
+
+
 void Wheelchair::assistSafe_thread()
 {
     int ToFV[12];
--- a/wheelchair.h	Fri Apr 19 23:06:53 2019 +0000
+++ b/wheelchair.h	Wed Jun 26 18:20:11 2019 +0000
@@ -74,6 +74,8 @@
     void velocity_thread();
     void rosCom_thread();
     void assistSafe_thread();
+    
+    void emergencyButton_thread();
 
     
     /* Move x millimiters foward using PID*/