From bd8e5bec876bdd029a209642e057e4e75d3d2669 Mon Sep 17 00:00:00 2001 From: Sai Kishor Kothakota Date: Tue, 16 Jan 2024 16:06:09 +0100 Subject: [PATCH] Load the URDF to the resource_manager before parsing it to CM constructor (fixes https://github.com/ros-controls/ros2_control/issues/1299) --- gazebo_ros2_control/src/gazebo_ros2_control_plugin.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gazebo_ros2_control/src/gazebo_ros2_control_plugin.cpp b/gazebo_ros2_control/src/gazebo_ros2_control_plugin.cpp index 23368e2a..7c5f4bc5 100644 --- a/gazebo_ros2_control/src/gazebo_ros2_control_plugin.cpp +++ b/gazebo_ros2_control/src/gazebo_ros2_control_plugin.cpp @@ -288,6 +288,13 @@ void GazeboRosControlPlugin::Load(gazebo::physics::ModelPtr parent, sdf::Element std::unique_ptr resource_manager_ = std::make_unique(); + try { + resource_manager_->load_urdf(urdf_string, false); + } catch (...) { + // This error should be normal as the resource manager is not supposed to load and initialize + // them + RCLCPP_ERROR(impl_->model_nh_->get_logger(), "Error intializing URDF to resource manager!"); + } try { impl_->robot_hw_sim_loader_.reset( new pluginlib::ClassLoader(