mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
fix to check q
Signed-off-by: dirksavage88 <dirksavage88@gmail.com>
This commit is contained in:
parent
11bf3cffde
commit
3e290695ef
@ -84,7 +84,11 @@ void PX4Rangefinder::update(const hrt_abstime ×tamp_sample, const float dis
|
||||
}
|
||||
|
||||
// Update the quaternion in the sample update
|
||||
memcpy(report.q, q, sizeof(float) * q_len);
|
||||
if (q != nullptr) {
|
||||
memcpy(report.q, q, sizeof(float) * q_len);
|
||||
|
||||
}
|
||||
|
||||
|
||||
_distance_sensor_pub.update();
|
||||
}
|
||||
|
||||
@ -63,7 +63,8 @@ public:
|
||||
void set_mode(const uint8_t mode) { _distance_sensor_pub.get().mode = mode; }
|
||||
|
||||
// update with quaterion sensor orientation with respect to the vehicle body frame
|
||||
void update(const hrt_abstime ×tamp_sample, const float distance, const int8_t quality = -1, const float *q = nullptr, uint8_t q_len = 4);
|
||||
void update(const hrt_abstime ×tamp_sample, const float distance, const int8_t quality = -1, const float *q = nullptr,
|
||||
uint8_t q_len = 4);
|
||||
|
||||
int get_instance() { return _distance_sensor_pub.get_instance(); };
|
||||
uint32_t get_device_id() { return _distance_sensor_pub.get().device_id; };
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user