Skip to content

Commit

Permalink
src/lib/drivers/magnetometer/PX4Magnetometer.cpp: Advertise the orb w…
Browse files Browse the repository at this point in the history
…hen creating magnetometer driver instance

This ensures that magnetometers instance numbers are allocated in the driver start order.

It is problematic if the magnetometers get different IDs on different HW even if the start order of the
drivers in the init scripts is the same.

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
  • Loading branch information
jlaitine committed Nov 18, 2024
1 parent e9a9626 commit 20ff30c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/lib/drivers/magnetometer/PX4Magnetometer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ PX4Magnetometer::PX4Magnetometer(uint32_t device_id, enum Rotation rotation) :
_device_id{device_id},
_rotation{rotation}
{
_sensor_pub.advertise();
}

PX4Magnetometer::~PX4Magnetometer()
Expand Down

0 comments on commit 20ff30c

Please # to comment.