mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-25 09:13:57 -04:00
AP_Avoidance: tidy construction of vector on stack
This commit is contained in:
parent
abc57740ee
commit
e2ced65c04
@ -599,9 +599,11 @@ void AP_Avoidance::handle_msg(const mavlink_message_t &msg)
|
||||
int32_t(packet.alt * 0.1), // mm -> cm
|
||||
Location::AltFrame::ABSOLUTE
|
||||
};
|
||||
Vector3f vel = Vector3f(packet.vx/100.0f, // cm to m
|
||||
packet.vy/100.0f,
|
||||
packet.vz/100.0f);
|
||||
const Vector3f vel {
|
||||
packet.vx * 0.01f, // cm to m
|
||||
packet.vy * 0.01f,
|
||||
packet.vz * 0.01f
|
||||
};
|
||||
add_obstacle(AP_HAL::millis(),
|
||||
MAV_COLLISION_SRC_MAVLINK_GPS_GLOBAL_INT,
|
||||
msg.sysid,
|
||||
|
Loading…
Reference in New Issue
Block a user