Skip to content

Commit

Permalink
fix angle oscillation
Browse files Browse the repository at this point in the history
  • Loading branch information
renan028 authored and corot committed Nov 7, 2023
1 parent 3dedf54 commit c02460e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion mbf_abstract_nav/src/controller_action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ void ControllerAction::runImpl(GoalHandle &goal_handle, AbstractControllerExecut
double oscillation_distance;
private_nh.param("oscillation_distance", oscillation_distance, 0.03);

double oscillation_angle;
private_nh.param("oscillation_angle", oscillation_angle, M_PI);

mbf_msgs::ExePathResult result;
mbf_msgs::ExePathFeedback feedback;

Expand Down Expand Up @@ -276,7 +279,8 @@ void ControllerAction::runImpl(GoalHandle &goal_handle, AbstractControllerExecut
if (!oscillation_timeout.isZero())
{
// check if oscillating
if (mbf_utility::distance(robot_pose_, oscillation_pose) >= oscillation_distance)
if (mbf_utility::distance(robot_pose_, oscillation_pose) >= oscillation_distance ||
mbf_utility::angle(robot_pose_, oscillation_pose) >= oscillation_angle)
{
last_oscillation_reset = ros::Time::now();
oscillation_pose = robot_pose_;
Expand Down

0 comments on commit c02460e

Please sign in to comment.