mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-20 10:19:05 +08:00
Move MAVLink to new mag interface
This commit is contained in:
parent
801e9ed4fb
commit
f641a26fee
@ -1086,10 +1086,11 @@ MavlinkReceiver::handle_message_hil_sensor(mavlink_message_t *msg)
|
||||
mag.z = imu.zmag;
|
||||
|
||||
if (_mag_pub < 0) {
|
||||
_mag_pub = orb_advertise(ORB_ID(sensor_mag0), &mag);
|
||||
/* publish to the first mag topic */
|
||||
_mag_pub = orb_advertise(ORB_ID(sensor_mag), &mag);
|
||||
|
||||
} else {
|
||||
orb_publish(ORB_ID(sensor_mag0), _mag_pub, &mag);
|
||||
orb_publish(ORB_ID(sensor_mag), _mag_pub, &mag);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user