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

Fix for colinear waypoints #66

Open
wants to merge 1 commit into
base: RC1.0
Choose a base branch
from
Open
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion rosplane/include/path_manager_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ class path_manager_base

virtual void manage(const struct params_s &params, const struct input_s &input, struct output_s &output) = 0;

rosplane_msgs::State vehicle_state_; /**< vehicle state */

private:

ros::NodeHandle nh_;
Expand All @@ -79,7 +81,6 @@ class path_manager_base

struct params_s params_;

rosplane_msgs::State vehicle_state_; /**< vehicle state */

double update_rate_;
ros::Timer update_timer_;
Expand Down
15 changes: 14 additions & 1 deletion rosplane/src/path_manager_example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ void path_manager_example::manage_fillet(const params_s &params, const input_s &
Eigen::Vector3f w_i(waypoints_[idx_b].w);
Eigen::Vector3f w_ip1(waypoints_[idx_c].w);

float chi_e;

float R_min = params.R_min;

output.Va_d = waypoints_[idx_a_].Va_d;
Expand All @@ -148,7 +150,18 @@ void path_manager_example::manage_fillet(const params_s &params, const input_s &
output.lambda = 1;
z = w_i - q_im1*(R_min/tanf(beta/2.0));
if ((p - z).dot(q_im1) > 0)
fil_state_ = fillet_state::ORBIT;
chi_e = atan2f(q_i(1), q_i(0)) - vehicle_state_.chi;
while (chi_e > M_PI_F)
chi_e -= 2*M_PI_F;
while (chi_e < -M_PI_F)
chi_e += 2*M_PI_F;
if (abs(chi_e) > M_PI_F/18)
fil_state_ = fillet_state::ORBIT;
else if (idx_a_ == num_waypoints_ - 1)
idx_a_ = 0;
else
idx_a_++;

break;
case fillet_state::ORBIT:
output.flag = false;
Expand Down