Skip to content

Commit ccd288a

Browse files
committed
Removed debugging output, used epsilon instead of zero check
Signed-off-by: Dominik Moss <[email protected]>
1 parent c77cfd2 commit ccd288a

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

nav2_velocity_smoother/src/velocity_smoother.cpp

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ double VelocitySmoother::findEtaConstraint(
274274
v_component_min = decel / smoothing_frequency_;
275275
}
276276

277-
if (v_cmd == 0.0) {
277+
if (std::abs(v_cmd) < 1e-6) {
278278
return -1.0;
279279
}
280280

@@ -313,10 +313,6 @@ double VelocitySmoother::applyConstraints(
313313
auto v_diff_clamped = std::clamp(v_diff, v_component_min, v_component_max);
314314
auto v_cmd_restricted = v_curr + v_diff_clamped;
315315

316-
if(std::abs(v_scaled - v_cmd_restricted) > 0.0001){
317-
RCLCPP_DEBUG(get_logger(), "Clamped velocity change: eta * v_cmd = %f, clamped to %f", v_scaled, v_cmd_restricted);
318-
}
319-
320316
return v_cmd_restricted;
321317
}
322318

@@ -350,9 +346,6 @@ void VelocitySmoother::smootherTimer()
350346
current_ = odom_smoother_->getTwistStamped();
351347
}
352348

353-
RCLCPP_DEBUG(get_logger(), "Current (odom) velocity: [%f, %f, %f]", current_.twist.linear.x, current_.twist.linear.y, current_.twist.angular.z);
354-
RCLCPP_DEBUG(get_logger(), "Input velocity: [%f, %f, %f]", command_->twist.linear.x, command_->twist.linear.y, command_->twist.angular.z);
355-
356349
// Apply absolute velocity restrictions to the command
357350
if(!is_6dof_) {
358351
command_->twist.linear.x = std::clamp(
@@ -385,8 +378,6 @@ void VelocitySmoother::smootherTimer()
385378
max_velocities_[5]);
386379
}
387380

388-
RCLCPP_DEBUG(get_logger(), "Clamped velocity: [%f, %f, %f]", command_->twist.linear.x, command_->twist.linear.y, command_->twist.angular.z);
389-
390381
// Find if any component is not within the acceleration constraints. If so, store the most
391382
// significant scale factor to apply to the vector <dvx, dvy, dvw>, eta, to reduce all axes
392383
// proportionally to follow the same direction, within change of velocity bounds.
@@ -451,7 +442,6 @@ void VelocitySmoother::smootherTimer()
451442
}
452443
}
453444
}
454-
RCLCPP_DEBUG(get_logger(), "Eta = %f", eta);
455445

456446
if(!is_6dof_) {
457447
cmd_vel->twist.linear.x = applyConstraints(

0 commit comments

Comments
 (0)