Mavlink receiver: Move most variable initializations out of the constructor to the variable declarations

This commit is contained in:
Mark Sauder
2019-02-26 11:48:02 -05:00
committed by Daniel Agar
parent 20c2d66ba3
commit c04147c53c
2 changed files with 90 additions and 142 deletions
-52
View File
@@ -89,58 +89,6 @@ MavlinkReceiver::MavlinkReceiver(Mavlink *parent) :
_mavlink_ftp(parent),
_mavlink_log_handler(parent),
_mavlink_timesync(parent),
_status{},
_hil_local_pos{},
_hil_land_detector{},
_control_mode{},
_global_pos_pub(nullptr),
_local_pos_pub(nullptr),
_attitude_pub(nullptr),
_gps_pub(nullptr),
_gyro_pub(nullptr),
_accel_pub(nullptr),
_mag_pub(nullptr),
_baro_pub(nullptr),
_airspeed_pub(nullptr),
_battery_pub(nullptr),
_cmd_pub(nullptr),
_flow_pub(nullptr),
_hil_distance_sensor_pub(nullptr),
_flow_distance_sensor_pub(nullptr),
_distance_sensor_pub(nullptr),
_offboard_control_mode_pub(nullptr),
_actuator_controls_pubs{nullptr, nullptr, nullptr, nullptr},
_att_sp_pub(nullptr),
_rates_sp_pub(nullptr),
_pos_sp_triplet_pub(nullptr),
_mocap_odometry_pub(nullptr),
_visual_odometry_pub(nullptr),
_radio_status_pub(nullptr),
_ping_pub(nullptr),
_rc_pub(nullptr),
_manual_pub(nullptr),
_obstacle_distance_pub(nullptr),
_trajectory_waypoint_pub(nullptr),
_land_detector_pub(nullptr),
_follow_target_pub(nullptr),
_landing_target_pose_pub(nullptr),
_transponder_report_pub(nullptr),
_collision_report_pub(nullptr),
_debug_key_value_pub(nullptr),
_debug_value_pub(nullptr),
_debug_vect_pub(nullptr),
_debug_array_pub(nullptr),
_gps_inject_data_pub(nullptr),
_command_ack_pub(nullptr),
_hil_frames(0),
_old_timestamp(0),
_hil_local_proj_inited(0),
_hil_local_alt0(0.0f),
_hil_local_proj_ref{},
_offboard_control_mode{},
_orb_class_instance(-1),
_mom_switch_pos{},
_mom_switch_state(0),
_p_bat_emergen_thr(param_find("BAT_EMERGEN_THR")),
_p_bat_crit_thr(param_find("BAT_CRIT_THR")),
_p_bat_low_thr(param_find("BAT_LOW_THR")),