ArduSub: Add missing const in member functions

Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
This commit is contained in:
Patrick José Pereira 2021-02-01 13:26:24 -03:00 committed by Andrew Tridgell
parent cdc7f891a9
commit 678cbdfb4f
4 changed files with 8 additions and 8 deletions

View File

@ -34,7 +34,7 @@ void Sub::get_pilot_desired_lean_angles(float roll_in, float pitch_in, float &ro
// get_pilot_desired_heading - transform pilot's yaw input into a
// desired yaw rate
// returns desired yaw rate in centi-degrees per second
float Sub::get_pilot_desired_yaw_rate(int16_t stick_angle)
float Sub::get_pilot_desired_yaw_rate(int16_t stick_angle) const
{
// convert pilot input to the desired yaw rate
return stick_angle * g.acro_yaw_p;
@ -195,7 +195,7 @@ void Sub::rotate_body_frame_to_NE(float &x, float &y)
}
// It will return the PILOT_SPEED_DN value if non zero, otherwise if zero it returns the PILOT_SPEED_UP value.
uint16_t Sub::get_pilot_speed_dn()
uint16_t Sub::get_pilot_speed_dn() const
{
if (g.pilot_speed_dn == 0) {
return abs(g.pilot_speed_up);

View File

@ -417,7 +417,7 @@ private:
void update_altitude();
float get_smoothing_gain();
void get_pilot_desired_lean_angles(float roll_in, float pitch_in, float &roll_out, float &pitch_out, float angle_max);
float get_pilot_desired_yaw_rate(int16_t stick_angle);
float get_pilot_desired_yaw_rate(int16_t stick_angle) const;
void check_ekf_yaw_reset();
float get_roi_yaw();
float get_look_ahead_yaw();
@ -476,7 +476,7 @@ private:
void auto_nav_guided_run();
bool auto_loiter_start();
void auto_loiter_run();
uint8_t get_default_auto_yaw_mode(bool rtl);
uint8_t get_default_auto_yaw_mode(bool rtl) const;
void set_auto_yaw_mode(uint8_t yaw_mode);
void set_auto_yaw_look_at_heading(float angle_deg, float turn_rate_dps, int8_t direction, uint8_t relative_angle);
void set_auto_yaw_roi(const Location &roi_location);
@ -556,7 +556,7 @@ private:
void read_barometer(void);
void init_rangefinder(void);
void read_rangefinder(void);
bool rangefinder_alt_ok(void);
bool rangefinder_alt_ok(void) const;
#if OPTFLOW == ENABLED
void init_optflow();
#endif
@ -626,7 +626,7 @@ private:
bool surface_init(void);
void surface_run();
uint16_t get_pilot_speed_dn();
uint16_t get_pilot_speed_dn() const;
void convert_old_parameters(void);
bool handle_do_motor_test(mavlink_command_long_t command);

View File

@ -426,7 +426,7 @@ void Sub::auto_loiter_run()
// get_default_auto_yaw_mode - returns auto_yaw_mode based on WP_YAW_BEHAVIOR parameter
// set rtl parameter to true if this is during an RTL
uint8_t Sub::get_default_auto_yaw_mode(bool rtl)
uint8_t Sub::get_default_auto_yaw_mode(bool rtl) const
{
switch (g.wp_yaw_behavior) {

View File

@ -66,7 +66,7 @@ void Sub::read_rangefinder()
}
// return true if rangefinder_alt can be used
bool Sub::rangefinder_alt_ok()
bool Sub::rangefinder_alt_ok() const
{
return (rangefinder_state.enabled && rangefinder_state.alt_healthy);
}