Skip to content

Commit 4da8bd8

Browse files
committed
minor bugfixing
1 parent 0708ad9 commit 4da8bd8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

joy/src/joy.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ Joy::Joy(const rclcpp::NodeOptions & options)
8888

8989
sticky_buttons_ = this->declare_parameter("sticky_buttons", false);
9090

91-
autocenter_ = std::clamp(this->declare_parameter("autocenter", 0), 0, 100);
91+
autocenter_ = std::clamp(static_cast<int>(this->declare_parameter("autocenter", 0)), 0, 100);
9292

9393
coalesce_interval_ms_ = static_cast<int>(this->declare_parameter("coalesce_interval_ms", 1));
9494
if (coalesce_interval_ms_ < 0) {
@@ -484,7 +484,7 @@ void Joy::eventThread()
484484

485485
status = future_.wait_for(std::chrono::seconds(0));
486486

487-
if (haptic_ != nullptr && autocenter_) {
487+
if (haptic_ != nullptr) {
488488
int result = SDL_HapticSetAutocenter(haptic_, autocenter_);
489489
if (result) {
490490
RCLCPP_WARN(get_logger(), "Failed to set autocenter: %s", SDL_GetError());

0 commit comments

Comments
 (0)