36 #include <px4_platform_common/log.h> 42 ModuleParams(nullptr),
43 WorkItem(MODULE_NAME,
px4::wq_configurations::att_pos_ctrl)
77 sub.unregisterCallback();
128 sub.unregisterCallback();
131 const int sensor_new = corrections.selected_accel_instance;
133 if (_sensor_sub[sensor_new].registerCallback()) {
134 PX4_DEBUG(
"selected sensor changed %d -> %d",
_selected_sensor, sensor_new);
184 const Vector3f val{sensor_data.
x, sensor_data.
y, sensor_data.
z};
197 accel.copyTo(out.xyz);
200 _vehicle_acceleration_pub.publish(out);
bool copy(void *dst)
Copy the struct.
void ParametersUpdate(bool force=false)
uint64_t timestamp_sample
virtual ~VehicleAcceleration()
bool SensorCorrectionsUpdate(bool force=false)
uORB::Subscription _sensor_correction_sub
sensor thermal correction subscription
uORB::SubscriptionCallbackWorkItem _sensor_sub[MAX_SENSOR_COUNT]
sensor data subscription
Rotation
Enum for board and external compass rotations.
uORB::Subscription _sensor_bias_sub
sensor in-run bias correction subscription
constexpr T radians(T degrees)
bool updated()
Check if there is a new update.
matrix::Dcmf _board_rotation
rotation matrix for the orientation that the board is mounted
void unregisterCallback()
void SensorBiasUpdate(bool force=false)
__EXPORT matrix::Dcmf get_rot_matrix(enum Rotation rot)
Get the rotation matrix.
static constexpr int MAX_SENSOR_COUNT
bool copy(void *dst)
Copy the struct.
DEFINE_PARAMETERS((ParamInt< px4::params::SENS_BOARD_ROT >) _param_sens_board_rot,(ParamFloat< px4::params::SENS_BOARD_X_OFF >) _param_sens_board_x_off,(ParamFloat< px4::params::SENS_BOARD_Y_OFF >) _param_sens_board_y_off,(ParamFloat< px4::params::SENS_BOARD_Z_OFF >) _param_sens_board_z_off) uORB uORB::Subscription _params_sub
parameter updates subscription
__EXPORT hrt_abstime hrt_absolute_time(void)
Get absolute time in [us] (does not wrap).
uORB::SubscriptionCallbackWorkItem _sensor_selection_sub
selected primary sensor subscription