Skip to content

Commit

Permalink
Load the URDF to the resource_manager before parsing it to CM (ros-co…
Browse files Browse the repository at this point in the history
…ntrols#262) (ros-controls#267)

* Load the URDF to the resource_manager before parsing it to CM constructor (fixes ros-controls/ros2_control#1299)

(cherry picked from commit f5baf71)

Co-authored-by: Sai Kishor Kothakota <[email protected]>
Co-authored-by: Alejandro Hernández Cordero <[email protected]>
  • Loading branch information
3 people authored Jan 23, 2024
1 parent 07ceffd commit 1ce397c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions gazebo_ros2_control/src/gazebo_ros2_control_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,13 @@ void GazeboRosControlPlugin::Load(gazebo::physics::ModelPtr parent, sdf::Element
std::unique_ptr<hardware_interface::ResourceManager> resource_manager_ =
std::make_unique<hardware_interface::ResourceManager>();

try {
resource_manager_->load_urdf(urdf_string, false, 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 initializing URDF to resource manager!");
}
try {
impl_->robot_hw_sim_loader_.reset(
new pluginlib::ClassLoader<gazebo_ros2_control::GazeboSystemInterface>(
Expand Down

0 comments on commit 1ce397c

Please sign in to comment.