I have been working on a C# library that wraps what we have learned about the API into something a little easier to use. It isn't as easy to use as say python. But the goal is to make it easier to develop apps for Android, PC and eventually iOS. It uses Xarmin for cross platform because I vastly prefer C# over Java and Objective C.
So far I have been focusing on getting it to reliably connect and reconnect under network conditions and making sure the basic commands and functions work. The API isn't complete. And the UI in the apps is very basic.
The github is here:
Kragrathea/TelloLib
There is the TelloLib, a Hello World example, an Android app and a PC Console app. Here is the example:
To build the app you "just" need the free Visual Studio Community Edition. I say just because it is a huge download. But once it is running you can build and deploy to an android phone.
Installing Xamarin in Visual Studio 2017 - Xamarin
So far I have been focusing on getting it to reliably connect and reconnect under network conditions and making sure the basic commands and functions work. The API isn't complete. And the UI in the apps is very basic.
The github is here:
Kragrathea/TelloLib
There is the TelloLib, a Hello World example, an Android app and a PC Console app. Here is the example:
Code:
using TelloLib;
namespace HelloTello
{
class Program
{
static void Main(string[] args)
{
//Subscribe to Tello connection events. Called when connected/disconnected.
Tello.onConnection += (Tello.ConnectionState newState) =>
{
if (newState == Tello.ConnectionState.Connected)
{
//When connected update maxHeight to 5 meters
Tello.setMaxHeight(5);
}
//Show connection messages.
Console.WriteLine("Tello " + newState.ToString());
};
//subscribe to Tello update events. Called when update data arrives from drone.
Tello.onUpdate += (Tello.FlyData newState) =>
{
Console.WriteLine("FlyMode:" + newState.flyMode +" Height:" + newState.height);
};
Tello.startConnecting();//Start trying to connect.
//Parse commands from console and send to drone.
var str = "";
while (str != "exit")
{
str = Console.ReadLine().ToLower();
if (str == "takeoff" && Tello.connected && !Tello.state.flying)
Tello.takeOff();
if (str == "land" && Tello.connected && Tello.state.flying)
Tello.land();
}
}
}
}
To build the app you "just" need the free Visual Studio Community Edition. I say just because it is a huge download. But once it is running you can build and deploy to an android phone.
Installing Xamarin in Visual Studio 2017 - Xamarin