I'm using ArduSub and am creating a stand-alone program to retrieve the depth of the ROV and output it as an NMEA-0183 message. I would like send a PARAM_REQUEST_READ message and receive the stream over UDP.
Looking at the examples I'm not sure if I should connect as a udp-client, or udp-broadcast, since I'd like the stream to be directed rather than broadcast.
I have studied the examples and looked a bit into the source code, but I'm afraid I'm stumped. I have tried to include the message to dialect.Messages, with no success:
msgs := []msg.Message{}
msgs = append(msgs, &common.MessageParamRequestRead{1, 1, "", 6})
dialect := ardupilotmega.Dialect
dialect.Messages = msgs
node, err := gomavlib.NewNode(gomavlib.NodeConf{
Endpoints: []gomavlib.EndpointConf{
gomavlib.EndpointUDPBroadcast{
BroadcastAddress: "192.168.2.255:14550",
LocalAddress: ":14550",
},
},
Dialect: dialect,
OutVersion: gomavlib.V2, // change to V1 if you're unable to communicate with the target
OutSystemID: 10,
StreamRequestEnable: true,
StreamRequestFrequency: 4,
})
Any help would be appreciated. A new example showing this common requirement might be helpful for all.
I'm using ArduSub and am creating a stand-alone program to retrieve the depth of the ROV and output it as an NMEA-0183 message. I would like send a PARAM_REQUEST_READ message and receive the stream over UDP.
Looking at the examples I'm not sure if I should connect as a udp-client, or udp-broadcast, since I'd like the stream to be directed rather than broadcast.
I have studied the examples and looked a bit into the source code, but I'm afraid I'm stumped. I have tried to include the message to dialect.Messages, with no success:
Any help would be appreciated. A new example showing this common requirement might be helpful for all.