Browse Source

FlightTaskManualAltitude: Fix double->float conversion in initialization

This gives an error on some new compilers, e.g. riscv64-unknown-elf 10.2.0

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
release/1.12
Jukka Laitinen 4 years ago committed by Lorenz Meier
parent
commit
ac6e7a1c6c
  1. 4
      src/modules/flight_mode_manager/tasks/ManualAltitude/FlightTaskManualAltitude.hpp
  2. 3
      src/modules/mavlink/mavlink_receiver.cpp

4
src/modules/flight_mode_manager/tasks/ManualAltitude/FlightTaskManualAltitude.hpp

@ -139,8 +139,8 @@ private: @@ -139,8 +139,8 @@ private:
bool _terrain_follow{false}; /**< true when the vehicle is following the terrain height */
bool _terrain_hold{false}; /**< true when vehicle is controlling height above a static ground position */
float _min_distance_to_ground{-INFINITY}; /**< min distance to ground constraint */
float _max_distance_to_ground{INFINITY}; /**< max distance to ground constraint */
float _min_distance_to_ground{(float)(-INFINITY)}; /**< min distance to ground constraint */
float _max_distance_to_ground{(float)INFINITY}; /**< max distance to ground constraint */
/**
* Distance to ground during terrain following.

3
src/modules/mavlink/mavlink_receiver.cpp

@ -2230,7 +2230,8 @@ MavlinkReceiver::handle_message_hil_gps(mavlink_message_t *msg) @@ -2230,7 +2230,8 @@ MavlinkReceiver::handle_message_hil_gps(mavlink_message_t *msg)
gps.vel_n_m_s = (float)(hil_gps.vn) / 100.0f; // cm/s -> m/s
gps.vel_e_m_s = (float)(hil_gps.ve) / 100.0f; // cm/s -> m/s
gps.vel_d_m_s = (float)(hil_gps.vd) / 100.0f; // cm/s -> m/s
gps.cog_rad = ((hil_gps.cog == 65535) ? (float)NAN : matrix::wrap_2pi(math::radians(hil_gps.cog * 1e-2f))); // cdeg -> rad
gps.cog_rad = ((hil_gps.cog == 65535) ? (float)NAN : matrix::wrap_2pi(math::radians(
hil_gps.cog * 1e-2f))); // cdeg -> rad
gps.vel_ned_valid = true;
gps.timestamp_time_relative = 0;

Loading…
Cancel
Save