We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0f4b2a8 commit bd33168Copy full SHA for bd33168
joy/src/joy.cpp
@@ -88,13 +88,7 @@ Joy::Joy(const rclcpp::NodeOptions & options)
88
89
sticky_buttons_ = this->declare_parameter("sticky_buttons", false);
90
91
- autocenter_ = this->declare_parameter("autocenter", 0);
92
-
93
- if (autocenter_ < 0) {
94
- autocenter_ = 0;
95
- } else if (autocenter_ > 100) {
96
- autocenter_ = 100;
97
- }
+ autocenter_ = std::clamp(this->declare_parameter("autocenter", 0), 0, 100);
98
99
coalesce_interval_ms_ = static_cast<int>(this->declare_parameter("coalesce_interval_ms", 1));
100
if (coalesce_interval_ms_ < 0) {
0 commit comments