fix(afbrs50): keep the AFBR-S50 device type in the device ID (#29104)

set_device_type writes the device ID's devtype, so passing the MAVLink sensor type there replaced DRV_DIST_DEVTYPE_AFBRS50 with 0 and every AFBR-S50 reported an unknown device. The MAVLink type belongs in set_rangefinder_type.
This commit is contained in:
Jacob Dahl authored and GitHub committed 2026-10-12 17:43:56 -06:00
1 parent edeba2f8f6
commit 97a3c7f017
1 file changed
+1 -1
@@ -95,7 +95,7 @@ AFBRS50::AFBRS50():
device_id.devid_s.devtype = DRV_DIST_DEVTYPE_AFBRS50;
_px4_rangefinder.set_device_id(device_id.devid);
_px4_rangefinder.set_device_type(distance_sensor_s::MAV_DISTANCE_SENSOR_LASER);
_px4_rangefinder.set_rangefinder_type(distance_sensor_s::MAV_DISTANCE_SENSOR_LASER);
}
AFBRS50::~AFBRS50()