Skip to content

Commit

Permalink
Fixes, disable SITL swinging
Browse files Browse the repository at this point in the history
  • Loading branch information
MichelleRos committed Aug 20, 2024
1 parent cd15026 commit 5831ef9
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions Blimp/Loiter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -836,8 +836,8 @@ const AP_Param::GroupInfo Loiter::var_info[] = {
AP_SUBGROUPINFO(pid_lvl_pitch, "LVLPIT_", 20, Loiter, AC_PID),
AP_SUBGROUPINFO(pid_lvl_roll, "LVLRLL_", 21, Loiter, AC_PID),
AP_GROUPINFO("LVLMAX", 22, Loiter, level_max, 0), //Max throttle output to level, use 0 to disable
AP_GROUPINFO("LVLDZ", 23, Loiter, level_dz, 0), //Deadzone in degrees (no level output when roll/pitch below this amount from zero, 0 to disable
AP_GROUPINFO("MAX_VELYAWS", 24, Loiter, max_vel_yaw_s, 0), //max yaw velocity in level mode, in rad/s
AP_GROUPINFO("LVLDZ", 23, Loiter, level_dz, 0), //Deadzone in degrees (no level output when roll/pitch below this amount from zero, 0 to disable)
AP_GROUPINFO("MAX_VELYAWS", 24, Loiter, max_vel_yaws, 0), //max yaw velocity in level mode, in rad/s

AP_GROUPEND
};
Expand Down Expand Up @@ -1135,7 +1135,7 @@ void Loiter::run_level_pitch(float& out_front_com)

void Loiter::run_yaw_stab(float& out_yaw_com)
{
if (is_zero(max_vel_yaw_s)) {
if (is_zero(max_vel_yaws)) {
blimp.motors->yaw_out = out_yaw_com;
} else {
const float dt = blimp.scheduler.get_last_loop_time_s();
Expand Down
2 changes: 1 addition & 1 deletion Blimp/Loiter.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class Loiter
AC_PID pid_lvl_roll{1, 0.2, 0, 0, 0.5, 0, 0, 0};
AP_Float level_max;
AP_Float level_dz;
AP_Float max_vel_yaw_s;
AP_Float max_vel_yaws;

AP_Float max_vel_x;
AP_Float max_vel_y;
Expand Down
4 changes: 2 additions & 2 deletions Blimp/mode_level.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ bool ModeLevel::init(bool ignore_checks)
if (is_zero(blimp.loiter->level_max)){
GCS_SEND_TEXT(MAV_SEVERITY_WARNING, "LOIT_LVLMAX is zero. Leveling is disabled.");
}
if (is_zero(blimp.loiter->max_vel_yaw_s)){
GCS_SEND_TEXT(MAV_SEVERITY_WARNING, "LOIT_MAX_VEL_YAW_S is zero. Yaw rate stabilization is manual.");
if (is_zero(blimp.loiter->max_vel_yaws)){
GCS_SEND_TEXT(MAV_SEVERITY_WARNING, "LOIT_MAX_VEL_YAWS is zero. Yaw rate stabilization is manual.");
}
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion Tools/autotest/default_params/blimp-motor.parm
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ SERVO4_TRIM 1500

FINS_THR_MAX 0.4

LOIT_POS_LAG 0.1
LOIT_POS_LAG 1.0

# default PID params for position and velocity-controlled modes
LOIT_MAX_POS_X 2.0
Expand Down
2 changes: 1 addition & 1 deletion libraries/SITL/SIM_Blimp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ void Blimp::calculate_forces(const struct sitl_input &input, Vector3f &body_acc,
Vector3f rot_T{0,0,0};
rot_T.z = mot[0].thrust * gondolawidth - mot[1].thrust * gondolawidth; //in N*m (Torque = force * lever arm)

#if 1 //Swing effect attempt
#if 0 //Swing effect attempt
//Swing effect generated by the motors - at the bottom of the blimp rather than cog since the gondola is mounted to the bottom.
rot_T.x = -mot[3].thrust*radius; //roll force generated by the motors
rot_T.y = (mot[0].thrust + mot[1].thrust)*radius; //pitch force generated by the motors
Expand Down

0 comments on commit 5831ef9

Please sign in to comment.