diff --git a/src/Vehicle/VehicleObjectAvoidance.cc b/src/Vehicle/VehicleObjectAvoidance.cc index dde9998523134c6e1307a1f93120093d13107b7a..d6b9151e9ade14bb798de52bc7f136c596e4d0dd 100644 --- a/src/Vehicle/VehicleObjectAvoidance.cc +++ b/src/Vehicle/VehicleObjectAvoidance.cc @@ -46,7 +46,7 @@ VehicleObjectAvoidance::update(mavlink_obstacle_distance_t* message) //-- Create a plottable grid with found objects _objGrid.clear(); _objDistance.clear(); - VehicleSetpointFactGroup* sp = dynamic_cast(_vehicle->setpointFactGroup()); + auto* sp = qobject_cast(_vehicle->setpointFactGroup()); qreal startAngle = sp->yaw()->rawValue().toDouble() + _angleOffset; for(int i = 0; i < MAVLINK_MSG_OBSTACLE_DISTANCE_FIELD_DISTANCES_LEN; i++) { if(_distances[i] < _maxDistance && message->distances[i] != UINT16_MAX) {