Comments (2)
Hello, i'm a little rusty about this project since i did it almost 3 years ago, but if i remember correctly you should be able to perform this task by by writing a very simple Golang program and instantiating two nodes:
- one with all the endpoints except the serial one
- another with the serial endpoint
package main
import (
"fmt"
"github.com/aler9/gomavlib"
)
func main() {
node1, err := gomavlib.NewNode(gomavlib.NodeConf{
Endpoints: []gomavlib.EndpointConf{
gomavlib.EndpointUDPClient{"1.2.3.4:5900"},
// insert any other endpoint here
},
Dialect: nil,
OutVersion: gomavlib.V2, // change to V1 if you're unable to communicate with the target
OutSystemID: 10,
})
if err != nil {
panic(err)
}
defer node1.Close()
node2, err := gomavlib.NewNode(gomavlib.NodeConf{
Endpoints: []gomavlib.EndpointConf{
gomavlib.EndpointSerial{"/dev/ttyUSB0:57600"},
},
Dialect: nil,
OutVersion: gomavlib.V2, // change to V1 if you're unable to communicate with the target
OutSystemID: 11,
})
if err != nil {
panic(err)
}
defer node2.Close()
for evt := range node1.Events() {
if frm, ok := evt.(*gomavlib.EventFrame); ok {
// route frame to every other channel
node.WriteFrameExcept(frm.Channel, frm.Frame)
// route to serial only if a certain condition is satisfied
if conditionSatisfied {
node2.WriteFrameAll(frm.Frame)
}
}
}
}
from mavp2p.
That's exactly how I did solve it. Thank you a lot for a comprehensive answer!
from mavp2p.
Related Issues (14)
- Possible Inverse Behavior HOT 1
- Routing to Target Systems/Components HOT 1
- Featurerequest support ardupilot and px4 binlog record
- Manipulate messages HOT 1
- Close channel after all nodes dissappear HOT 2
- Heartbeat componentID HOT 1
- Restart mavp2p on serial autopilot restart HOT 4
- Hardware flow control support HOT 1
- mavp2p not routing ParamExt commands HOT 4
- Is there an official Docker image for this project? HOT 2
- channel closed/open over and over HOT 1
- FeatureRequest: Enable dynamic use of mavp2p
- Featurerequest: TLOG logging endpoint HOT 3
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 mavp2p.