Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

non-existent mode rosfligt_msgs::Command::MODE_ROLL_PITCH_YAWRATE_ALTITUDE #67

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions roscopter_sim/src/multirotor_forces_and_moments.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,15 +252,15 @@ void MultiRotorForcesAndMoments::UpdateForcesAndMoments()
desired_forces_.n = yaw_controller_.computePID(command_.z, r, sampling_time_);
desired_forces_.Fz = command_.F*actuators_.F.max;
}
else if (command_.mode == rosflight_msgs::Command::MODE_ROLL_PITCH_YAWRATE_ALTITUDE)
{
desired_forces_.l = roll_controller_.computePID(command_.x, phi, sampling_time_, p);
desired_forces_.m = pitch_controller_.computePID(command_.y, theta, sampling_time_, q);
desired_forces_.n = yaw_controller_.computePID(command_.z, r, sampling_time_);
double pddot = -sin(theta)*u + sin(phi)*cos(theta)*v + cos(phi)*cos(theta)*w;
double p1 = alt_controller_.computePID(command_.F, -pd, sampling_time_, -pddot);
desired_forces_.Fz = p1 + (mass_*9.80665)/(cos(command_.x)*cos(command_.y));
}
// else if (command_.mode == rosflight_msgs::Command::MODE_ROLL_PITCH_YAWRATE_ALTITUDE)
// {
// desired_forces_.l = roll_controller_.computePID(command_.x, phi, sampling_time_, p);
// desired_forces_.m = pitch_controller_.computePID(command_.y, theta, sampling_time_, q);
// desired_forces_.n = yaw_controller_.computePID(command_.z, r, sampling_time_);
// double pddot = -sin(theta)*u + sin(phi)*cos(theta)*v + cos(phi)*cos(theta)*w;
// double p1 = alt_controller_.computePID(command_.F, -pd, sampling_time_, -pddot);
// desired_forces_.Fz = p1 + (mass_*9.80665)/(cos(command_.x)*cos(command_.y));
// }

// calculate the actual output force using low-pass-filters to introduce a first-order
// approximation of delay in motor reponse
Expand Down