PX4-Autopilot icon indicating copy to clipboard operation
PX4-Autopilot copied to clipboard

PX4Rangefinder update quaternion

Open dirksavage88 opened this issue 2 weeks ago • 3 comments

Solved Problem

Rangefinder library sets orientation but not the quaternion array in the distance_sensor struct. Useful for future collision prevention implementations with 2d rangefinders instead of relying on the obstacle distance array.

Solution

Create a separate method to update the quaternion (to not break backwards compatibility). Reconcile the timestamp of the quaternion update with the actual sample timestamp and compare, if it is a fresh quaternion update include it in the sample update

Changelog Entry

For release notes:

Feature: create method to update quaternion for PX4 Rangefinders

Alternatives

Claudio's implementation: https://github.com/PX4/PX4-Autopilot/commits/SF45-Rangefinder_approach/ Use obstacle distance.

Test coverage

Pixhawk 6c + vl53l1x

Context

image

dirksavage88 avatar Dec 04 '25 15:12 dirksavage88

Thanks! Waiting for CI!

farhangnaderi avatar Dec 04 '25 16:12 farhangnaderi

The new function is not implemented anywhere?

dakejahl avatar Dec 04 '25 17:12 dakejahl

The new function is not implemented anywhere?

Just added the ST LiDAR as an example. A better use case would be the sf45 which Claudio already implemented on his feature branch

dirksavage88 avatar Dec 05 '25 01:12 dirksavage88

This pull request has been mentioned on Discussion Forum for PX4, Pixhawk, QGroundControl, MAVSDK, MAVLink. There might be relevant details there:

https://discuss.px4.io/t/px4-dev-call-dec-17-2025-team-sync-and-community-q-a/48141/1

DronecodeBot avatar Dec 17 '25 16:12 DronecodeBot