Skip to content

Commit

Permalink
Merge branch 'master' into feat/hardware_grouping
Browse files Browse the repository at this point in the history
  • Loading branch information
saikishor authored Mar 26, 2024
2 parents 22bcdd3 + 99d7128 commit cdbef5a
Show file tree
Hide file tree
Showing 16 changed files with 22 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ repos:

# CPP hooks
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v18.1.1
rev: v18.1.2
hooks:
- id: clang-format
args: ['-fallback-style=none', '-i']
Expand Down
2 changes: 1 addition & 1 deletion controller_interface/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ find_package(ament_cmake REQUIRED)
foreach(Dependency IN ITEMS ${THIS_PACKAGE_INCLUDE_DEPENDS})
find_package(${Dependency} REQUIRED)
endforeach()
add_compile_definitions(RCLCPP_VERSION_MAJOR=${rclcpp_lifecycle_VERSION_MAJOR})

add_library(controller_interface SHARED
src/controller_interface_base.cpp
Expand Down Expand Up @@ -90,3 +89,4 @@ install(TARGETS controller_interface
ament_export_targets(export_controller_interface HAS_LIBRARY_TARGET)
ament_export_dependencies(${THIS_PACKAGE_INCLUDE_DEPENDS})
ament_package()
ament_generate_version_header(${PROJECT_NAME})
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include "hardware_interface/loaned_state_interface.hpp"

#include "rclcpp/rclcpp.hpp"
#include "rclcpp/version.h"
#include "rclcpp_lifecycle/lifecycle_node.hpp"

namespace controller_interface
Expand Down
1 change: 1 addition & 0 deletions controller_interface/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<license>Apache License 2.0</license>

<buildtool_depend>ament_cmake</buildtool_depend>
<buildtool_depend>ament_cmake_gen_version_h</buildtool_depend>

<build_depend>hardware_interface</build_depend>
<build_depend>rclcpp_lifecycle</build_depend>
Expand Down
2 changes: 1 addition & 1 deletion controller_manager/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ find_package(backward_ros REQUIRED)
foreach(Dependency IN ITEMS ${THIS_PACKAGE_INCLUDE_DEPENDS})
find_package(${Dependency} REQUIRED)
endforeach()
add_compile_definitions(RCLCPP_VERSION_MAJOR=${rclcpp_VERSION_MAJOR})

add_library(controller_manager SHARED
src/controller_manager.cpp
Expand Down Expand Up @@ -226,3 +225,4 @@ ament_python_install_package(controller_manager
ament_export_targets(export_controller_manager HAS_LIBRARY_TARGET)
ament_export_dependencies(${THIS_PACKAGE_INCLUDE_DEPENDS})
ament_package()
ament_generate_version_header(${PROJECT_NAME})
1 change: 1 addition & 0 deletions controller_manager/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<license>Apache License 2.0</license>

<buildtool_depend>ament_cmake</buildtool_depend>
<buildtool_depend>ament_cmake_gen_version_h</buildtool_depend>
<buildtool_depend>ament_cmake_python</buildtool_depend>

<depend>ament_index_cpp</depend>
Expand Down
1 change: 1 addition & 0 deletions controller_manager/src/controller_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "hardware_interface/types/lifecycle_state_names.hpp"
#include "lifecycle_msgs/msg/state.hpp"
#include "rclcpp/rclcpp.hpp"
#include "rclcpp/version.h"
#include "rclcpp_lifecycle/state.hpp"

namespace // utility
Expand Down
5 changes: 4 additions & 1 deletion controller_manager/test/test_controller_manager_srvs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <memory>
#include <random>
#include <string>
#include <vector>

Expand Down Expand Up @@ -1503,7 +1504,9 @@ TEST_F(TestControllerManagerSrvs, list_sorted_large_chained_controller_tree)
}

// Now shuffle the list to be able to configure controller later randomly
std::random_shuffle(controllers_list.begin(), controllers_list.end());
std::random_device rnd;
std::mt19937 mers(rnd());
std::shuffle(controllers_list.begin(), controllers_list.end(), mers);

{
ControllerManagerRunner cm_runner(this);
Expand Down
1 change: 1 addition & 0 deletions hardware_interface/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,4 @@ install(
ament_export_targets(export_hardware_interface HAS_LIBRARY_TARGET)
ament_export_dependencies(${THIS_PACKAGE_INCLUDE_DEPENDS})
ament_package()
ament_generate_version_header(${PROJECT_NAME})
1 change: 1 addition & 0 deletions hardware_interface/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<license>Apache License 2.0</license>

<buildtool_depend>ament_cmake</buildtool_depend>
<buildtool_depend>ament_cmake_gen_version_h</buildtool_depend>

<depend>control_msgs</depend>
<depend>lifecycle_msgs</depend>
Expand Down
1 change: 1 addition & 0 deletions joint_limits/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,4 @@ install(TARGETS joint_limits
ament_export_targets(export_joint_limits HAS_LIBRARY_TARGET)
ament_export_dependencies(${THIS_PACKAGE_INCLUDE_DEPENDS})
ament_package()
ament_generate_version_header(${PROJECT_NAME})
1 change: 1 addition & 0 deletions joint_limits/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<url type="repository">https://github.com/ros-controls/ros2_control</url>

<buildtool_depend>ament_cmake</buildtool_depend>
<buildtool_depend>ament_cmake_gen_version_h</buildtool_depend>

<depend>rclcpp</depend>
<depend>rclcpp_lifecycle</depend>
Expand Down
1 change: 1 addition & 0 deletions rqt_controller_manager/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<author email="kphawkins@gatech.edu">Kelsey Hawkins</author>
<author email="adolfo.rodriguez@pal-robotics.com">Adolfo Rodríguez Tsouroukdissian</author>

<exec_depend>controller_manager</exec_depend>
<exec_depend>controller_manager_msgs</exec_depend>
<exec_depend>rclpy</exec_depend>
<exec_depend>rqt_gui</exec_depend>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -415,10 +415,10 @@ def _get_parameter_controller_names(node, node_name):
parameter_names = call_list_parameters(node=node, node_name=node_name)
suffix = ".type"
# @note: The versions conditioning is added here to support the source-compatibility with Humble
try:
if os.environ.get("ROS_DISTRO") == "humble":
# for humble, ros2param < 0.20.0
return [n[: -len(suffix)] for n in parameter_names if n.endswith(suffix)]
else:
return [
n[: -len(suffix)] for n in parameter_names.result().result.names if n.endswith(suffix)
]
finally:
# for humble, ros2param < 0.20.0
return [n[: -len(suffix)] for n in parameter_names if n.endswith(suffix)]
1 change: 1 addition & 0 deletions transmission_interface/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,4 @@ install(TARGETS transmission_interface
ament_export_targets(export_transmission_interface HAS_LIBRARY_TARGET)
ament_export_dependencies(${THIS_PACKAGE_INCLUDE_DEPENDS})
ament_package()
ament_generate_version_header(${PROJECT_NAME})
1 change: 1 addition & 0 deletions transmission_interface/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<license>Apache License 2.0</license>

<buildtool_depend>ament_cmake</buildtool_depend>
<buildtool_depend>ament_cmake_gen_version_h</buildtool_depend>

<depend>hardware_interface</depend>
<depend>pluginlib</depend>
Expand Down

0 comments on commit cdbef5a

Please sign in to comment.