Sungwoo Kim
/
HydraulicControlBoard_PostLIGHT_210420
LIGHT2
Diff: main.cpp
- Revision:
- 117:7141c0517b82
- Parent:
- 116:ddc6e6fcfaf9
- Child:
- 118:af86e883dcb4
diff -r ddc6e6fcfaf9 -r 7141c0517b82 main.cpp --- a/main.cpp Mon Sep 14 00:30:55 2020 +0000 +++ b/main.cpp Mon Sep 14 01:01:10 2020 +0000 @@ -379,6 +379,36 @@ } else if(NN_Control_Flag == 1) { + + int ind = 0; + for(int i=0; i<numpast_u; i++) { + input_NN[ind] = u_past[2*i]; + ind = ind + 1; + } + + for(int i=0; i<numpast_x; i++) { + input_NN[ind] = x_past[2*i] / 60.0f; + ind = ind + 1; + } + input_NN[ind] = (pos.sen / ENC_PULSE_PER_POSITION) / 60.0f; + ind = ind + 1; +// for(int i=0;i<numfuture_x;i++){ +// input_NN[ind] = x_future[2*i+2] / 60.0f; +// ind = ind + 1; +// } + + for(int i=0; i<numpast_f; i++) { + input_NN[ind] = f_past[2*i] / 10000.0f + 0.5f; + ind = ind + 1; + } + input_NN[ind] = torq.sen / 10000.0f + 0.5f; + ind = ind + 1; + for(int i=0; i<numfuture_f; i++) { + input_NN[ind] = (f_future[2*i+2] - torq.sen)/10000.0f+0.5f; +// input_NN[ind] = (f_future[2*i+2])/10000.0f+0.5f; + ind = ind + 1; + } + float output1[16] = { 0.0f }; float output2[16] = { 0.0f }; float output3[16] = { 0.0f };