diff --git a/src/lib/drivers/magnetometer/PX4Magnetometer.cpp b/src/lib/drivers/magnetometer/PX4Magnetometer.cpp index 40907d870d6d..d13133ef14f8 100644 --- a/src/lib/drivers/magnetometer/PX4Magnetometer.cpp +++ b/src/lib/drivers/magnetometer/PX4Magnetometer.cpp @@ -40,6 +40,7 @@ PX4Magnetometer::PX4Magnetometer(uint32_t device_id, enum Rotation rotation) : _device_id{device_id}, _rotation{rotation} { + _sensor_pub.advertise(); } PX4Magnetometer::~PX4Magnetometer()