Skip to content

Commit

Permalink
Add project files.
Browse files Browse the repository at this point in the history
  • Loading branch information
fforay committed Jul 18, 2023
1 parent 412363b commit ad1ead5
Show file tree
Hide file tree
Showing 25 changed files with 1,987 additions and 0 deletions.
25 changes: 25 additions & 0 deletions HowTo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
## Must be done First

- Charge the battery
- Either with external charger
- Pluging the TELLO to PC's USB : Tello will blink blue

## Checking using the Android application

- Get the TELLO app
- Strat the TELLO

- Start the app
- Connect to Tello's Wifi : for eg, TELLO-ED41FD
- You should see the Video in the app and you should be able to command the TELLO

## Using TelloLibrary and the Test Application

- Connect the TELLO and PC through Wifi
- Using a Wifi plug (preferred choice)
- Using PC's Wifi
- Check "Auto Connect" to avoid doing it manually again

## Problems
- If your TELLO don't want to take-off, you mais have missed the activation
- In order to activate it, you must use the Android app
17 changes: 17 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# TelloLibrary

X# Library to ease the use the communication with DJI Tello, with at least SDK 2.0
_**Documentation**_ :
https://dl-cdn.ryzerobotics.com/downloads/Tello/Tello%20SDK%202.0%20User%20Guide.pdf

# TelloTest

Raw-mode Console App to send command to the TELLOs

# TelloXSharp

Simple console app that can get the video stream

# TelloFake

Fake-Drone console app : It will emulate the drone, and print received commands
17 changes: 17 additions & 0 deletions SimpleTello/Program.prg
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Program.prg
// Created by : fabri
// Creation Date : 7/18/2023 5:59:09 PM
// Created for :
// WorkStation : FABXPS

USING System
USING System.Collections.Generic
USING System.Linq
USING System.Text
USING SimpleTello

FUNCTION Start() AS VOID STRICT
Console.WriteLine("Simple Tello Test App")
//
VAR tello := SimpleTello{}
tello:Start()
37 changes: 37 additions & 0 deletions SimpleTello/Properties/AssemblyInfo.prg
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
USING System.Reflection
USING System.Runtime.CompilerServices
USING System.Runtime.InteropServices
//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("SimpleTello")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SimpleTello")]
[assembly: AssemblyCopyright("Copyright © 2023")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(FALSE)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("dec58555-cb5f-4436-9cfa-7bc19d367171")]

//
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("1.0.*")]
104 changes: 104 additions & 0 deletions SimpleTello/SimpleTello.prg
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
// SimpleTello.prg
// Created by : fabri
// Creation Date : 7/18/2023 6:00:37 PM
// Created for :
// WorkStation : FABXPS


USING System
USING System.Collections.Generic
USING System.Text
USING System.Net
USING System.Net.Sockets
USING System.Text
USING System.Threading

BEGIN NAMESPACE SimpleTello

/// <summary>
/// The SimpleTello class.
/// </summary>
PUBLIC CLASS SimpleTello
PRIVATE _lastResponse := "" AS string

PRIVATE IsNewReponseAvailable := false AS Logic

PRIVATE PROPERTY LastResponse AS string
GET
IsNewReponseAvailable := false
RETURN _lastResponse

END GET
END PROPERTY

METHOD Start() AS void
LOCAL droneEndpoint AS IPEndPoint
LOCAL localEndPoint AS IPEndPoint
LOCAL client AS UdpClient
LOCAL th AS Thread
LOCAL cmd AS string
LOCAL cmdData AS Byte[]
//
Console.WriteLine("Tello RAW Test")
Console.WriteLine("Open connection to Tello.....")
Console.Write("IP Address : (empty for default) ")
VAR address := Console.ReadLine()
IF string.IsNullOrEmpty(address)
address := "192.168.10.1"
ENDIF
droneEndpoint := IPEndPoint{IPAddress.Parse(address), 8889}
localEndPoint := IPEndPoint{IPAddress.Any, 8890}
client := UdpClient{localEndPoint}
client:Connect(droneEndpoint)
th := Thread{RecvThread}
th:Start(client)
WHILE true
Console.Write("Command : ")
cmd := Console.ReadLine()
IF string.IsNullOrEmpty(cmd)
EXIT
ENDIF
cmdData := Encoding.UTF8:GetBytes(cmd)
client:Send(cmdData, cmdData:Length)
Thread.Sleep(0)
IF !th:IsAlive
th:Start(client)
ENDIF
Thread.Sleep(0)
WHILE !IsNewReponseAvailable
END WHILE
Console.WriteLine(LastResponse)
END WHILE
client:Close()
Console.WriteLine("Press <return> to Close...")
Console.ReadLine()


PUBLIC METHOD RecvThread(param AS Object ) AS void
LOCAL client AS UdpClient
LOCAL remoteEndPoint AS IPEndPoint
LOCAL responseData AS Byte[]
LOCAL response AS string
//
client := (UdpClient)param
WHILE true
TRY
remoteEndPoint := null
responseData := client:Receive(REF remoteEndPoint)
response := Encoding.UTF8:GetString(responseData)
IF !response:StartsWith("mid")
IsNewReponseAvailable := true
_lastResponse := response
ENDIF

CATCH e AS Exception
Console.WriteLine(e:Message)
EXIT
END TRY
END WHILE
Console.WriteLine("-->>...")


END CLASS

END NAMESPACE // SimpleTello
58 changes: 58 additions & 0 deletions SimpleTello/SimpleTello.xsproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(XSharpMsBuildDir)\XSharp.Default.props" />
<PropertyGroup>
<ProjectGuid>dec58555-cb5f-4436-9cfa-7bc19d367171</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>SimpleTello</RootNamespace>
<AssemblyName>SimpleTello</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<Name>SimpleTello</Name>
<OutputName>SimpleTello</OutputName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup>
<Import Project="$(XSharpMsBuildDir)\XSharp.targets" />
<ItemGroup>
<Reference Include="mscorlib" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Data" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Xml" />
<Reference Include="System.Xml.Linq" />
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.prg">
<SubType>Code</SubType>
</Compile>
<Compile Include="Program.prg">
<SubType>Code</SubType>
</Compile>
<Compile Include="SimpleTello.prg" />
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\TelloLibrary\TelloLibrary.xsproj">
<Name>TelloLibrary</Name>
<Project>{d56b6653-8cfa-4a04-81fc-74bc58fe9120}</Project>
<Private>True</Private>
</ProjectReference>
</ItemGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<PreBuildEvent />
<PostBuildEvent />
<RunPostBuildEvent />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<PreBuildEvent />
<PostBuildEvent />
<RunPostBuildEvent />
</PropertyGroup>
</Project>
Loading

0 comments on commit ad1ead5

Please sign in to comment.