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

Update command limiter of diff_drive_controller #1315

Merged
merged 19 commits into from
Dec 16, 2024
Merged
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
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
Prev Previous commit
Next Next commit
Use <limits> instead of c-style NAN
  • Loading branch information
christophfroehlich committed Dec 1, 2024
commit 6b07b0d5cb08af7ec95cce25b8f704d7e2a3c6b6
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
#ifndef DIFF_DRIVE_CONTROLLER__SPEED_LIMITER_HPP_
#define DIFF_DRIVE_CONTROLLER__SPEED_LIMITER_HPP_

#include <limits>

#include "control_toolbox/rate_limiter.hpp"

namespace diff_drive_controller
Expand All @@ -40,22 +42,25 @@ class SpeedLimiter
*/
SpeedLimiter(
bool has_velocity_limits = true, bool has_acceleration_limits = true,
bool has_jerk_limits = true, double min_velocity = NAN, double max_velocity = NAN,
double min_acceleration = NAN, double max_acceleration = NAN, double min_jerk = NAN,
double max_jerk = NAN)
bool has_jerk_limits = true, double min_velocity = std::numeric_limits<double>::quiet_NaN(),
double max_velocity = std::numeric_limits<double>::quiet_NaN(),
double min_acceleration = std::numeric_limits<double>::quiet_NaN(),
double max_acceleration = std::numeric_limits<double>::quiet_NaN(),
double min_jerk = std::numeric_limits<double>::quiet_NaN(),
double max_jerk = std::numeric_limits<double>::quiet_NaN())
{
// START DEPRECATED
if (!has_velocity_limits)
{
min_velocity = max_velocity = NAN;
min_velocity = max_velocity = std::numeric_limits<double>::quiet_NaN();
}
if (!has_acceleration_limits)
{
min_acceleration = max_acceleration = NAN;
min_acceleration = max_acceleration = std::numeric_limits<double>::quiet_NaN();
}
if (!has_jerk_limits)
{
min_jerk = max_jerk = NAN;
min_jerk = max_jerk = std::numeric_limits<double>::quiet_NaN();
}
// END DEPRECATED
speed_limiter_ = control_toolbox::RateLimiter<double>(
Expand Down