From 99cccc56c9dc42a949530022a6dff5f977f938bd Mon Sep 17 00:00:00 2001 From: "Dr. Denis" Date: Tue, 21 Nov 2023 18:29:55 +0100 Subject: [PATCH] [ControllerInterface] Avoid warning about conversion from `int64_t` to `unsigned int` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Without this there is a warning. For what I found the best way is to do static cast. ``` ros2_control/controller_interface/src/controller_interface_base.cpp:88:67: warning: conversion from ‘int64_t’{aka ‘long int’} to ‘unsigned int’ may change value [-Wconversion] 88 | update_rate_ = get_node()->get_parameter("update_rate").as_int(); ``` --- controller_interface/src/controller_interface_base.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controller_interface/src/controller_interface_base.cpp b/controller_interface/src/controller_interface_base.cpp index 4594e7ac07..84cd0d5e2b 100644 --- a/controller_interface/src/controller_interface_base.cpp +++ b/controller_interface/src/controller_interface_base.cpp @@ -85,7 +85,7 @@ const rclcpp_lifecycle::State & ControllerInterfaceBase::configure() // Other solution is to add check into the LifecycleNode if a transition is valid to trigger if (get_state().id() == lifecycle_msgs::msg::State::PRIMARY_STATE_UNCONFIGURED) { - update_rate_ = get_node()->get_parameter("update_rate").as_int(); + update_rate_ = static_cast(get_node()->get_parameter("update_rate").as_int()); is_async_ = get_node()->get_parameter("is_async").as_bool(); }