From ff5574a049d126c61b6c68e7a9d0274f8016faca Mon Sep 17 00:00:00 2001 From: "Dr. Denis" Date: Tue, 21 Nov 2023 18:40:11 +0100 Subject: [PATCH] [ControllerInterface] Avoid warning about conversion from `int64_t` to `unsigned int` (#1173) 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(); ``` (cherry picked from commit 2569b76692f7ce9527099a81c1077c73143ea5e2) # Conflicts: # controller_interface/src/controller_interface_base.cpp --- controller_interface/src/controller_interface_base.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/controller_interface/src/controller_interface_base.cpp b/controller_interface/src/controller_interface_base.cpp index 035d2572e1..dc9ce6ea48 100644 --- a/controller_interface/src/controller_interface_base.cpp +++ b/controller_interface/src/controller_interface_base.cpp @@ -83,7 +83,12 @@ 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) { +<<<<<<< HEAD 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(); +>>>>>>> 2569b76 ([ControllerInterface] Avoid warning about conversion from `int64_t` to `unsigned int` (#1173)) } return get_node()->configure();