Page 1 of 1

matlab .m file in Crazyflie 2.0 flash

Posted: Mon Jun 15, 2020 11:37 pm
by Baosai
Hello, for my Master thesis I want to implement a Model Predictive Control for position and trajectory control on the Crazyflie using the lighthouse positioning deck. The controller is designed in Matlab, preferably it should be a nonlinear MPC. Is there a known framework to have an .m file compiled and then flashed on the Crazyflie so that the code doesnt have to be transformed manually?

Thanks in advance for your help!

Re: matlab .m file in Crazyflie 2.0 flash

Posted: Thu Jun 18, 2020 8:38 am
by tobias
I read a paper somewhere were they explained how to transfer simulink to c-code and run it on the Crazyflie. Can't remember where though, darn... This thread talks about it briefly. With some internet searching you might find it. What will not work is to run .m files on the Crazyflie. It needs to be converted to C.

Re: matlab .m file in Crazyflie 2.0 flash

Posted: Wed Jun 24, 2020 8:49 am
by wydmynd
its called matlab coder. It is an add-on that you have to buy.. I used it with other STM32 projects so technically it should be no problem with CF.

Re: matlab .m file in Crazyflie 2.0 flash

Posted: Wed Jun 24, 2020 9:13 am
by kristoffer
Thanks for the info!