APM:Libraries
libraries
AP_InertialSensor
AP_InertialSensor_HIL.cpp
Go to the documentation of this file.
1
#include <
AP_HAL/AP_HAL.h
>
2
#include "
AP_InertialSensor_HIL.h
"
3
4
const
extern
AP_HAL::HAL
&
hal
;
5
6
AP_InertialSensor_HIL::AP_InertialSensor_HIL
(
AP_InertialSensor
&imu) :
7
AP_InertialSensor_Backend
(imu)
8
{
9
}
10
11
/*
12
detect the sensor
13
*/
14
AP_InertialSensor_Backend
*
AP_InertialSensor_HIL::detect
(
AP_InertialSensor
&
_imu
)
15
{
16
AP_InertialSensor_HIL
*sensor =
new
AP_InertialSensor_HIL
(_imu);
17
if
(sensor ==
nullptr
) {
18
return
nullptr
;
19
}
20
if
(!sensor->
_init_sensor
()) {
21
delete
sensor;
22
return
nullptr
;
23
}
24
return
sensor;
25
}
26
27
bool
AP_InertialSensor_HIL::_init_sensor
(
void
)
28
{
29
// grab the used instances
30
_imu
.
register_gyro
(1200, 1);
31
_imu
.
register_accel
(1200, 1);
32
33
_imu
.
set_hil_mode
();
34
35
return
true
;
36
}
37
38
bool
AP_InertialSensor_HIL::update
(
void
)
39
{
40
// the data is stored directly in the frontend, so update()
41
// doesn't need to do anything
42
return
true
;
43
}
AP_InertialSensor_HIL::AP_InertialSensor_HIL
AP_InertialSensor_HIL(AP_InertialSensor &imu)
Definition:
AP_InertialSensor_HIL.cpp:6
AP_HAL.h
AP_InertialSensor::register_gyro
uint8_t register_gyro(uint16_t raw_sample_rate_hz, uint32_t id)
Definition:
AP_InertialSensor.cpp:490
AP_InertialSensor_HIL.h
AP_InertialSensor_Backend
Definition:
AP_InertialSensor_Backend.h:41
AP_InertialSensor::register_accel
uint8_t register_accel(uint16_t raw_sample_rate_hz, uint32_t id)
Definition:
AP_InertialSensor.cpp:524
AP_HAL::HAL
Definition:
HAL.h:26
AP_InertialSensor
Definition:
AP_InertialSensor.h:47
AP_InertialSensor_HIL
Definition:
AP_InertialSensor_HIL.h:6
AP_InertialSensor_HIL::_init_sensor
bool _init_sensor(void)
Definition:
AP_InertialSensor_HIL.cpp:27
hal
const AP_HAL::HAL & hal
-*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
Definition:
AC_PID_test.cpp:14
AP_InertialSensor_Backend::_imu
AP_InertialSensor & _imu
Definition:
AP_InertialSensor_Backend.h:111
AP_InertialSensor_HIL::update
bool update()
Definition:
AP_InertialSensor_HIL.cpp:38
AP_InertialSensor_HIL::detect
static AP_InertialSensor_Backend * detect(AP_InertialSensor &imu)
Definition:
AP_InertialSensor_HIL.cpp:14
AP_InertialSensor::set_hil_mode
void set_hil_mode(void)
Definition:
AP_InertialSensor.h:207
Generated on Sun Jun 17 2018 14:18:49 for APM:Libraries by
1.8.13