Skip to content
Snippets Groups Projects
Commit 09192fa9 authored by José Enrique Domínguez Vidal's avatar José Enrique Domínguez Vidal
Browse files

Code cleaning

parent e978ee0e
No related branches found
No related tags found
No related merge requests found
...@@ -149,7 +149,7 @@ namespace rotational_recovery ...@@ -149,7 +149,7 @@ namespace rotational_recovery
cost = normalizedPoseCost(current); cost = normalizedPoseCost(current);
double t; // Will hold the first time that is invalid double t; // Will hold the first time that is invalid
geometry_msgs::Pose2D current_tmp = current; geometry_msgs::Pose2D current_tmp = current;
ROS_INFO_NAMED ("top", "init = (%.2f, %.2f, %.2f), current = (%.2f, %.2f, %.2f)", ROS_DEBUG_NAMED ("top", "init = (%.2f, %.2f, %.2f), current = (%.2f, %.2f, %.2f)",
current.x, current.y, current.theta, current_tmp.x, current_tmp.y, current_tmp.theta); current.x, current.y, current.theta, current_tmp.x, current_tmp.y, current_tmp.theta);
double next_cost; double next_cost;
......
...@@ -194,6 +194,7 @@ namespace twist_recovery ...@@ -194,6 +194,7 @@ namespace twist_recovery
void TwistRecovery::runBehavior () void TwistRecovery::runBehavior ()
{ {
ROS_ASSERT (initialized_); ROS_ASSERT (initialized_);
double stop_time = 0.5;
// Threre is a maximum duration this recovery can run defined in duration_. // Threre is a maximum duration this recovery can run defined in duration_.
// However, there may be an obstacle so it is necessary to figure out how // However, there may be an obstacle so it is necessary to figure out how
...@@ -210,6 +211,13 @@ namespace twist_recovery ...@@ -210,6 +211,13 @@ namespace twist_recovery
pub_.publish(scaleGivenAccelerationLimits(base_frame_twist_, max_duration-t)); pub_.publish(scaleGivenAccelerationLimits(base_frame_twist_, max_duration-t));
r.sleep(); r.sleep();
} }
base_frame_twist_.linear.x = 0.0;
ROS_INFO_NAMED ("top", "Applying STOP for %.2f s", stop_time);
for (double t=0; t<stop_time; t+=1/controller_frequency_) {
pub_.publish(scaleGivenAccelerationLimits(base_frame_twist_, stop_time-t));
r.sleep();
}
} }
} // namespace twist_recovery } // namespace twist_recovery
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment