branch for tests with T265
Dependencies: Lib_Cntrl AHRS Lib_Misc
Revision 4:dc844fde64d7, committed 2019-11-22
- Comitter:
- Kiwicjam
- Date:
- Fri Nov 22 08:40:26 2019 +0000
- Parent:
- 3:bc24fee36ba3
- Commit message:
- Workin set, not running,
Changed in this revision
Threads_and_main/main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show diff for this revision Revisions of this file |
diff -r bc24fee36ba3 -r dc844fde64d7 Threads_and_main/main.cpp --- a/Threads_and_main/main.cpp Mon Oct 28 07:54:10 2019 +0000 +++ b/Threads_and_main/main.cpp Fri Nov 22 08:40:26 2019 +0000 @@ -23,6 +23,10 @@ #include "Data_Logger.h" #include "Read_Xtern_Sensors.h" +#include "RST265.h" +RawSerial rsUart(PA_2, PA_3, 115200); +RST265 rsdev(&rsUart); + // ---------------------------------------------------------------------------- // define IOs @@ -51,7 +55,7 @@ // ------ THREADS --- THREADS --- THREADS --- THREADS --- THREADS --- Controller_Loops controller(TsCntrl,4,4,true); // run ahrs within the controller Thread // controllers are not properly initialized at this point (esp limits)!!! -//AHRS ahrs(1,Ts100,true); +AHRS ahrs(1,Ts100,true); Read_Xtern_Sensors xternal_sensors(Ts50,&uart4lidar,&i2c); // read external sensors (OF, Lidar etc. QK_StateMachine main_statemachine(Ts50); // the main state machine Data_Logger my_datalogger(37,Ts50); // the data logger @@ -59,7 +63,28 @@ // MAIN MAIN MAIN MAIN MAIN MAIN MAIN MAIN // ----------------------------------------------------------------------------- int main() { - copter.calc_copter(); // calc the copter (length, etc) + // T265 test + pc.printf("\n\rSerial Test...%d\n", 115200); + DigitalIn button(USER_BUTTON); + + bool pushed = false; + while(1) { + // register button pressed and request data + if(!button && !pushed){ + pc.printf("\r\nsending request.."); + pushed = true; + rsdev.request(); + }else if (button && pushed){ + // reset button + pushed = false; + } + + if(rsdev.run()){ + // new data ready + pc.printf("\r\n received response"); + } + } + /*copter.calc_copter(); // calc the copter (length, etc) controller.set_controller_limits(copter); // finalize init function for controllers wait(.1); for(uint8_t k=0;k < copter.nb_motors;k++) @@ -87,6 +112,6 @@ //ahrs.start_loop(); // not needed if ahrs is called in controller (see Thread init of controller) wait(0.1); while(1) - wait(1); + wait(1);*/ }
diff -r bc24fee36ba3 -r dc844fde64d7 mbed.bld --- a/mbed.bld Mon Oct 28 07:54:10 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400 \ No newline at end of file