Servers by jDrones

MATLAB Simulink GSoC 2020 SITL demo

I’m back doing GSoC again! This year I will be working improving the MATLAB / Simulink / ArduPilot workflow. I have added the ability to use MATLAB as a physics backend for SITL. This should allow for rapid prototyping of complex vehicle physics for those more used to the MATLAB environment.

If your using MATLAB or Simulink with ArduPilot I would love to know what we could do to improve the integration and speed up your development time.

9 Likes

Looking forward to testing this out! Looks very promising so far.
Indeed an amazing and very important feature to have in ArduPilot.

Great works! I’m looking forward to the next progress :smile:

@CGiraud summer new toy !

Matlab … Crap choice !

It’s amazing how often we get people popping in wanting to use Matlab.
It’s a tool that engineers are encouraged to learn.

Do you have a suggestion as to what people might use in place of it?

Octave has already been suggested, and apparently wouldn’t be too hard to
add support for after this stuff goes in.

1 Like

Yes octave but some modules are missing.
But if you think twice and think knowledge you will get, it’s better than matlab.

About employability after project is important as well IMO. Most of data scientist nowaday disagree with matlab and you will encounter more jobs with R and python for kind of similar project which requires matlab functionalities.
For me a better choice is a combo of multiple soft like Octave, Python, R and may be others depending on project like for example scilab. Far away better than this matlab …

It depends on university and what kind of project you do.
Simulink and Matlab are always top choice in control theory.

1 Like

Up to you, it’s a US only vision and you keep in mind only university purpose.
Other thing is sharing code with others at the end of project … Matlab is not really a thing to share worldwide especially in emerging country. Occidental minding need to be reconsidered

If you can do better, feel free to contribute.

2 Likes

Yes octave but some modules are missing.

Just for posterity - someone might come back and actually get Octave
working - which modules are those?

But if you think twice and think knowledge you will get, it’s better than matlab.

Honestly, my exposure to either of them is minimal. I know that if I just
wanted to play it would be handy for there to be Octave support,
obviously.

About employability after project is important as well IMO. Most of data scientist nowaday disagree with matlab and you will encounter more jobs with R
and python for kind of similar project which requires matlab functionalities.
For me a better choice is a combo of multiple soft like Octave, Python, R and may be others depending on project like for example scilab. Far away better
than this matlab …

Does R have the relevant plumbing to incorporate into this sort of thing?
What does the structure look like in this scenario?

It might amuse you to know that our simulations were originally all Python
based; while the current crop is C+±based, you can see the vestiges of
the Python sims around in places, and of course they’re in the git
history.

Peter

I made a attempt with Octave this afternoon, it doesn’t just work. A few formatting differences and the compiled C we call in MATLAB to do the network communications doesn’t work at all, might be a simple fix, might not. I didn’t spend long trying.

20-years ago on my math studies there was a clear division: for everything connected with statistics (now it’s called data science :slight_smile: S/R and everything else that requires matrix computations matlab/octive. Python was then used mainly for writing linux scripts (anything that couldn’t be done with shell scripts). Since I went more into applied statistics I lost contact with matlab. My impression is that matlab lost in popularity in favour of python just like R. So my question is what is so unique in matlab to make this integration. I mean, there are plenty of physics engines. I don’t know Simulink, I heard it’s mainly used in control models, but why? Are there some exclusive algos there, not available in open source or it’s just a matter of good design/habits/marketing :slight_smile: (kind of like SAS is still used in medicine). Just asking out of curiosity

1 Like

Lots of clever people use MATLAB, particularly at universitys. If we can help them integrate with AutoPilot hopefully it will lead more contributions back. All of ArduPilots EKF equations were derived and generated using MATLAB and that is also where some of the control systems were prototyped.

Ok, so it’s more like habits/legacy than unique features of matlab. As for EKF script this could probably be written in numpy as well :slight_smile:

1 Like

I wouldn’t say MATLAB has any absolutely unique features, however it does have lots of features that are relatively easy to use and all in a single bit of software. I cant think of any other tools that will allow you so simulate the full aerodynamics of a vehicle along with the electronics systems and RF propagation.

Of course other tools could have been used for the EKF but the point is that they weren’t. Should we help the EKF and Control system experts integrate there work done using MATLAB? or say come back when you have learned numpy?

This does not mean we should not support python at all, thanks to the backend I added to support MATLAB we now also support pybullet. The best thing about open source is we can support MATLAB and Python and R and whatever else.

The key thing is to make it easy for prospective developers to get up-to speed with ArduPilot using the tools that they are most comfortable with, hopefully this will result in more developers doing more cool stuff and everyone will benefit.

Or not, you will interest only university not public or private sector. I’m not sure that except in US, Europe, or Japan, they have access to Matlab …
There is a ton of pros and cons about matlab :

https://www.quora.com/Shouldnt-MATLAB-be-the-first-language-that-undergraduate-CS-students-learn-in-university

Numpy for example as you cite before is not hard to learn …

There are pro and cons on all languages…

Saying that private company aren’t interested in matlab for robotics work is a non sens…

Matlab interface was hightly demanded both from enterprises and universities and we are getting it. It doesn’t mean that other tools aren’t used or interesting but today that the one we want to support.

Now, if you want another binding on something you mastered, please contribute. If you got issues with a proprietary software, just don’t use it, we already got bidding for numerous others softwares

Ps: ArduPilot is a worldwide group and not restricted by US…

2 Likes

I work in a private company. We use Matlab.

1 Like

It’s just your opinion …
I’m not particularly interested in this topic just saying it’s not a good choice, just my opinion. Do what you want with this …

Servers by jDrones