Fake heartbeat #172
Replies: 1 comment
-
|
Hello, any gomavlib node automatically sends out heartbeats, unless node := &gomavlib.Node{
Endpoints: []gomavlib.EndpointConf{
gomavlib.EndpointSerial{
Device: "/dev/ttyUSB0",
Baud: 57600,
},
},
Dialect: ardupilotmega.Dialect,
OutVersion: gomavlib.V2, // change to V1 if you're unable to communicate with the target
OutSystemID: 10,
DisableHeartbeat: false,
}If you want to send out heartbeats to simulate additional devices, you can look at how a gomavlib node does it and do the same: for {
ticker := time.NewTicker(1 * time.Second)
defer ticker.Stop()
for range ticker.C {
err := node.WriteMessageAll(&common.MessageHeartbeat{
Type: common.MAV_TYPE_GCS,
Autopilot: common.MAV_AUTOPILOT_INVALID,
BaseMode: 0,
CustomMode: 0,
SystemStatus: common.MAV_STATE_ACTIVE,
MavlinkVersion: 3,
})
}
}change |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm using gomavlib to connect to my drone as a GCS. Is there a way to simulate a fake heartbeat for a radio, so that both the GCS and the flight controller (FMU) recognize a radio as being connected? I’d like to then manually send RADIO_STATUS MAVLink messages based on that
Beta Was this translation helpful? Give feedback.
All reactions