Today is code time also! And a continuation from my previous sample.
Yesterday I show how to read a static value: the battery. And, when you work with a device like a drone there are other important values to analyze in order to send commands to the drone. Like altitude, position, time of flight etc.
So, based on yesterday sample, I’ll show how to create a simple Python app, that will display the accelerator X value. In the following video you can see the how the value start “static” during the 1st couple of seconds, until I pickup the device and I moved it around.
Important: don’t blame me about the low battery. Playing with the drone drains the battery very fast!
Once again, the code is very straight forward. It runs a loop furing 10 seconds, showing the battery and accelX information.
Just as a reminder, this is the information we get from the drone:
As you can read, all the information is condensed in a single line and we can split and get:
Being part of communities is awesome, and sometimes you get some feedback that really makes your day. Last week, I saw in the LinkedIn updates, that one of my LinkedIn contacts get a new Job in the VR/AR space.
Note: Do you know that VR/AR is on the most hot job around today. Read the article [AR/VR engineers replace blockchain programmers as hottest commodity] in the references section.
Based on some Scott Hanselman advise, I spend my 15 min a day, giving kudos to people who are rocking our tech world. And I take advantage of the super cool LinkedIn suggested messages. Then this happened:
I meet MrX (keep his name confidential) last year during a Microsoft Mixed Reality event. I was part of the proctors and I had the time of my life helping there.
This event was pivotal into MrX career, she/he decided to go in this way. And 2 years later … boom, MrX is an Applied Research in AR/VR.
I don’t know you, but this types of experiences really make my day.
As always, happy to help!
Only 12 days ago I was named Microsoft MVP of Artificial Intelligence and since that time thousands of things happened, that made me think i needed to write this post. I will face the beginning of the questions, with practical answers so that you can understand it, but then I will comment on my point of view on each item.
On the Microsoft MVP website you can find the “requirements” to be MVP. ->https://mvp.microsoft.com/en-US/Overview
In order to apply for the MVP Award, a Microsoft Full Time Employee (FTE) or currently active Microsoft MVP must submit a recommendation for award consideration on your behalf.
If you have been nominated, you will receive an email to upload all the material you contributed to the community, Videos, Blogs, Articles, participation in Forums, Mentorship, Events, etc. When you submit everything you’ve…
View original post 977 more words
Today is code time! In my previous post I share some code to send commands to the drone. Today I’ll show how to read the information from the drone. Before I start, someone asked if my kids are having fun with the drone. A image will be enough to answer this.
So, as far as I understand, the drone is constantly sending information to the connected client. That’s why we have the following function running all the time in a separate thread:
def receiveData(): global response while True: try: response, _ = clientSocket.recvfrom(1024) except: break # ... more code response = None recThread = threading.Thread(target=receiveData) recThread.daemon = True recThread.start()
The response is stored in a global variable named response. And it’s very easy to understand the information that we the drone sends back. This is a sample received data.
As you can read, all the information is condensed in a single line and we can split and get:
In python this is a simple routine, and after split this into a list, the battery value is on index 21:
ls = 'pitch:0;roll:1;yaw:0;vgx:0;vgy:0;vgz:0;templ:79;temph:82;tof:10;h:0;bat:39;baro:50.42;time:0;agx:-8.00;agy:-17.00;agz:-999.00' >>> ls1 = ls.replace(';', ':').split(':') >>> ls1 ['pitch', '0', 'roll', '1', 'yaw', '0', 'vgx', '0', 'vgy', '0', 'vgz', '0', 'templ', '79', 'temph', '82', 'tof', '10', 'h', '0', 'bat', '39', 'baro', '50.42', 'time', '0', 'agx', '-8.00', 'agy', '-17.00', 'agz', '-999.00'] >>> ls1 '39' >>>
So with this, to get the battery level of the drone will require this code:
The output is not very amazing, but it works!
The DJI Drone is a great device, you can have a lot of fun and also learn a lot. However, because the main way to interact with the device is via WIFI and UDP, you need to connect to the device WIFI. And, connecting and disconnecting to the is some times not a very happy moment.
So, there are 2 main tips to work in a more agile way with this.
You probably already know the command
netsh wlan connect name=<YOUR WIRELESS NAME>
This is the quickest way to connect to a wireless. Once you have your DJI Tello name and your home / work / whatever network name in your Windows Terminal, just key up until you find it.
Bonus: If you want to know the names of the network, you may want to use the command
netsh wlan show profiles
As you can see in the following image, in my home computer I got several IoT Devices connections, my phone, the DJI Tello WiFi and my home one
The command to connect to my drone will be
netsh wlan connect name=TELLO-589327
Once I want to connect to my default network, I simply disconnect from the drone and wait until my machine connect to the default Wireless Network. The command to disconnect is
netsh wlan disconnect
So, as a recap the only 2 commands you need are:
netsh wlan connect name=<TELLO-Your device number> netsh wlan disconnect
Once you connect to your drone WIFI, it may take a couple of seconds or more to establish the connection. If during this time, you launch an app to interact with the device, be prepared to some funny results.
The way that I use to see when the Wireless connection is ready is as simple as to use a ping -t command with
ping 192.168.10.1 -t
This is the default drone IP, and you can run this in a separate window and you will know when the drone is ready.
Today I’ll write the equivalent of a Hello World in the drone ecosystem. This is a very complex app which:
I’ve followed the Python code sample from the SDK and the final code is very complex (see below). And it deserves some remarks
Important: When using the SDK, the 1st command should be “command”, as I did in line 49.
Here is the code:
Here is the app running at 3X speed so you don’t spend all day watching boring drones videos:
Before starting… let me tell you what I imagined of Quantum Computers.
And maybe something like that happens inside a QC since basically they are supercomputers equipped with advanced processing powers. The basic idea of this supercomputers, is to smash some barriers that limit the speed of existing computers by harnessing the counterintuitive physics of subatomic scales. Yes… “Subatomic” is the key word. Today, the transistors in computers are as small as hardware companies can make them with existing technology. So, computer innovators began to seek possible solutions at the atomic and subatomic level in a field known as quantum computing. We are talking about something like this.
The vision for computers of the future will not use classical bits but “qubits” which are not limited to binary and can have properties of 0 and 1 simultaneously, thus trying every possible number and sequence simultaneously to unlock vast amounts of…
View original post 891 more words
I remember last time I download and updated my Raspberry Pi with the latest Raspbian image, because it was the week before the Caribbean Developers Conference, and I deal with a couple of unexpected issues with the new version.
After the Regional Innovation Summit in Seattle, one of the draft posts that I have is related to a new Raspbian version released on 2020 Feb 05. See Release notes in the references section below. There are a couple of very interesting features here:
The File Manager has a couple of new and interesting options. It’s still not as good as Double Commander, but I like the new features. This is the old FM
And in the new one we can find that the Places, which allow us to directly access to our most frequent locations, is not collapsed by default. And with this new space, we can access more easily to other resources like USB disks and more.
Another big one, is the [New Folder] icon in the toolbar. Yes, this small one feature makes our lives much more happy! And there are new icons and more.
Remember that I got my amazing [Code the Classics] book? Now all the samples for the book are included as an option to be downloaded from the Recommended Software in the Games section.
I mostly use my device via VNC (which was also updated), however sometimes I got some issues when I connect my device to an external monitor. In the previous configuration, we didn’t have any option to manage this:
In the new version we can enable or disable the following options
The full change log is:
If you want to update your current existing version, you must run the commands
sudo apt update sudo apt full-upgrade
Last year i uploaded a video in which I developed a small WPF application that consumed Cognitive services to calculate the distance of a person captured by the Azure Kinect Camera. I received a lot of questions about the code and it made me feel good that i could help developers around the world. They requested me to consume the Face API with the device, so this is it!
So lets begin.
1 . Create a WPF .NET Application, before adding all Nuget packages there are some things you have to configure for the project to work with our sensor.
2. Configure Debug mode x64, if you don´t have available that option available select the configuration manager and add it.
3. Right click your project in the solution explorer and select “Properties”
Once the Properties panel is available uncheck the “Prefer 32-bit” option and check the “Allow unsafe…
View original post 808 more words