sensors (accel/gyro/mag) determine if external with device id

This commit is contained in:
Daniel Agar
2022-01-10 10:31:07 -05:00
committed by GitHub
parent 45040be669
commit e731fcdbc0
36 changed files with 187 additions and 205 deletions
@@ -75,8 +75,6 @@ void PX4Magnetometer::update(const hrt_abstime &timestamp_sample, float x, float
report.y = y * _scale;
report.z = z * _scale;
report.is_external = _external;
report.timestamp = hrt_absolute_time();
_sensor_pub.publish(report);
}
@@ -44,15 +44,12 @@ public:
PX4Magnetometer(uint32_t device_id, enum Rotation rotation = ROTATION_NONE);
~PX4Magnetometer();
bool external() { return _external; }
void set_device_id(uint32_t device_id) { _device_id = device_id; }
void set_device_type(uint8_t devtype);
void set_error_count(uint32_t error_count) { _error_count = error_count; }
void increase_error_count() { _error_count++; }
void set_scale(float scale) { _scale = scale; }
void set_temperature(float temperature) { _temperature = temperature; }
void set_external(bool external) { _external = external; }
void update(const hrt_abstime &timestamp_sample, float x, float y, float z);
@@ -67,6 +64,4 @@ private:
float _scale{1.f};
float _temperature{NAN};
uint32_t _error_count{0};
bool _external{false};
};