Page 1 of 1
Pixhawk, Raspberry PI and SIMULINK model
Posted: Mon May 02, 2016 12:06 pm
by n0rmanUK
Hi,
Well, I wanna establish a connection between raspberry pi and pixhawk and then automate it, so that I can deploy a Simulink model that will constantly use pixhawk's variables.
Shall I install mavlink and mavconn to use C++ code to access the variables? I then hope for a SIMULINK model to use the data extracted by C++ .
I did research the topic and I am having a trouble with all this.
Any tips, please?
Many thanks!
Re: Pixhawk, Raspberry PI and SIMULINK model
Posted: Tue May 03, 2016 7:12 am
by n0rmanUK
Aren't there any people who have done or heard of something similar and could advise?
This is part of my university project. I really need help.
Re: Pixhawk, Raspberry PI and SIMULINK model
Posted: Tue May 03, 2016 9:10 am
by mthomason
Re: Pixhawk, Raspberry PI and SIMULINK model
Posted: Tue May 03, 2016 6:09 pm
by n0rmanUK
Thanks, but that doesn't work, because of some DroneApp changes or something.
Anyway I cannot get Python to work at all for whatever reason. I tried about 12 times strictly following the steps.
That is why I am on this forum, because I need help, not because I am lazy.
Any other suggestions? I will really appreciate any thoughts.
Re: Pixhawk, Raspberry PI and SIMULINK model
Posted: Tue May 03, 2016 8:57 pm
by DougieLawson
n0rmanUK wrote:
This is part of my university project. I really need help.
Isn't that the job of your tutor/professor? Isn't that what he/she is paid for?
Re: Pixhawk, Raspberry PI and SIMULINK model
Posted: Wed May 04, 2016 11:48 pm
by n0rmanUK
DougieLawson wrote:n0rmanUK wrote:
This is part of my university project. I really need help.
Isn't that the job of your tutor/professor? Isn't that what he/she is paid for?
Well, Is it my Professor's job to do my work for me? The answer is no.
I get your point, but it is my degree. Not his. It is a UK challenge for an autonomous quadcopter design. Our university doesn't specialise in Raspberry PIs etc. I have chosen it as a communicating device, because of its simplicity, which gives me pain for the last month.
Getting to the meritum. I got a python script to communicate with the Pixhawk. However, it takes 20 seconds to run. I thought it could be instantaneous. Especially, that I set to start the connection with the Pixhawk at the start-up of the Raspberry PI. My script uses connect command. And it takes a while.
Is there a way around it? Maybe you, DougieLawson know. You seem very experienced.
Thank you!
Re: Pixhawk, Raspberry PI and SIMULINK model
Posted: Thu May 05, 2016 8:25 am
by ghans
You would've gotten more help if you've said no Mathworks
tools are involved. Most people here neither have access
nor seem to be interested in supporting non-libre
"programming languages".
Alas , i guess it's too late now to rewrite those
parts of your project in C/C++/FORTRAN/Pascal ?
ghans
Re: Pixhawk, Raspberry PI and SIMULINK model
Posted: Thu May 05, 2016 11:25 am
by n0rmanUK
ghans wrote:You would've gotten more help if you've said no Mathworks
tools are involved. Most people here neither have access
nor seem to be interested in supporting non-libre
"programming languages".
Alas , i guess it's too late now to rewrite those
parts of your project in C/C++/FORTRAN/Pascal ?
ghans
Well we can ignore Mathworks tools for now. I just want to extract the values in a quick way. Let's assume I am saving the values to a text file that SIMULINK will access. Whatever. I just need to make this connection to work at a relatively fast pace.
It takes ages with the Ethernet port connected to the laptop for some reason.
It sends a lot of 'Waiting for the heartbeat' commands when running python in the SSH Linux window.
As I said I am using the connect command to connect to the pixhak. Any help?
Re: Pixhawk, Raspberry PI and SIMULINK model
Posted: Thu May 05, 2016 7:36 pm
by n0rmanUK
ghans wrote:You would've gotten more help if you've said no Mathworks
tools are involved. Most people here neither have access
nor seem to be interested in supporting non-libre
"programming languages".
Alas , i guess it's too late now to rewrite those
parts of your project in C/C++/FORTRAN/Pascal ?
ghans
Today morning I said Mathworks tool can be ignored and no one has replied yet. Literally any help will be good. I cannot make a python code to be quicker or stable to connect via MAvlink.
Re: Pixhawk, Raspberry PI and SIMULINK model
Posted: Fri May 06, 2016 5:58 am
by ghans
Re: Pixhawk, Raspberry PI and SIMULINK model
Posted: Fri May 06, 2016 1:16 pm
by n0rmanUK
That is interesting. I will try that. Many thanks for your help.
I also have seen some MAVCONN method for low latency C++ connection. I will also try that and report back.
I have tried the instructions that mthomason posted. I need to open 'sudo -s' and run:
Code: Select all
mavproxy.py --master=/dev/ttyAMA0 --baudrate 57600 --aircraft MyCopter
Then, I have to return to Linux command to run
to run my code. Then, it connects. My python code takes 20 seconds to connect obtain and override a parameter designated by me. I think this is too long for a simple operation.
Re: Pixhawk, Raspberry PI and SIMULINK model
Posted: Wed May 31, 2017 3:14 pm
by fernandofilhols
Hi Norman,
I am in a project in which I also need to have communication between Pixhawk and Raspberry Pi using Simulink Models. Did you have success in this task? Thanks in advance.
Fernando.