Movement commands for Solo on GPS-denied manual modes - dronekit-python

I am working on an indoor vision based navigation in a GPS denied environment, and I'm using a 3DR Solo. I want to be able to send movement commands to the Solo through the DroneKit API. Are these mavlink commands supported for modes other than GUIDED and AUTO, or is channel overriding my only option?

It depends on how you want to control it. If you want to control the position of the copter, you will need to make hardware modifications to the solo, because it does not have the right sensors to be able to hold position indoors. If you want to control the raw angle of the copter, the cleanest way to do this is to send a SET_ATTITUDE_TARGET message. The problem is that this is only supported in guided mode, and guided mode won't arm without gps (even though low-level control like SET_ATTITUDE_TARGET doesn't rely on GPS). Guided-NoGPS mode is currently on the todo list for ArduCopter, so comment on the issue here to let the devs know that you are interested in this feature.

Related

Is it possible to control Pixhawk quadcopter with a Taranis and a DroneKit script simultaneously?

I have successfully tested basic DroneKit scripts on a companion computer (Raspberry Pi) to achieve autonomous flight on Pixhawk controlled 3DR ArduCopter. The RPi is also connected to various sensors, and crunches that data in real time in the same python script- to influence the flight.
Is it possible to pilot the drone manually with a Taranis as usual, while RPi (with DroneKit running) remains connected to Pixhawk and overrides the radio when needed? For example, a background prevention mechanism that takes control and moves the copter away if the pilot is about to crash into a wall (which is easily sensed using a LIDAR).
Thank you!
While your vehicle is in any mode other than GUIDED, your dronekit script will not be able to control behaviour. However, the script can change the mode of the copter to GUIDED, send some commands, and then set the mode back to the previous mode when it is done.
The example you gave of using lidar for obstacle avoidance is already a feature in progress, being built directly into normal flight modes. Perhaps it's not documented well enough yet, but maybe try digging into the code to see how it works.

Use DroneKit to build a Ground Control Station for Windows

On the DroneKit.io page, it mentions using DroneKit Python when creating Ground Control Stations for Windows. However, there appears to be no documentation for this.
Is it meant to simply simulate a com port and act as a proxy for other Ground Control Stations, which just makes it easier hijack the MAVLink?
Also, it mentions Python being used for low-latency processes. This seems to be oxymoronic. Is there a reason that it would be better than just using C/C++ for the purpose of hijacking the MAVLink?
Thanks!
DroneKit-Python can be used either to create a python-based ground station or it can be run on a companion computer. There is no practical difference between the two except how you set up the connection to the vehicle from the computer running the script. The different ways of starting MAVProxy for the different connections are covered in the Getting Started documentation.
The reason that there is no "specific" documentation on using DK-Python for GCS is primarily "marketing". The far bigger market for ground station GCS software is in tablets/phones that will use DK-Android or a future iOS port. DK-Python has been positioned solely as for use in the air interface. Even though there is no "specific" documentation, in fact all the existing documentation is relevant.
Is it meant to simply simulate a com port and act as a proxy for other Ground Control Stations, which just makes it easier hijack the MAVLink?
No. See above.
Also, it mentions Python being used for low-latency processes. This seems to be oxymoronic. Is there a reason that it would be better than just using C/C++ for the purpose of hijacking the MAVLink?
It doesn't mention low-latency processes, so the answer is "invalid question".
You're probably misreading the text "that require a low-latency link". The point here is that if you have dronekit-python running on a companion computer and connected by a fast link you can do real time handling of incoming sensor data. This allows computer vision control of the UAV. However if you run DK-Python on a ground control station you will have a much slower link. You can still control movement of the UAV but the latency will be much higher.
Hope that helps!

Windows TCP/UDP mouse driver

I am working on creating a touch pad device (custom hardware but similar to an android device) that acts as a touchscreen drawing pad similar to the Wacom Bamboo drawing pads. However, the key feature of the device is instead of connecting it to the computer with wires or via Bluetooth, it connects to the local WiFi network and searches for devices with a port open (currently 5000 for testing purposes). Currently, I have a client written in C that when launched opens up a DatagramSocket on port 5000 and waits for a custom UDP packet containing normalized X, Y, and pressure. Then, for testing purposes, I am putting the normalized X and Y into SendInput. SendInput "works" however injecting packets into the computers current mouse is not what I want. Instead, I want to have it considered as a seperate input device so programs like gimp will be able to detect it and assign custom functions based on the data (ie: have gimp utilize the pressure data).
The problem is I dont know where to start to create a driver that does the former. I have been extensively looking at the winddk thinking that might be the key. The problem with the winddk is I cannot find any documentation on creating a HID driver using data that is not from a ps/2 or usb. This tutorial got me thinking about using IOCTLs, but I am not really sure how to make them be considered as input.
As a side note, in the title I said TCP/UDP because I am willing, and considering for security purposes, to change from UDP connection to TCP.
If someone can push me in the right direction or link me to some related documentation and samples, that would be awesome because right now I am lost. Thank you.

How to make a Windows touch pad acts like a Mac touch pad?

I am trying to write something for windows using WINAPI, so I can make the touch pad do whatever the mac touch pad do.
I have checked using Spy++ what WM messages the two finger taps and etc. send to the OS, but figured out it sends only those plus/minus:
WM_LBUTTONDOWN
WM_LBUTTONUP
WM_MOUSEHOVER
WM_MOUSEHWHEEL
WM_MOUSELEAVE
WM_MOUSEMOVE
WM_RBUTTONDOWN
WM_RBUTTONUP
When I tried to see what happend when clicking with 3 or 2 fingers it didn't send any particular message, unless I moved them a bit.
firstly i would like to start with this:
when 5 fingers going down show desktop (as win+D does).
How to write (driver?) something that can diagnose 5 fingers touching simultaneously the touch pad?
Of curse there is no OS messages for this, but I can make some unique combination of existed messages and by that diganose it.
If I need to write a driver can I do it generic for most of the touchpad, can I do it as add-on?
If you can post a good tutorial you are familiar with for writing a driver for windows, pls, cause I have no clue about it.
Do I need anything else to take into account :
1. Diagnose 5 fingers mouse events.
2. Make a thread in Explorer on startup that handle those new mouse messages.
thanks in advance
Mouse Input Notifications
In short, you can't.
First, there are touchpads that can physically detect only 1 finger touch, and for those who can detect many - their drivers do the translation for you.
Windows does not have any inherent support for reading multiple touch inputs - it relies on the touchpad drivers to provide them.
You can achieve your goal for SOME devices by writing your own touchpad driver (probably starting from Linux touchpad drivers and Windows driver development kit), but this is far from being simple.
And, you'll need to do this for each and every touchpad device you want to support (from Synaptics, Alps Electric, Cirque to name the few)
Only after that you can move on to implementing the reaction for the touchpad actions in applications like Explorer.

Programming techniques/libraries for locating a user with a mobile device within a building [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 1 year ago.
Improve this question
I am looking to develop an application usable on the devices of visitors so that I can tell where they are. The initial idea I had, already done in some museums, is to have a number on specific locations within the museum, they call a phone number, enter that number, and get enhanced content, perhaps audio narration about that space. This is nicely device agnostic, though some WiFi only devices may not have a mechanism to call a phone number, but perhaps having folks on WiFi load a mobile website and choose their location (assuming the number of spots is not too many) from a list, and then click a button.
I'm new to this, and have been brainstorming on this, but I really don't know what I don't know. So here are my questions:
Can I use GPS indoors and get accurate information or will that basically not work in most buildings?
If I use a service like Skyhook Wireless, and use multiple WiFi routers, will I be able to locate the WiFi connected users accurately?
Can I use Bluetooth somehow? Setup for Bluetooth seems like a hassle, but maybe there's a Bluetooth mode that is simpler to use for an application like this?
For devices with a camera, what can I do with an image here. Photo of a QR Code? Are QR code reading libraries built into devices I can use, or would I need to find a library?
Are there are other techniques I might be able to use, maybe counting footsteps with the accelerometer somehow? Or using magnets somehow for devices with a compass?
Suggestions welcome, assume I'm trying to target as many smartphones as practical (Android, iOS, Blackberry, webOS, Windows Phone 7) that are popular in North America. If there is a way to also include devices that are not considered smartphones, that would be great too.
UPDATE
Why indoor navigation is so hard: Your phone can get you to the museum, but it can't guide you to the T-Rex by Nick Farina
UPDATE 2
Brooklyn Museum experiment with QR Codes: too soon to
tell/negative
Very few people can successfully scan and use a QR code
UPDATE 3
Think GPS is cool? IPS will blow your mind
QR codes are your best bet. They're cheap and, for example, in a museum you could put one next to every painting. For devices without a camera, you could choose to print a location-code next to the QR that they could enter manually in an app. Here's another solution as well:
Set up a wifi repeater/booster in each location you want to determine (ex: in a museum, each room) and record the SSID for each router. As the user walks from each room to the next, their device will automatically switch to the repeater with the highest quality signal (the one in that room). Simply have your application test for which SSID the user is connected to.
GPS is not accurate enough and may not work inside buildings and Skyhook wireless is only for one address. Having users call a number and/or go to a website to manually select a location is too many steps for the user, and the user may not have reception to place a call. Bluetooth is a huge hassle.
Can I use GPS indoors and get accurate
information or will that basically not
work in most buildings?
no, GPS needs a clear view of the sky. regardless, the accuracy of GPS is around +/- 50 feet and can be worse.
If I use a service like Skyhook
Wireless, and use multiple WiFi
routers, will I be able to locate the
WiFi connected users accurately?
aGPS is less accurate than GPS.
Can I use Bluetooth somehow?
bluetooth is not location aware.
android 2.3 introduces something called near-field communications. this would theoretically allow the person to wave their phone over a receiver and transmit information. it's quite new and i think the nexus s is the only device with hardware support for this. at best you are looking at some early adopter pain for that one.
Photo of a QR Code? Are QR code
reading libraries built into devices I
can use, or would I need to find a
library?
that's a good idea. QR codes are popular because they are simple. libraries are not part of the SDK but they exist. it would be hard to build one yourself if it came down to that. by the same token, you could just as the user to enter a simple location code. essentially the same thing and might be simpler than aligning the camera for a QR read.
it does depend on your application. if you want this to automatically locate everyone without an user intervention, QR codes / codes won't work because the user has to take some action. even NFC, from what i've read, operates on very short distances so the person would need to wave the phone across something closely not just walk by.
If you're talking indoors, I think you have some great ideas. GPS may be spotty depending on the building, and Wi-Fi triangulation only works if your signal is proportional to the proximity of the user to the unit. Here is my suggestion:
QR Codes sounds like the best option here if you don't mind having them all over the place. If someone can scan a QR code, (which they are on most all platforms, it's just making sure your users have a decoder installed and can actually use it), then you have three things going for you:
You know they have to be in range to scan it...so that's far more accurate than you can get with other location devices.
you can use the QR code to embed a link to a download site or embed the actual information into the QR code if it's not too much.
Most smartphones today have QR code scanner apps built in, and there are libraries (java and .net) that you could use to build your own app.
The downside here of course is that you're assuming the cameras are good enough quality and that someone isn't going to deface your QR code so that subsequent visitors can't read it.
Keep in mind the bump application. They don't use bluetooth or any form of wireless technique to determine if two people are near each other. http://bu.mp/faq
Since you have 1 building that you care about. Why not simply have a root device or network of devices in your building that you care about. This root device would communicate with all the clients to do your bidding.
Maybe cellphones canĀ“t solve your problem, have you considered cameras on each room and a QR code tag on each guest? you might get the images from the security camera since they are infrared. Another way of achieving this is by locating the camera in front of the door so that the guests are always seen by the QR code algorithm.
Cellphones are just too diverse to implement this, have you thought that the guests might not have a cellphone at all?

Resources