Comments (5)
I think that some users would benefit from that. I will try to see what I can do.
Using MAVLink messages is a bad idea since we already have some trouble with those and they do not work well with iNAV.
The communication module was designed to do exactly that! Push any possible command to the UAV or ground station and execute it.
I do not think that adding any other triggers than GPIOs would make sense since it would be a very user specific solution. Like execute specific software commands etc. Only one or two users would benefit from it. DroneBridge communication module is open source and it is super easy to add new message definitions.
from dronebridge.
Hello Wolfgang!
I am searching for the possibility to trigger some generic switching action (ON/OFF) on the AirPi side of things. I agree with you that this should go alongside/independently from whatever RC-control protocol (Mavlink, SUMD, ...) the user has chosen.
Is there any way to complement the RC-control protocols with additional channels (must not necessarily be proportional PPM -which is hard to implement on Pi- or be embedded into the RC-protocol itself. Some additional channels with ON/OFF functionality which go alongside -i.e. parallel- with the RC-control stream would be absolutely sufficient).
It would be AWESOME if those additional ON/OFF channels could be either interpreted via software (trigger software actions) or drive a GPIO Pin on the AirPi (physical actuators). The possibilities would be endless:
- switch navigation lights ON/OFF (GPIO)
- deploy landing gear (GPIO)
- actuate motorized IR-Cut Filter (Software action: can be triggered with a small Python script)
- activate IR-LEDs for night vision (GPIO)
- switch camera input - hardware wise (GPIO: hardware cam switcher like this very usecase)
- switch camera input - software wise (Software action: like Flir Thermal or Ista360)
- actuate drop device (GPIO)
- etc ...
I think Software/GPIO actions should be implemented to be configurable. Lets image we have 4 extra channels now. It would be great if you could specify what effect these channels have. If a physical action is configured (HW) it will simply call a function that drives the respective GPIO accordingly. If a software action is configured (SW) a empty function body (template) is called where the user can add own code, e.g. call shell scripts, start python scripts, execute own executables . This would be ultimately flexible. I agree however that all switches should be configured to drive GPIOs by default.
Example:
Switch1 = HW --> Call switch1_drive_gpio( );
Switch2 = HW --> Call switch2_drive_gpio( );
Switch3 = SW --> Call switch3_customcode() { here goes the user code };
Switch4 = HW --> Call switch4_drive_gpio( );
Can you comprehend what I mean? Sorry I am not a coder... ;-)
Keep up the excellent work!
from dronebridge.
Yes I think I do. I kind of like the GPIO (HW-switch) idea. That's why I already opened a project to formalize my ideas.
The software-switches you mention are already possible. Do not think of them as "channels" that go alongside the RC or telemetry streams. Think of them as messages. The communication module can transport messages of all kind. If a known message is received it does something. What it should do is totally up to the users implementation.
So let's say you want to change some setting of a camera connected to your AirPi. To do that you need to execute a command like "mycam -- shuterspeed 500" on the AirPi.
What you do to implement this into DroneBridge is the following:
- Define a custom message that follows the specification of the communication protocol. Just like the new adjustrc message. You can put as many parameters in there as you need.
Your message could look like this:
{ "destination": 5,
"type": "mycamshutter",
"speed": 500,
"id": 4321
}
- Make the communication module aware of the new message & write the code that should be executed. Add an if-clause that runs if your defined message-type is received
- Generate a return message to let the user know your message was received. It is as simple as calling rtrn_message = new_ack_message()
That's it! Now just send your newly defined message via UDP to the communication module and let it do the rest.
Here is an example on how to generate the entire communication message including the CRC32 at the end from a json. This will return the pure bytes of the message that now can be sent to the communication module (UDP: Port 1605) of the ground station.
With just a few lines of code, a user can implement any custom functionality with ease. I might write a wiki page on that in the future.
from dronebridge.
@seeul8er : Great!! A wiki page with a very basic example would be very much appreciated. It will help people with minimal coding knowledge - like me! ;-) The only tricky part now seems to be how to trigger that message at the GroundPi with e.g. a flick of a switch on a Taranis. (There are things that can be done by the APP of course but some things need a dedicated hardware switch on the controller ;-)
Afaik user dino.de from the RCgroups forum sometime back implemented a function that reads up to 16Ch from a Taranis and writes them to a memory structure at the GroundPi from where it can be interpreted and used for actions (e.g. switch between different OSD screens).
Maybe this can be reused to trigger sending above messages from the GroundPi to the AirPi?
from dronebridge.
Afaik user dino.de from the RCgroups forum sometime back implemented a function that reads up to 16Ch from a Taranis and writes them to a memory structure at the GroundPi from where it can be interpreted and used for actions (e.g. switch between different OSD screens).
DroneBridge does this already. The status module e.g. reads the channel values from that structure and sends them to the app. So yes that would be a way of doing it.
See implementation here, and here
from dronebridge.
Related Issues (20)
- How does this work ? The docs are useless. HOT 1
- Injection test failed HOT 3
- connect ESP32 to internet HOT 1
- SharePoint links broken HOT 6
- Is it possible to use DroneBridge for 2 way video link?
- Is there a way to use the wifi adapter on my Linux computer without a ground pi station? HOT 3
- How can I use this as a standalone program on Ubuntu? HOT 8
- APK download "beta is expired" HOT 2
- What are the initial steps to set up the program? HOT 1
- h264 usb camera stream HOT 4
- Drone
- v0.6 .img improvements (shrink) HOT 3
- Commercial Solution HOT 1
- Feature request: Add support for ESP32 long range mode HOT 2
- Wiki is confusing, old unavailable
- Atheros AR9271 with unpatched kernel - DB Python examples do not work HOT 2
- ESP32 Station mode
- Trying to use DroneBridge on AML-S905X-CC (Le Potato) HOT 2
- Support for multiple wifi cards HOT 1
- Drone Bridge web interface crashes after saving updated settings. ESP32-C3 Xiao Seeed Studio. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dronebridge.