Comments (8)
The interest in discussing this seems to be on a moderate level at best. I released some of the proposed changes in an independent crate on crates.io. I would still be happy to have this discussion though, as there are quite some big compromises on my crate due to some limitation of the mavlink library.
from rust-mavlink.
Hi @wucke13, sorry for not being able to help much about this matter, but I was planning to create an actor based communication method over mspc, that appears the correct way to accomplish it.
I started the implementation but since I'm out of time I was unable to finish it.
Don't you want to create a PR to add the async functionality in this repository ?
from rust-mavlink.
Yeah, I'm still happy to merge my code. However, now that I released to an independent crate, I would like to use the opportunity to refine things more. I wan to add some convenience functions (like send message a, until the first message b arrives) for dealing with unreliable communications.
My strongest desire which AFAIK can not be solved outside of this crate would be an implementation of
TryFrom<::Message> for ::PLACEHOLDER_DATA
. So a generic way of converting any message into a specific message struct without explicit matching. Can you add this?
from rust-mavlink.
TryFrom<::Message> for ::PLACEHOLDER_DATA
. So a generic way of converting any message into a specific message struct without explicit matching. Can you add this?
From what I know this is not possible directly and a generic tryfrom will need to be implemented, and I don't see a reason for this.
What is necessary IMO is to recreate the parser and deal with the parsing to be async, that's what I'm doing with my patch plus the async communication with mspc.
You can check that in my open draft PR here: #79
from rust-mavlink.
I don't see a reason for this
Well, here is one: This is necessary to offer a sane API where the user receives filtered messages (e.g. only one message type). If I and a stream both now that said stream will only yield PARAM_VALUE
messages, than it would be very nice for the stream to be able to directly return PARAM_VALUE_DATA
structs. Currently, there is no way to offer such an API, for the reasons stated in my initial posting. Does this make sense to you, or shall I try to explain in more detail why I think that there is a strong reason for that?
From what I know this is not possible directly
Why is that? It's not possible in a generic way, because there is (IMHO major) problem in the TryFrom
implementation from the std library (more details). However, with the information about all variants (which only this library has in it's build script) available at the code level, it is:
I thought one way would be this:
- to every
enum MavMessage
add a function in theimpl
which- matches against every possible variant
- unpacks the contained data
- casts a reference counted reference of it to
Any
- and returns this any
- Add this
as_any
function to theMessage
trait. - Than on the
Message
trait, add atry_extract<T>(&self)->Option<T>
function.
Do you see a problem with this approach, implementation wise? I'm sure there is more elegant ways of doing it, but I did not think of any so far.
Also, whats the point with channels when going the async route? I don't understand why you would be doing both.
At least the discussion started now 😄
from rust-mavlink.
@patrickelectric Ping
Also: if this helps, I'm open to hop on a virtual meeting to discuss this issue further. However that's just an idea.
from rust-mavlink.
Hi @wucke13, sorry I'm in a complicate period in the last days, will try to catch-up with this discussion when possible.
from rust-mavlink.
@patrickelectric As stated before, I'm open to any means of digital communication, at your choice. Until then: take your time and good luck!
from rust-mavlink.
Related Issues (20)
- 0.12.2 does not compile HOT 2
- Panics on [tcpin, tcpout, udpout, udpin, udpbcast]: `failed to lookup address information: Temporary failure in name resolution`
- Incorrect message frame detection HOT 3
- MAVLink XML change to allow exponentiation operator in bitmask flag HOT 2
- 0.13.0 not published on crates.io HOT 6
- Broken `no_std` from recent commits HOT 3
- Error reported in udpin LAN IP code: 10049, kind: AddrNotAvailable HOT 1
- README: broken example links HOT 1
- Incremental build broken (mavlink always regenerated/recompiled) HOT 3
- Read implementation for UdpRead needs buffering
- Enum entries without value are generated wrong.
- Mavlink v2 extension are broken for v0.13 for the mavlink crate HOT 3
- `MavFrame::deser` incorrectly parsing HOT 6
- Saving waypoints (using Mission Protocol) not work
- Async Connection Trait HOT 3
- MSRV for tokio-1 feature HOT 2
- Better feedback on feature combinations HOT 6
- compilation warnings due to missing `storm32` feature HOT 2
- Fix release CI HOT 5
- Test with no-dev-deps all-targets 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 rust-mavlink.