Skip to content

Commit

Permalink
vtol_type: improve comments
Browse files Browse the repository at this point in the history
Signed-off-by: Roman <[email protected]>
  • Loading branch information
RomanBapst committed Mar 23, 2018
1 parent c434d7e commit 5507d88
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 11 deletions.
11 changes: 0 additions & 11 deletions src/modules/vtol_att_control/vtol_type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,9 +254,6 @@ void VtolType::check_quadchute_condition()
}
}

/**
* Adjust idle speed for mc mode.
*/
bool VtolType::set_idle_mc()
{
const char *dev = PWM_OUTPUT0_DEVICE_PATH;
Expand Down Expand Up @@ -289,9 +286,6 @@ bool VtolType::set_idle_mc()
return ret == PX4_OK;
}

/**
* Adjust idle speed for fw mode.
*/
bool VtolType::set_idle_fw()
{
const char *dev = PWM_OUTPUT0_DEVICE_PATH;
Expand Down Expand Up @@ -323,11 +317,6 @@ bool VtolType::set_idle_fw()
return ret == PX4_OK;
}

/**
* Set state of selected motors.
* See _params->fw_motors_off for selection of motors.
*/

motor_state VtolType::set_motor_state(const motor_state current_state, const motor_state next_state, const int value)
{
struct pwm_output_values pwm_values = {};
Expand Down
41 changes: 41 additions & 0 deletions src/modules/vtol_att_control/vtol_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ class VtolType
*/
bool can_transition_on_ground();



mode get_mode() {return _vtol_mode;}

virtual void parameters_update() = 0;
Expand Down Expand Up @@ -205,16 +207,55 @@ class VtolType

motor_state _motor_state = motor_state::DISABLED;



/**
* @brief Sets mc motor minimum pwm to VT_IDLE_PWM_MC which ensures
* that they are spinning in mc mode.
*
* @return true on success
*/
bool set_idle_mc();

/**
* @brief Sets mc motor minimum pwm to PWM_MIN which ensures that the
* motors stop spinning on zero throttle in fw mode.
*
* @return true on success
*/
bool set_idle_fw();


/**
* @brief Sets state of a selection of motors, see struct motor_state
*
* @param[in] current_state The current motor state
* @param[in] next_state The next state
* @param[in] value Desired pwm value if next_state =
* motor_state::VALUE
*
* @return next_state if succesfull, otherwise current_state
*/
motor_state set_motor_state(const motor_state current_state, const motor_state next_state, const int value = 0);

private:


/**
* @brief Stores the max pwm values given by the system.
*/
struct pwm_output_values _max_mc_pwm_values {};
struct pwm_output_values _disarmed_pwm_values {};



/**
* @brief Determines if this channel is one selected by VT_FW_MOT_OFFID
*
* @param[in] channel The channel
*
* @return True if motor off channel, False otherwise.
*/
bool is_motor_off_channel(const int channel);

};
Expand Down

0 comments on commit 5507d88

Please sign in to comment.