Skip to content

Commit

Permalink
better tuning for simple_flight
Browse files Browse the repository at this point in the history
  • Loading branch information
sytelus committed Jul 29, 2017
1 parent 74b476d commit b38c98e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions AirLib/include/controllers/simple_flight/firmware/Params.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ struct Params {
float min_armed_output = 0.2f;

static constexpr float pi = 3.14159265359f; //180-degrees
float max_pitch_rate = 1.5f, max_roll_rate = 1.5f, max_yaw_rate = 1.5f; //in radians/sec
float max_pitch_rate = 2.0f, max_roll_rate = 2.0f, max_yaw_rate = 2.0f; //in radians/sec
float max_pitch_angle = pi / 6, max_roll_angle = pi / 6, max_yaw_angle = pi; // in radians

//stabilizer params
float p_pitch_rate = 0.5f, p_roll_rate = 0.5f, p_yaw_rate = 0.5f;
float p_pitch_angle = 0.5f, p_roll_angle = 0.5f, p_yaw_angle = 0.5f;
float p_pitch_angle = 1.5f, p_roll_angle = 1.5f, p_yaw_angle = 1.5f;

ControlMode default_control_mode = ControlMode::Angle;
};
Expand Down
3 changes: 3 additions & 0 deletions AirLib/include/physics/FastPhysicsEngine.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,9 @@ class FastPhysicsEngine : public PhysicsEngineBase {
VectorMath::toEulerianAngle(next.pose.orientation, pitch, roll, yaw);
pitch = roll = 0;
next.pose.orientation = VectorMath::toQuaternion(pitch, roll, yaw);

//there is a lot of random angular velocity when vehicle is on the ground
next.twist.angular = Vector3r::Zero();
}
//else keep the orientation
next.pose.position = collison_info.position + (collison_info.normal * collison_info.penetration_depth) + next.twist.linear * (dt_real * kCollisionResponseCycles);
Expand Down

0 comments on commit b38c98e

Please sign in to comment.