AP_Follow: fix initialisation of offsets

This commit is contained in:
Randy Mackay 2018-07-14 15:42:04 +09:00
parent 0834e7ae9b
commit 465564ba99
2 changed files with 3 additions and 3 deletions

View File

@ -329,11 +329,11 @@ bool AP_Follow::get_velocity_ned(Vector3f &vel_ned, float dt) const
return true;
}
// initialise offsets to provided distance vector (in meters in NED frame) if required
// initialise offsets to provided distance vector to other vehicle (in meters in NED frame) if required
void AP_Follow::init_offsets_if_required(const Vector3f &dist_vec_ned)
{
if (_offset.get().is_zero()) {
_offset = dist_vec_ned;
_offset = -dist_vec_ned;
}
}

View File

@ -81,7 +81,7 @@ private:
// get velocity estimate in m/s in NED frame using dt since last update
bool get_velocity_ned(Vector3f &vel_ned, float dt) const;
// initialise offsets to provided distance vector (in meters in NED frame) if required
// initialise offsets to provided distance vector to other vehicle (in meters in NED frame) if required
void init_offsets_if_required(const Vector3f &dist_vec_ned);
// get offsets in meters in NED frame