Skip to content

Commit 50b42a2

Browse files
committed
reverted import_component changes
1 parent 345c055 commit 50b42a2

3 files changed

Lines changed: 10 additions & 19 deletions

File tree

hardware_interface/include/hardware_interface/resource_manager.hpp

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -393,11 +393,9 @@ class ResourceManager
393393
* externally and prior to the call to import.
394394
* \param[in] actuator pointer to the actuator interface.
395395
* \param[in] hardware_info hardware info
396-
* \param[in] executor a weak pointer to the MultiThreadedExecutor used by the controller manager.
397396
*/
398397
void import_component(
399-
std::unique_ptr<ActuatorInterface> actuator, const HardwareInfo & hardware_info,
400-
rclcpp::Executor::WeakPtr executor);
398+
std::unique_ptr<ActuatorInterface> actuator, const HardwareInfo & hardware_info);
401399

402400
/// Import a hardware component which is not listed in the URDF
403401
/**
@@ -411,11 +409,9 @@ class ResourceManager
411409
* externally and prior to the call to import.
412410
* \param[in] sensor pointer to the sensor interface.
413411
* \param[in] hardware_info hardware info
414-
* \param[in] executor a weak pointer to the MultiThreadedExecutor used by the controller manager.
415412
*/
416413
void import_component(
417-
std::unique_ptr<SensorInterface> sensor, const HardwareInfo & hardware_info,
418-
rclcpp::Executor::WeakPtr executor);
414+
std::unique_ptr<SensorInterface> sensor, const HardwareInfo & hardware_info);
419415

420416
/// Import a hardware component which is not listed in the URDF
421417
/**
@@ -429,11 +425,9 @@ class ResourceManager
429425
* externally and prior to the call to import.
430426
* \param[in] system pointer to the system interface.
431427
* \param[in] hardware_info hardware info
432-
* \param[in] executor a weak pointer to the MultiThreadedExecutor used by the controller manager.
433428
*/
434429
void import_component(
435-
std::unique_ptr<SystemInterface> system, const HardwareInfo & hardware_info,
436-
rclcpp::Executor::WeakPtr executor);
430+
std::unique_ptr<SystemInterface> system, const HardwareInfo & hardware_info);
437431

438432
/// Return status for all components.
439433
/**

hardware_interface/src/resource_manager.cpp

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1837,33 +1837,30 @@ std::string ResourceManager::get_command_interface_data_type(const std::string &
18371837
}
18381838

18391839
void ResourceManager::import_component(
1840-
std::unique_ptr<ActuatorInterface> actuator, const HardwareInfo & hardware_info,
1841-
rclcpp::Executor::WeakPtr executor)
1840+
std::unique_ptr<ActuatorInterface> actuator, const HardwareInfo & hardware_info)
18421841
{
18431842
std::lock_guard<std::recursive_mutex> guard(resources_lock_);
1844-
resource_storage_->initialize_actuator(std::move(actuator), hardware_info, executor);
1843+
resource_storage_->initialize_actuator(std::move(actuator), hardware_info, executor_);
18451844
read_write_status.failed_hardware_names.reserve(
18461845
resource_storage_->actuators_.size() + resource_storage_->sensors_.size() +
18471846
resource_storage_->systems_.size());
18481847
}
18491848

18501849
void ResourceManager::import_component(
1851-
std::unique_ptr<SensorInterface> sensor, const HardwareInfo & hardware_info,
1852-
rclcpp::Executor::WeakPtr executor)
1850+
std::unique_ptr<SensorInterface> sensor, const HardwareInfo & hardware_info)
18531851
{
18541852
std::lock_guard<std::recursive_mutex> guard(resources_lock_);
1855-
resource_storage_->initialize_sensor(std::move(sensor), hardware_info, executor);
1853+
resource_storage_->initialize_sensor(std::move(sensor), hardware_info, executor_);
18561854
read_write_status.failed_hardware_names.reserve(
18571855
resource_storage_->actuators_.size() + resource_storage_->sensors_.size() +
18581856
resource_storage_->systems_.size());
18591857
}
18601858

18611859
void ResourceManager::import_component(
1862-
std::unique_ptr<SystemInterface> system, const HardwareInfo & hardware_info,
1863-
rclcpp::Executor::WeakPtr executor)
1860+
std::unique_ptr<SystemInterface> system, const HardwareInfo & hardware_info)
18641861
{
18651862
std::lock_guard<std::recursive_mutex> guard(resources_lock_);
1866-
resource_storage_->initialize_system(std::move(system), hardware_info, executor);
1863+
resource_storage_->initialize_system(std::move(system), hardware_info, executor_);
18671864
read_write_status.failed_hardware_names.reserve(
18681865
resource_storage_->actuators_.size() + resource_storage_->sensors_.size() +
18691866
resource_storage_->systems_.size());

hardware_interface_testing/test/test_resource_manager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ TEST_F(ResourceManagerTest, post_initialization_add_components)
406406
external_component_hw_info.name = "ExternalComponent";
407407
external_component_hw_info.type = "actuator";
408408
external_component_hw_info.is_async = false;
409-
rm.import_component(std::make_unique<ExternalComponent>(), external_component_hw_info, executor_);
409+
rm.import_component(std::make_unique<ExternalComponent>(), external_component_hw_info);
410410
EXPECT_EQ(2u, rm.actuator_components_size());
411411

412412
ASSERT_THAT(rm.state_interface_keys(), SizeIs(12));

0 commit comments

Comments
 (0)