mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-02 14:13:42 -04:00
785dc36f20
This commit changes the way libraries headers are included in source files: - If the header is in the same directory the source belongs to, so the notation '#include ""' is used with the path relative to the directory containing the source. - If the header is outside the directory containing the source, then we use the notation '#include <>' with the path relative to libraries folder. Some of the advantages of such approach: - Only one search path for libraries headers. - OSs like Windows may have a better lookup time.
47 lines
1006 B
C++
47 lines
1006 B
C++
/// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
|
|
|
|
#include <AP_HAL/AP_HAL.h>
|
|
#include "AP_InertialSensor_HIL.h"
|
|
|
|
const extern AP_HAL::HAL& hal;
|
|
|
|
AP_InertialSensor_HIL::AP_InertialSensor_HIL(AP_InertialSensor &imu) :
|
|
AP_InertialSensor_Backend(imu)
|
|
{
|
|
}
|
|
|
|
/*
|
|
detect the sensor
|
|
*/
|
|
AP_InertialSensor_Backend *AP_InertialSensor_HIL::detect(AP_InertialSensor &_imu)
|
|
{
|
|
AP_InertialSensor_HIL *sensor = new AP_InertialSensor_HIL(_imu);
|
|
if (sensor == NULL) {
|
|
return NULL;
|
|
}
|
|
if (!sensor->_init_sensor()) {
|
|
delete sensor;
|
|
return NULL;
|
|
}
|
|
return sensor;
|
|
}
|
|
|
|
bool AP_InertialSensor_HIL::_init_sensor(void)
|
|
{
|
|
// grab the used instances
|
|
_imu.register_gyro();
|
|
_imu.register_accel();
|
|
|
|
_product_id = AP_PRODUCT_ID_NONE;
|
|
_imu.set_hil_mode();
|
|
|
|
return true;
|
|
}
|
|
|
|
bool AP_InertialSensor_HIL::update(void)
|
|
{
|
|
// the data is stored directly in the frontend, so update()
|
|
// doesn't need to do anything
|
|
return true;
|
|
}
|