mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-24 15:40:31 +08:00
revert to passing raw pointer and length
Signed-off-by: dirksavage88 <dirksavage88@gmail.com>
This commit is contained in:
committed by
Matthias Grob
parent
b64860f9f8
commit
ba4437ae60
@@ -69,7 +69,7 @@ void PX4Rangefinder::set_orientation(const uint8_t device_orientation)
|
||||
}
|
||||
|
||||
|
||||
void PX4Rangefinder::update(const hrt_abstime ×tamp_sample, const float distance, const int8_t quality, const float (&quat)[4])
|
||||
void PX4Rangefinder::update(const hrt_abstime ×tamp_sample, const float distance, const int8_t quality, const float *q, uint8_t q_len)
|
||||
{
|
||||
distance_sensor_s &report = _distance_sensor_pub.get();
|
||||
report.timestamp = timestamp_sample;
|
||||
@@ -84,7 +84,7 @@ void PX4Rangefinder::update(const hrt_abstime ×tamp_sample, const float dis
|
||||
}
|
||||
|
||||
// Update the quaternion in the sample update
|
||||
memcpy(report.q, quat, sizeof(float) * 4);
|
||||
memcpy(report.q, q, sizeof(float) * q_len);
|
||||
|
||||
_distance_sensor_pub.update();
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ 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 (&quat)[4] = {1.0, 0.0, 0.0, 0.0});
|
||||
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; };
|
||||
|
||||
Reference in New Issue
Block a user