SITL: send buffer rather than mavlink msg on channel

This commit is contained in:
Peter Barker 2018-04-09 12:15:32 +10:00 committed by Andrew Tridgell
parent 7e4972a061
commit c92554001f
1 changed files with 4 additions and 1 deletions

View File

@ -117,8 +117,11 @@ void Vicon::update_vicon_position_estimate(const Location &loc,
pitch,
yaw);
uint8_t msgbuf[512];
uint16_t msgbuf_len = mavlink_msg_to_send_buffer(msgbuf, &msg);
// ::fprintf(stderr, "Vicon: %u: writing pos=(%03.03f %03.03f %03.03f) att=(%01.03f %01.03f %01.03f)\n", observation.time_ms, observation.position.x, observation.position.y, observation.position.z, roll, pitch, yaw);
if (::write(fd_my_end, (void*)&msg, n) != n) {
if (::write(fd_my_end, (void*)&msgbuf, msgbuf_len) != n) {
::fprintf(stderr, "Vicon: write failure\n");
// abort();
}