From b3a12c5e64a78b17f314ffd135cc81b24fdd6c7e Mon Sep 17 00:00:00 2001 From: Stefan Scherzinger Date: Sun, 20 Oct 2024 14:50:31 +0200 Subject: [PATCH] Use the `urdf_` member for _Jazzy_ --- .../include/cartesian_controller_base/ROS2VersionConfig.h.in | 4 ++-- cartesian_controller_base/src/cartesian_controller_base.cpp | 5 +++++ cartesian_controller_simulation/launch/simulation.launch.py | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/cartesian_controller_base/include/cartesian_controller_base/ROS2VersionConfig.h.in b/cartesian_controller_base/include/cartesian_controller_base/ROS2VersionConfig.h.in index eae574b8..cf2a8220 100644 --- a/cartesian_controller_base/include/cartesian_controller_base/ROS2VersionConfig.h.in +++ b/cartesian_controller_base/include/cartesian_controller_base/ROS2VersionConfig.h.in @@ -1,7 +1,7 @@ // Cmake will update these defines depending on our current ROS_DISTRO. // We use this mechanism to react to API changes in ROS2-control. // -#cmakedefine CARTESIAN_CONTROLLERS_FOXY -#cmakedefine CARTESIAN_CONTROLLERS_GALACTIC + #cmakedefine CARTESIAN_CONTROLLERS_HUMBLE #cmakedefine CARTESIAN_CONTROLLERS_IRON +#cmakedefine CARTESIAN_CONTROLLERS_JAZZY diff --git a/cartesian_controller_base/src/cartesian_controller_base.cpp b/cartesian_controller_base/src/cartesian_controller_base.cpp index 0948584b..528bf3a4 100644 --- a/cartesian_controller_base/src/cartesian_controller_base.cpp +++ b/cartesian_controller_base/src/cartesian_controller_base.cpp @@ -131,7 +131,12 @@ CartesianControllerBase::on_configure(const rclcpp_lifecycle::State & previous_s urdf::Model robot_model; KDL::Tree robot_tree; +#if defined CARTESIAN_CONTROLLERS_JAZZY + m_robot_description = this->get_robot_description(); +#else m_robot_description = get_node()->get_parameter("robot_description").as_string(); +#endif + if (m_robot_description.empty()) { RCLCPP_ERROR(get_node()->get_logger(), "robot_description is empty"); diff --git a/cartesian_controller_simulation/launch/simulation.launch.py b/cartesian_controller_simulation/launch/simulation.launch.py index 479a02d7..f23e6e0d 100644 --- a/cartesian_controller_simulation/launch/simulation.launch.py +++ b/cartesian_controller_simulation/launch/simulation.launch.py @@ -90,7 +90,7 @@ def generate_launch_description(): control_node = Node( package="controller_manager", executable="ros2_control_node", - parameters=[robot_controllers], + parameters=[robot_description, robot_controllers], # prefix="screen -d -m gdb -command=/home/stefan/.gdb_debug_config --ex run --args", # noqa E501 output="both", remappings=[