I get this...
Ardustation2.cpp: In function 'void send_message(mavlink_message_t*)':
MAVLink:98: error: 'struct __mavlink_message' has no member named 'payload'
MAVLink:100: error: 'struct __mavlink_message' has no member named 'ck_a'
MAVLink:101: error: 'struct __mavlink_message' has no member named 'ck_b'
Here is the function:
void send_message(mavlink_message_t* msg)
{
Serial.write(MAVLINK_STX);
Serial.write(msg->len);
Serial.write(msg->seq);
Serial.write(msg->sysid);
Serial.write(msg->compid);
Serial.write(msg->msgid);
for(uint16_t i = 0; i < msg->len; i++)
{
Serial.write(msg->payload[i]);
}
Serial.write(msg->ck_a);
Serial.write(msg->ck_b);
}
Any ideas?
Replies
Hi all,
in case someone would also like to use this code (and ends up having the same problem): it seems that if one replaces the send_message part with something like this
mavlink_msg_request_data_stream_send(chan, 1, 0, MAV_DATA_STREAM_RAW_SENSORS,
MAV_DATA_STREAM_RAW_SENSORS_RATE, MAV_DATA_STREAM_RAW_SENSORS_ACTIVE);
and makes sure the target system id is correct and uses the same way to initialize chan to be a mavlink channel (see e.g. ArduPlane GCS_Mavlink) then it works. Tried yesterday on my workbench with a direct serial connection but of course it should also work with the Xbee in between.
Cheers,
Andre
I have that same issue with the xbee regulated board. Soldered to much the pins got shorted. Might be a good place too start. If I remember the correctly the RED will always be ON when the Xbee is plugged in. The Blue will stay on when the connection between xbee is established.
The Mavlink library has changed slightly in the latest libraries breaking Ardustation 2. Compile with the Arducopter 2.0.38 or earlier libraries and these errors will be fixed and Ardustation 2 should still work ok with Mavlink in the later APM or ACM software (such as Arducopter 2.0.46). I'm working on fixing these errors with the latest libraries.