Solo control from PC

Joined
Mar 20, 2017
Messages
9
Reaction score
0
Age
33
I have developed an algorithm in matlab to control the 3dr solo drone from PC. Is tit possible to control the drone from my matlab model. I would like to control the drone by certain commands like takeoff , follow me mode and return home. Could you please help me in interfacing my matlab model with 3 dr solo drone. Can I use wifi (UDP protocol) to give commands from matlab to solo drone
 
Not sure if what you want to do is possible, but yes, others have run scripts to control the Solo. You might consider trying Mission Planner. It is a free PC program that will do everything with the Solo you can imagine.
 
  • Like
Reactions: ragzzz
Thankyou Andrew :) . other than mission planner, is there any other way to control the drone from PC .
 
Last edited:
Can anyone please suggest what are the command format given for Takeoff, Return to home in 3dr solo from control station to drone
 
At a higher level than direct mavlink commands you can try DroneKit (DroneKit by 3D Robotics). I'm using it to automatically program missions. It is very simple to use. Sending direct flight commands is as easy.

I don't know how you would interface to MatLab. I'm sure there are ways of interfacing MatLab with Python. However, I think it would be best to translate your model to Python.
 
  • Like
Reactions: ragzzz
Thanku STM. What i was trying to do was giving commands from matlab using UDP blockset via WIFI directly to drone which can accept the commands(as it is said that drone has a UDP port).
I 'll try translating my model to python. But my doubt is if Im trying to send my code from PC (python) to the drone should i need to use mavlink protocol.
 
upload_2017-3-22_15-21-50.png
From the system diagram if we r communication via Wifi we r having access to the drone IMx6 board which does not need mavlink commands. SO if Im trying to send commands from my matlab model using UDP blockset isnt it possible?Im not sure about this.

If Im using python code instead , then also should i need to use mavlink commands
 
View attachment 5730
From the system diagram if we r communication via Wifi we r having access to the drone IMx6 board which does not need mavlink commands. SO if Im trying to send commands from my matlab model using UDP blockset isnt it possible?Im not sure about this.

If Im using python code instead , then also should i need to use mavlink commands
 
Your commands have to get to the Pixhawk. And this happens via mavlink.

DroneKit uses mavlink commands. It just provides a higher level access. You connect your PC to the Solo WiFi. To connect to the drone with DroneKit use the following line in your python script:

vehicle = connect('udpin:0.0.0.0:14550', wait_ready=True)

iMX6 SoloLink then makes sure the commands get to the Pixhawk.

The examples under Welcome to DroneKit-Python’s documentation! assume your python script is running on the iMX6. However, if you use the above line to connect it works on a PC connected to the Solo WiFi.

PS: Make sure the firewall on your PC allows above connection.
 
This is all Greek to me, but I see you mentioned DroneKit. FYI, the Solex dev has stepped back from the latest version of DroneKit, FWIW. I am not sure all the issues that came up, but you could look at the Solex Facebook page and search here.
 
This is all Greek to me, but I see you mentioned DroneKit. FYI, the Solex dev has stepped back from the latest version of DroneKit, FWIW. I am not sure all the issues that came up, but you could look at the Solex Facebook page and search here.
Don't mix up DroneKit with 3DR Services. 3DR Services is the interface to DroneKit on Android.

I was referring to the Python version of DroneKit. The Solo iMX6 code is using DroneKit as well.

Of course you can use pymavlink directly. But DroneKit for Python makes life a lot easier.
 
Last edited:
  • Like
Reactions: ragzzz
Don't mix up DroneKit with 3DR Services. 3DR Services is the interface to DroneKit on Android.

I was referring to the Python version of DroneKit. The Solo iMX6 code is using DroneKit as well.

Of course you can use pymavlink directly. But DroneKit for Python makes life a lot easier.
Now Im getting a bit confused. Could you please get this a bit clear for me as Im very new to this

1. Communication between IMX6 from controller to IMX6 of drone use any MAVcommands? My understanding is that te controller send the command to IMX6 of drone without mavcommands. From IMX6 to pixhawk the processors adds the mav commands and transmit to PIXhawk.

2. My doubt is If I can provide the same commands( for example if i need to take off the drone) from my PC using matlab model (using UDP blockset)to IMX6 of drone via wifi(UDP port), is it possible to control drone?

3. If Im using a python script instead should I need to include MAV commands in it ??
 
Last edited:
Now Im getting a bit confused. Could you please get this a bit clear for me as Im very new to this

1. Communication between IMX6 from controller to IMX6 of drone use any MAVcommands? My understanding is that te controller send the command to IMX6 of drone without mavcommands. From IMX6 to pixhawk the processors adds the mav commands and transmit to PIXhawk.

2. My doubt is If I can provide the same commands( for example if i need to take off the drone) from my PC using matlab model (using UDP blockset)to IMX6 of drone via wifi(UDP port), is it possible to control drone?

3. If Im using a python script instead should I need to include MAV commands in it ??

1. I have not looked into how the controller iMX6 is communicating with the drone iMX6. However, I'm pretty sure it is not MAVlink commands.
Communication between iMX6 and PixHawk is using MAVlink commands.
To send commands from a PC to the PixHawk you send MAVlink commands to a mavproxy instance that is running on the drone iMX6. This is what GCS, Solo app and Solex are doing. On the PC using python you can either use pymavlink directly or use dronkekit (which in turn is using pymavlink) for this.

2. Theoretically this is possible. The problem is you either have to do all the low level MAVlink protocol stuff yourself or find a way to interface to an existing library that does it for you.

3. As said above either use pymavlink directly or use dronkekit (which in turn is using pymavlink). Have a look at Welcome to DroneKit-Python’s documentation! specifically this example Example: Simple Go To (Copter) . Use 'udpin:0.0.0.0:14550' as connection string to communicate with a real drone and not a simulator.

Of course do all this at your own risk. If your code stuffs up your drone might turn into Godzilla and wipe out your neighbourhood. It is a good idea to keep a finger on the fly button of the controller ready to take over which might not work though.
 
  • Like
Reactions: ragzzz
You can also use Pilotanywhere to control your Solo from your PC. Pilotanywhere uses Dronekit, which basically sends MAVLink messages to the Solo. MAVLink is just a protocol for sending the control commands to the Solo, or any other flight controller that understands this protocol.

Dronekit does not turn your Solo into a Godzilla. The Solo will do all the things you tell it to do. If you screw up your code then you have a problem, but that's how robotics works.

The natural procedure when you program your Solo is to write the code, test the code using a simulator (a virtual Solo, you can use dronekit-sitl for that) and then make the real flight based on your code.

Why do you use Matlab for controlling the Solo? There are already some powerful tools like Dronekit, which make the life much easier, unless you want to program everything from scratch. There is even a more powerful set of tools called ROS for robotics in general.
 
  • Like
Reactions: ragzzz

New Posts

Members online

No members online now.

Forum statistics

Threads
13,094
Messages
147,748
Members
16,058
Latest member
Gabriela