Browse Source

Fixes to MAVLink HIL

sbg
Lorenz Meier 12 years ago
parent
commit
82d2ab677e
  1. 10
      apps/mavlink/mavlink_receiver.c

10
apps/mavlink/mavlink_receiver.c

@ -395,7 +395,7 @@ handle_message(mavlink_message_t *msg)
static uint64_t old_timestamp = 0; static uint64_t old_timestamp = 0;
/* sensors general */ /* sensors general */
hil_sensors.timestamp = imu.time_usec; hil_sensors.timestamp = hrt_absolute_time();
/* hil gyro */ /* hil gyro */
static const float mrad2rad = 1.0e-3f; static const float mrad2rad = 1.0e-3f;
@ -446,12 +446,16 @@ handle_message(mavlink_message_t *msg)
hil_sensors.baro_alt_meter = h; hil_sensors.baro_alt_meter = h;
hil_sensors.baro_temp_celcius = imu.temperature; hil_sensors.baro_temp_celcius = imu.temperature;
hil_sensors.gyro_counter = hil_counter;
hil_sensors.magnetometer_counter = hil_counter;
hil_sensors.accelerometer_counter = hil_counter;
/* publish */ /* publish */
orb_publish(ORB_ID(sensor_combined), pub_hil_sensors, &hil_sensors); orb_publish(ORB_ID(sensor_combined), pub_hil_sensors, &hil_sensors);
// increment counters // increment counters
hil_counter += 1 ; hil_counter++;
hil_frames += 1 ; hil_frames++;
// output // output
if ((timestamp - old_timestamp) > 10000000) { if ((timestamp - old_timestamp) > 10000000) {

Loading…
Cancel
Save