ahrs should be a reference to DummyVehicle::ahrs, otherwise it will act on a different object. This also corrects the member initialization order: only pass a copy or reference of an object to a constructor if it has already been initialized.