![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Original Version of STM Board
Diff: main.cpp
- Revision:
- 162:9dd4f35e9de8
- Parent:
- 161:a3b26117104c
- Child:
- 163:ba1290eb0341
--- a/main.cpp Mon Oct 12 10:28:55 2020 +0000 +++ b/main.cpp Mon Oct 12 10:48:56 2020 +0000 @@ -380,35 +380,35 @@ else if(NN_Control_Flag == 1) { -// int ind = 0; -// for(int i=0; i<numpast_u; i++) { -// input_NN[ind] = u_past[time_interval*i]; -// ind = ind + 1; -// } -// -// for(int i=0; i<numpast_x; i++) { -// input_NN[ind] = x_past[time_interval*i] / 60.0f; + int ind = 0; + for(int i=0; i<numpast_u; i++) { + input_NN[ind] = u_past[time_interval*i]; + ind = ind + 1; + } + + for(int i=0; i<numpast_x; i++) { + input_NN[ind] = x_past[time_interval*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[time_interval*i+time_interval] / 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[time_interval*i+time_interval] / 60.0f; -//// ind = ind + 1; -//// } -// -// for(int i=0; i<numpast_f; i++) { -// input_NN[ind] = f_past[time_interval*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[time_interval*i+time_interval] - torq.sen)/10000.0f+0.5f; + + for(int i=0; i<numpast_f; i++) { + input_NN[ind] = f_past[time_interval*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[time_interval*i+time_interval] - torq.sen)/10000.0f+0.5f; // input_NN[ind] = (f_future[time_interval*i+time_interval])/10000.0f+0.5f; -// ind = ind + 1; -// } + ind = ind + 1; + } float output1[16] = { 0.0f }; float output2[16] = { 0.0f };