geo: refactoring on comments and usage

This commit is contained in:
Matthias Grob
2021-10-20 15:07:18 +02:00
parent 8db7a6225b
commit 10ceea2fe6
16 changed files with 49 additions and 87 deletions
+2 -2
View File
@@ -264,8 +264,8 @@ private:
uORB::Subscription _vehicle_command_sub{ORB_ID(vehicle_command)};
// hil map_ref data
MapProjection _global_local_proj_ref{};
float _global_local_alt0{NAN};
MapProjection _global_local_proj_ref{};
float _global_local_alt0{NAN};
vehicle_status_s _vehicle_status{};
+1 -5
View File
@@ -547,16 +547,12 @@ void Simulator::handle_message_hil_state_quaternion(const mavlink_message_t *msg
_global_local_alt0 = hil_state.alt / 1000.f;
}
float x;
float y;
_global_local_proj_ref.project(lat, lon, x, y);
hil_lpos.timestamp = timestamp;
hil_lpos.xy_valid = true;
hil_lpos.z_valid = true;
hil_lpos.v_xy_valid = true;
hil_lpos.v_z_valid = true;
hil_lpos.x = x;
hil_lpos.y = y;
_global_local_proj_ref.project(lat, lon, hil_lpos.x, hil_lpos.y);
hil_lpos.z = _global_local_alt0 - hil_state.alt / 1000.0f;
hil_lpos.vx = hil_state.vx / 100.0f;
hil_lpos.vy = hil_state.vy / 100.0f;