diff --git a/hardware_interface/CMakeLists.txt b/hardware_interface/CMakeLists.txt index 56c5801006..3d3b930d04 100644 --- a/hardware_interface/CMakeLists.txt +++ b/hardware_interface/CMakeLists.txt @@ -21,11 +21,11 @@ find_package(TinyXML2 REQUIRED) add_library( hardware_interface SHARED - src/components/actuator.cpp - src/components/sensor.cpp - src/components/system.cpp + src/actuator.cpp src/component_parser.cpp src/resource_manager.cpp + src/sensor.cpp + src/system.cpp ) target_include_directories( hardware_interface diff --git a/hardware_interface/include/hardware_interface/components/actuator.hpp b/hardware_interface/include/hardware_interface/actuator.hpp similarity index 89% rename from hardware_interface/include/hardware_interface/components/actuator.hpp rename to hardware_interface/include/hardware_interface/actuator.hpp index 23ef1e5879..fa0534f983 100644 --- a/hardware_interface/include/hardware_interface/components/actuator.hpp +++ b/hardware_interface/include/hardware_interface/actuator.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef HARDWARE_INTERFACE__COMPONENTS__ACTUATOR_HPP_ -#define HARDWARE_INTERFACE__COMPONENTS__ACTUATOR_HPP_ +#ifndef HARDWARE_INTERFACE__ACTUATOR_HPP_ +#define HARDWARE_INTERFACE__ACTUATOR_HPP_ #include #include @@ -27,8 +27,6 @@ namespace hardware_interface { -namespace components -{ class ActuatorInterface; @@ -75,6 +73,5 @@ class Actuator final std::unique_ptr impl_; }; -} // namespace components } // namespace hardware_interface -#endif // HARDWARE_INTERFACE__COMPONENTS__ACTUATOR_HPP_ +#endif // HARDWARE_INTERFACE__ACTUATOR_HPP_ diff --git a/hardware_interface/include/hardware_interface/components/actuator_interface.hpp b/hardware_interface/include/hardware_interface/actuator_interface.hpp similarity index 93% rename from hardware_interface/include/hardware_interface/components/actuator_interface.hpp rename to hardware_interface/include/hardware_interface/actuator_interface.hpp index e40c44a3e2..750615f070 100644 --- a/hardware_interface/include/hardware_interface/components/actuator_interface.hpp +++ b/hardware_interface/include/hardware_interface/actuator_interface.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef HARDWARE_INTERFACE__COMPONENTS__ACTUATOR_INTERFACE_HPP_ -#define HARDWARE_INTERFACE__COMPONENTS__ACTUATOR_INTERFACE_HPP_ +#ifndef HARDWARE_INTERFACE__ACTUATOR_INTERFACE_HPP_ +#define HARDWARE_INTERFACE__ACTUATOR_INTERFACE_HPP_ #include #include @@ -26,8 +26,6 @@ namespace hardware_interface { -namespace components -{ /** * \brief Virtual Class to implement when integrating a 1 DoF actuator into ros2_control. @@ -129,6 +127,5 @@ class ActuatorInterface return_type write() = 0; }; -} // namespace components } // namespace hardware_interface -#endif // HARDWARE_INTERFACE__COMPONENTS__ACTUATOR_INTERFACE_HPP_ +#endif // HARDWARE_INTERFACE__ACTUATOR_INTERFACE_HPP_ diff --git a/hardware_interface/include/hardware_interface/components/base_interface.hpp b/hardware_interface/include/hardware_interface/base_interface.hpp similarity index 86% rename from hardware_interface/include/hardware_interface/components/base_interface.hpp rename to hardware_interface/include/hardware_interface/base_interface.hpp index 80b89c7709..3b51e75230 100644 --- a/hardware_interface/include/hardware_interface/components/base_interface.hpp +++ b/hardware_interface/include/hardware_interface/base_interface.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef HARDWARE_INTERFACE__COMPONENTS__BASE_INTERFACE_HPP_ -#define HARDWARE_INTERFACE__COMPONENTS__BASE_INTERFACE_HPP_ +#ifndef HARDWARE_INTERFACE__BASE_INTERFACE_HPP_ +#define HARDWARE_INTERFACE__BASE_INTERFACE_HPP_ #include @@ -23,8 +23,6 @@ namespace hardware_interface { -namespace components -{ template class BaseInterface : public InterfaceType @@ -57,7 +55,6 @@ class BaseInterface : public InterfaceType status status_; }; -} // namespace components } // namespace hardware_interface -#endif // HARDWARE_INTERFACE__COMPONENTS__BASE_INTERFACE_HPP_ +#endif // HARDWARE_INTERFACE__BASE_INTERFACE_HPP_ diff --git a/hardware_interface/include/hardware_interface/resource_manager.hpp b/hardware_interface/include/hardware_interface/resource_manager.hpp index 2f94515b62..460bec4193 100644 --- a/hardware_interface/include/hardware_interface/resource_manager.hpp +++ b/hardware_interface/include/hardware_interface/resource_manager.hpp @@ -28,13 +28,9 @@ namespace hardware_interface { -namespace components -{ class ActuatorInterface; class SensorInterface; class SystemInterface; -} // namespace components - class ResourceStorage; class ResourceManager @@ -152,8 +148,7 @@ class ResourceManager * externally and prior to the call to import. * \param actuator pointer to the actuator interface. */ - void import_component( - std::unique_ptr actuator); + void import_component(std::unique_ptr actuator); /// Return the number of loaded sensor components. /** @@ -171,7 +166,7 @@ class ResourceManager * externally and prior to the call to import. * \param sensor pointer to the sensor interface. */ - void import_component(std::unique_ptr sensor); + void import_component(std::unique_ptr sensor); /// Return the number of loaded system components. /** @@ -189,7 +184,7 @@ class ResourceManager * externally and prior to the call to import. * \param system pointer to the system interface. */ - void import_component(std::unique_ptr system); + void import_component(std::unique_ptr system); /// Return status for all components. /** diff --git a/hardware_interface/include/hardware_interface/components/sensor.hpp b/hardware_interface/include/hardware_interface/sensor.hpp similarity index 89% rename from hardware_interface/include/hardware_interface/components/sensor.hpp rename to hardware_interface/include/hardware_interface/sensor.hpp index 3780d8d9a3..6388b3d061 100644 --- a/hardware_interface/include/hardware_interface/components/sensor.hpp +++ b/hardware_interface/include/hardware_interface/sensor.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef HARDWARE_INTERFACE__COMPONENTS__SENSOR_HPP_ -#define HARDWARE_INTERFACE__COMPONENTS__SENSOR_HPP_ +#ifndef HARDWARE_INTERFACE__SENSOR_HPP_ +#define HARDWARE_INTERFACE__SENSOR_HPP_ #include #include @@ -28,8 +28,6 @@ namespace hardware_interface { -namespace components -{ class SensorInterface; @@ -70,6 +68,5 @@ class Sensor final std::unique_ptr impl_; }; -} // namespace components } // namespace hardware_interface -#endif // HARDWARE_INTERFACE__COMPONENTS__SENSOR_HPP_ +#endif // HARDWARE_INTERFACE__SENSOR_HPP_ diff --git a/hardware_interface/include/hardware_interface/components/sensor_interface.hpp b/hardware_interface/include/hardware_interface/sensor_interface.hpp similarity index 92% rename from hardware_interface/include/hardware_interface/components/sensor_interface.hpp rename to hardware_interface/include/hardware_interface/sensor_interface.hpp index 7517c9936b..b051180806 100644 --- a/hardware_interface/include/hardware_interface/components/sensor_interface.hpp +++ b/hardware_interface/include/hardware_interface/sensor_interface.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef HARDWARE_INTERFACE__COMPONENTS__SENSOR_INTERFACE_HPP_ -#define HARDWARE_INTERFACE__COMPONENTS__SENSOR_INTERFACE_HPP_ +#ifndef HARDWARE_INTERFACE__SENSOR_INTERFACE_HPP_ +#define HARDWARE_INTERFACE__SENSOR_INTERFACE_HPP_ #include #include @@ -27,8 +27,6 @@ namespace hardware_interface { -namespace components -{ /** * \brief Virtual Class to implement when integrating a stand-alone sensor into ros2_control. @@ -108,6 +106,5 @@ class SensorInterface return_type read() = 0; }; -} // namespace components } // namespace hardware_interface -#endif // HARDWARE_INTERFACE__COMPONENTS__SENSOR_INTERFACE_HPP_ +#endif // HARDWARE_INTERFACE__SENSOR_INTERFACE_HPP_ diff --git a/hardware_interface/include/hardware_interface/components/system.hpp b/hardware_interface/include/hardware_interface/system.hpp similarity index 90% rename from hardware_interface/include/hardware_interface/components/system.hpp rename to hardware_interface/include/hardware_interface/system.hpp index 0a95ad350d..a1434d7bae 100644 --- a/hardware_interface/include/hardware_interface/components/system.hpp +++ b/hardware_interface/include/hardware_interface/system.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef HARDWARE_INTERFACE__COMPONENTS__SYSTEM_HPP_ -#define HARDWARE_INTERFACE__COMPONENTS__SYSTEM_HPP_ +#ifndef HARDWARE_INTERFACE__SYSTEM_HPP_ +#define HARDWARE_INTERFACE__SYSTEM_HPP_ #include #include @@ -28,8 +28,6 @@ namespace hardware_interface { -namespace components -{ class SystemInterface; @@ -74,6 +72,5 @@ class System final std::unique_ptr impl_; }; -} // namespace components } // namespace hardware_interface -#endif // HARDWARE_INTERFACE__COMPONENTS__SYSTEM_HPP_ +#endif // HARDWARE_INTERFACE__SYSTEM_HPP_ diff --git a/hardware_interface/include/hardware_interface/components/system_interface.hpp b/hardware_interface/include/hardware_interface/system_interface.hpp similarity index 94% rename from hardware_interface/include/hardware_interface/components/system_interface.hpp rename to hardware_interface/include/hardware_interface/system_interface.hpp index 11323b931a..e63ba0d151 100644 --- a/hardware_interface/include/hardware_interface/components/system_interface.hpp +++ b/hardware_interface/include/hardware_interface/system_interface.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef HARDWARE_INTERFACE__COMPONENTS__SYSTEM_INTERFACE_HPP_ -#define HARDWARE_INTERFACE__COMPONENTS__SYSTEM_INTERFACE_HPP_ +#ifndef HARDWARE_INTERFACE__SYSTEM_INTERFACE_HPP_ +#define HARDWARE_INTERFACE__SYSTEM_INTERFACE_HPP_ #include #include @@ -27,8 +27,6 @@ namespace hardware_interface { -namespace components -{ /** * \brief Virtual Class to implement when integrating a complex system into ros2_control. @@ -132,6 +130,5 @@ class SystemInterface return_type write() = 0; }; -} // namespace components } // namespace hardware_interface -#endif // HARDWARE_INTERFACE__COMPONENTS__SYSTEM_INTERFACE_HPP_ +#endif // HARDWARE_INTERFACE__SYSTEM_INTERFACE_HPP_ diff --git a/hardware_interface/src/components/actuator.cpp b/hardware_interface/src/actuator.cpp similarity index 92% rename from hardware_interface/src/components/actuator.cpp rename to hardware_interface/src/actuator.cpp index 63d64ce636..b312c59df8 100644 --- a/hardware_interface/src/components/actuator.cpp +++ b/hardware_interface/src/actuator.cpp @@ -18,8 +18,8 @@ #include #include -#include "hardware_interface/components/actuator.hpp" -#include "hardware_interface/components/actuator_interface.hpp" +#include "hardware_interface/actuator.hpp" +#include "hardware_interface/actuator_interface.hpp" #include "hardware_interface/handle.hpp" #include "hardware_interface/hardware_info.hpp" @@ -28,8 +28,6 @@ namespace hardware_interface { -namespace components -{ Actuator::Actuator(std::unique_ptr impl) : impl_(std::move(impl)) @@ -82,5 +80,4 @@ return_type Actuator::write() return impl_->write(); } -} // namespace components } // namespace hardware_interface diff --git a/hardware_interface/src/resource_manager.cpp b/hardware_interface/src/resource_manager.cpp index 401203e11b..5c8b3da7c8 100644 --- a/hardware_interface/src/resource_manager.cpp +++ b/hardware_interface/src/resource_manager.cpp @@ -20,12 +20,12 @@ #include #include -#include "hardware_interface/components/actuator.hpp" -#include "hardware_interface/components/actuator_interface.hpp" -#include "hardware_interface/components/sensor.hpp" -#include "hardware_interface/components/sensor_interface.hpp" -#include "hardware_interface/components/system.hpp" -#include "hardware_interface/components/system_interface.hpp" +#include "hardware_interface/actuator.hpp" +#include "hardware_interface/actuator_interface.hpp" +#include "hardware_interface/sensor.hpp" +#include "hardware_interface/sensor_interface.hpp" +#include "hardware_interface/system.hpp" +#include "hardware_interface/system_interface.hpp" #include "hardware_interface/component_parser.hpp" #include "pluginlib/class_loader.hpp" @@ -38,11 +38,11 @@ class ResourceStorage static constexpr const char * pkg_name = "hardware_interface"; static constexpr const char * actuator_interface_name = - "hardware_interface::components::ActuatorInterface"; + "hardware_interface::ActuatorInterface"; static constexpr const char * sensor_interface_name = - "hardware_interface::components::SensorInterface"; + "hardware_interface::SensorInterface"; static constexpr const char * system_interface_name = - "hardware_interface::components::SystemInterface"; + "hardware_interface::SystemInterface"; public: ResourceStorage() @@ -98,7 +98,7 @@ class ResourceStorage const HardwareInfo & hardware_info, std::unordered_map & claimed_command_interface_map) { - initialize_hardware( + initialize_hardware( hardware_info, actuator_loader_, actuators_); if (return_type::OK != actuators_.back().configure(hardware_info)) { throw std::runtime_error(std::string("failed to configure ") + hardware_info.name); @@ -109,7 +109,7 @@ class ResourceStorage void initialize_sensor(const HardwareInfo & hardware_info) { - initialize_hardware( + initialize_hardware( hardware_info, sensor_loader_, sensors_); if (return_type::OK != sensors_.back().configure(hardware_info)) { throw std::runtime_error(std::string("failed to configure ") + hardware_info.name); @@ -121,7 +121,7 @@ class ResourceStorage const HardwareInfo & hardware_info, std::unordered_map & claimed_command_interface_map) { - initialize_hardware( + initialize_hardware( hardware_info, system_loader_, systems_); if (return_type::OK != systems_.back().configure(hardware_info)) { throw std::runtime_error(std::string("failed to configure ") + hardware_info.name); @@ -131,13 +131,13 @@ class ResourceStorage } // hardware plugins - pluginlib::ClassLoader actuator_loader_; - pluginlib::ClassLoader sensor_loader_; - pluginlib::ClassLoader system_loader_; + pluginlib::ClassLoader actuator_loader_; + pluginlib::ClassLoader sensor_loader_; + pluginlib::ClassLoader system_loader_; - std::vector actuators_; - std::vector sensors_; - std::vector systems_; + std::vector actuators_; + std::vector sensors_; + std::vector systems_; std::unordered_map hardware_status_map_; @@ -257,10 +257,10 @@ bool ResourceManager::command_interface_exists(const std::string & key) const resource_storage_->command_interface_map_.end(); } -void ResourceManager::import_component(std::unique_ptr actuator) +void ResourceManager::import_component(std::unique_ptr actuator) { resource_storage_->actuators_.emplace_back( - components::Actuator(std::move(actuator))); + Actuator(std::move(actuator))); resource_storage_->import_state_interfaces(resource_storage_->actuators_.back()); resource_storage_->import_command_interfaces( resource_storage_->actuators_.back(), claimed_command_interface_map_); @@ -271,9 +271,9 @@ size_t ResourceManager::actuator_components_size() const return resource_storage_->actuators_.size(); } -void ResourceManager::import_component(std::unique_ptr sensor) +void ResourceManager::import_component(std::unique_ptr sensor) { - resource_storage_->sensors_.emplace_back(components::Sensor(std::move(sensor))); + resource_storage_->sensors_.emplace_back(Sensor(std::move(sensor))); resource_storage_->import_state_interfaces(resource_storage_->sensors_.back()); } @@ -282,9 +282,9 @@ size_t ResourceManager::sensor_components_size() const return resource_storage_->sensors_.size(); } -void ResourceManager::import_component(std::unique_ptr system) +void ResourceManager::import_component(std::unique_ptr system) { - resource_storage_->systems_.emplace_back(components::System(std::move(system))); + resource_storage_->systems_.emplace_back(System(std::move(system))); resource_storage_->import_state_interfaces(resource_storage_->systems_.back()); resource_storage_->import_command_interfaces( resource_storage_->systems_.back(), claimed_command_interface_map_); diff --git a/hardware_interface/src/components/sensor.cpp b/hardware_interface/src/sensor.cpp similarity index 90% rename from hardware_interface/src/components/sensor.cpp rename to hardware_interface/src/sensor.cpp index 65b550515c..b957254c1b 100644 --- a/hardware_interface/src/components/sensor.cpp +++ b/hardware_interface/src/sensor.cpp @@ -17,18 +17,16 @@ #include #include -#include "hardware_interface/components/sensor.hpp" +#include "hardware_interface/sensor.hpp" #include "hardware_interface/handle.hpp" #include "hardware_interface/hardware_info.hpp" -#include "hardware_interface/components/sensor_interface.hpp" +#include "hardware_interface/sensor_interface.hpp" #include "hardware_interface/types/hardware_interface_return_values.hpp" #include "hardware_interface/types/hardware_interface_status_values.hpp" namespace hardware_interface { -namespace components -{ Sensor::Sensor(std::unique_ptr impl) : impl_(std::move(impl)) @@ -69,5 +67,4 @@ return_type Sensor::read() return impl_->read(); } -} // namespace components } // namespace hardware_interface diff --git a/hardware_interface/src/components/system.cpp b/hardware_interface/src/system.cpp similarity index 91% rename from hardware_interface/src/components/system.cpp rename to hardware_interface/src/system.cpp index 2fe421a9a7..5708d3b6ee 100644 --- a/hardware_interface/src/components/system.cpp +++ b/hardware_interface/src/system.cpp @@ -17,18 +17,16 @@ #include #include -#include "hardware_interface/components/system.hpp" +#include "hardware_interface/system.hpp" #include "hardware_interface/handle.hpp" #include "hardware_interface/hardware_info.hpp" -#include "hardware_interface/components/system_interface.hpp" +#include "hardware_interface/system_interface.hpp" #include "hardware_interface/types/hardware_interface_return_values.hpp" #include "hardware_interface/types/hardware_interface_status_values.hpp" namespace hardware_interface { -namespace components -{ System::System(std::unique_ptr impl) : impl_(std::move(impl)) @@ -79,5 +77,4 @@ return_type System::write() return impl_->write(); } -} // namespace components } // namespace hardware_interface diff --git a/hardware_interface/test/test_component_interfaces.cpp b/hardware_interface/test/test_component_interfaces.cpp index f483d24fa9..045e9a4963 100644 --- a/hardware_interface/test/test_component_interfaces.cpp +++ b/hardware_interface/test/test_component_interfaces.cpp @@ -20,12 +20,12 @@ #include #include -#include "hardware_interface/components/actuator.hpp" -#include "hardware_interface/components/actuator_interface.hpp" -#include "hardware_interface/components/sensor_interface.hpp" -#include "hardware_interface/components/sensor.hpp" -#include "hardware_interface/components/system_interface.hpp" -#include "hardware_interface/components/system.hpp" +#include "hardware_interface/actuator.hpp" +#include "hardware_interface/actuator_interface.hpp" +#include "hardware_interface/sensor_interface.hpp" +#include "hardware_interface/sensor.hpp" +#include "hardware_interface/system_interface.hpp" +#include "hardware_interface/system.hpp" #include "hardware_interface/hardware_info.hpp" #include "hardware_interface/types/hardware_interface_return_values.hpp" #include "hardware_interface/types/hardware_interface_status_values.hpp" @@ -36,7 +36,7 @@ using namespace ::testing; // NOLINT namespace test_components { -class DummyActuator : public hardware_interface::components::ActuatorInterface +class DummyActuator : public hardware_interface::ActuatorInterface { hardware_interface::return_type configure( const hardware_interface::HardwareInfo & /* info */) override @@ -110,7 +110,7 @@ class DummyActuator : public hardware_interface::components::ActuatorInterface double velocity_command_ = 0.0; }; -class DummySensor : public hardware_interface::components::SensorInterface +class DummySensor : public hardware_interface::SensorInterface { hardware_interface::return_type configure( const hardware_interface::HardwareInfo & /* info */) override @@ -159,7 +159,7 @@ class DummySensor : public hardware_interface::components::SensorInterface double voltage_level_ = 0x666; }; -class DummySystem : public hardware_interface::components::SystemInterface +class DummySystem : public hardware_interface::SystemInterface { hardware_interface::return_type configure( const hardware_interface::HardwareInfo & /* info */) override @@ -256,7 +256,7 @@ class DummySystem : public hardware_interface::components::SystemInterface TEST(TestComponentInterfaces, dummy_actuator) { - hardware_interface::components::Actuator actuator_hw( + hardware_interface::Actuator actuator_hw( std::make_unique()); hardware_interface::HardwareInfo mock_hw_info{}; @@ -289,7 +289,7 @@ TEST(TestComponentInterfaces, dummy_actuator) TEST(TestComponentInterfaces, dummy_sensor) { - hardware_interface::components::Sensor sensor_hw( + hardware_interface::Sensor sensor_hw( std::make_unique()); hardware_interface::HardwareInfo mock_hw_info{}; @@ -304,7 +304,7 @@ TEST(TestComponentInterfaces, dummy_sensor) TEST(TestComponentInterfaces, dummy_system) { - hardware_interface::components::System system_hw( + hardware_interface::System system_hw( std::make_unique()); hardware_interface::HardwareInfo mock_hw_info{}; diff --git a/hardware_interface/test/test_components/test_actuator.cpp b/hardware_interface/test/test_components/test_actuator.cpp index 94b2ec7130..7b1d1fc5a6 100644 --- a/hardware_interface/test/test_components/test_actuator.cpp +++ b/hardware_interface/test/test_components/test_actuator.cpp @@ -15,15 +15,15 @@ #include #include -#include "hardware_interface/components/base_interface.hpp" -#include "hardware_interface/components/actuator_interface.hpp" +#include "hardware_interface/base_interface.hpp" +#include "hardware_interface/actuator_interface.hpp" -using hardware_interface::status; +using hardware_interface::ActuatorInterface; +using hardware_interface::BaseInterface; +using hardware_interface::CommandInterface; using hardware_interface::return_type; using hardware_interface::StateInterface; -using hardware_interface::CommandInterface; -using hardware_interface::components::ActuatorInterface; -using hardware_interface::components::BaseInterface; +using hardware_interface::status; class TestActuator : public BaseInterface { @@ -110,4 +110,4 @@ class TestActuator : public BaseInterface }; #include "pluginlib/class_list_macros.hpp" // NOLINT -PLUGINLIB_EXPORT_CLASS(TestActuator, hardware_interface::components::ActuatorInterface) +PLUGINLIB_EXPORT_CLASS(TestActuator, hardware_interface::ActuatorInterface) diff --git a/hardware_interface/test/test_components/test_components.xml b/hardware_interface/test/test_components/test_components.xml index 7dd4feea40..235fec668f 100644 --- a/hardware_interface/test/test_components/test_components.xml +++ b/hardware_interface/test/test_components/test_components.xml @@ -1,18 +1,18 @@ - + Test Actuator - + Test Sensor - + Test System diff --git a/hardware_interface/test/test_components/test_sensor.cpp b/hardware_interface/test/test_components/test_sensor.cpp index e9b64afc4b..3c8d8fcb8b 100644 --- a/hardware_interface/test/test_components/test_sensor.cpp +++ b/hardware_interface/test/test_components/test_sensor.cpp @@ -15,14 +15,14 @@ #include #include -#include "hardware_interface/components/base_interface.hpp" -#include "hardware_interface/components/sensor_interface.hpp" +#include "hardware_interface/base_interface.hpp" +#include "hardware_interface/sensor_interface.hpp" -using hardware_interface::status; +using hardware_interface::BaseInterface; using hardware_interface::return_type; +using hardware_interface::SensorInterface; using hardware_interface::StateInterface; -using hardware_interface::components::BaseInterface; -using hardware_interface::components::SensorInterface; +using hardware_interface::status; class TestSensor : public BaseInterface { @@ -72,4 +72,4 @@ class TestSensor : public BaseInterface }; #include "pluginlib/class_list_macros.hpp" // NOLINT -PLUGINLIB_EXPORT_CLASS(TestSensor, hardware_interface::components::SensorInterface) +PLUGINLIB_EXPORT_CLASS(TestSensor, hardware_interface::SensorInterface) diff --git a/hardware_interface/test/test_components/test_system.cpp b/hardware_interface/test/test_components/test_system.cpp index a76e5a4fa7..6dd1c3b5d6 100644 --- a/hardware_interface/test/test_components/test_system.cpp +++ b/hardware_interface/test/test_components/test_system.cpp @@ -16,16 +16,16 @@ #include #include -#include "hardware_interface/components/base_interface.hpp" -#include "hardware_interface/components/system_interface.hpp" +#include "hardware_interface/base_interface.hpp" +#include "hardware_interface/system_interface.hpp" #include "hardware_interface/types/hardware_interface_type_values.hpp" -using hardware_interface::status; -using hardware_interface::return_type; +using hardware_interface::BaseInterface; using hardware_interface::CommandInterface; +using hardware_interface::return_type; using hardware_interface::StateInterface; -using hardware_interface::components::BaseInterface; -using hardware_interface::components::SystemInterface; +using hardware_interface::status; +using hardware_interface::SystemInterface; class TestSystem : public BaseInterface { @@ -90,4 +90,4 @@ class TestSystem : public BaseInterface }; #include "pluginlib/class_list_macros.hpp" // NOLINT -PLUGINLIB_EXPORT_CLASS(TestSystem, hardware_interface::components::SystemInterface) +PLUGINLIB_EXPORT_CLASS(TestSystem, hardware_interface::SystemInterface) diff --git a/hardware_interface/test/test_resource_manager.cpp b/hardware_interface/test/test_resource_manager.cpp index c104ac043c..96966a413a 100644 --- a/hardware_interface/test/test_resource_manager.cpp +++ b/hardware_interface/test/test_resource_manager.cpp @@ -20,7 +20,7 @@ #include #include -#include "hardware_interface/components/actuator_interface.hpp" +#include "hardware_interface/actuator_interface.hpp" #include "hardware_interface/resource_manager.hpp" class TestResourceManager : public ::testing::Test @@ -337,7 +337,7 @@ TEST_F(TestResourceManager, resource_claiming) { } } -class ExternalComponent : public hardware_interface::components::ActuatorInterface +class ExternalComponent : public hardware_interface::ActuatorInterface { hardware_interface::return_type configure(const hardware_interface::HardwareInfo &) override { diff --git a/test_robot_hardware/src/test_force_torque_sensor.cpp b/test_robot_hardware/src/test_force_torque_sensor.cpp index e09ed0d6f6..368c97ebaa 100644 --- a/test_robot_hardware/src/test_force_torque_sensor.cpp +++ b/test_robot_hardware/src/test_force_torque_sensor.cpp @@ -17,14 +17,14 @@ #include #include -#include "hardware_interface/components/base_interface.hpp" -#include "hardware_interface/components/sensor_interface.hpp" +#include "hardware_interface/base_interface.hpp" +#include "hardware_interface/sensor_interface.hpp" using hardware_interface::status; using hardware_interface::return_type; using hardware_interface::StateInterface; -using hardware_interface::components::BaseInterface; -using hardware_interface::components::SensorInterface; +using hardware_interface::BaseInterface; +using hardware_interface::SensorInterface; namespace test_robot_hardware { @@ -131,4 +131,4 @@ class TestForceTorqueSensor : public BaseInterface #include "pluginlib/class_list_macros.hpp" // NOLINT PLUGINLIB_EXPORT_CLASS( - test_robot_hardware::TestForceTorqueSensor, hardware_interface::components::SensorInterface) + test_robot_hardware::TestForceTorqueSensor, hardware_interface::SensorInterface) diff --git a/test_robot_hardware/src/test_single_joint_actuator.cpp b/test_robot_hardware/src/test_single_joint_actuator.cpp index 1f7479158f..be99647a6e 100644 --- a/test_robot_hardware/src/test_single_joint_actuator.cpp +++ b/test_robot_hardware/src/test_single_joint_actuator.cpp @@ -15,16 +15,16 @@ #include #include -#include "hardware_interface/components/base_interface.hpp" -#include "hardware_interface/components/actuator_interface.hpp" +#include "hardware_interface/base_interface.hpp" +#include "hardware_interface/actuator_interface.hpp" #include "hardware_interface/types/hardware_interface_type_values.hpp" using hardware_interface::status; using hardware_interface::return_type; using hardware_interface::StateInterface; using hardware_interface::CommandInterface; -using hardware_interface::components::ActuatorInterface; -using hardware_interface::components::BaseInterface; +using hardware_interface::ActuatorInterface; +using hardware_interface::BaseInterface; namespace test_robot_hardware { @@ -124,4 +124,4 @@ class TestSingleJointActuator : public BaseInterface #include "pluginlib/class_list_macros.hpp" // NOLINT PLUGINLIB_EXPORT_CLASS( - test_robot_hardware::TestSingleJointActuator, hardware_interface::components::ActuatorInterface) + test_robot_hardware::TestSingleJointActuator, hardware_interface::ActuatorInterface) diff --git a/test_robot_hardware/src/test_two_joint_system.cpp b/test_robot_hardware/src/test_two_joint_system.cpp index adba3a6ca7..6e86942592 100644 --- a/test_robot_hardware/src/test_two_joint_system.cpp +++ b/test_robot_hardware/src/test_two_joint_system.cpp @@ -16,16 +16,16 @@ #include #include -#include "hardware_interface/components/base_interface.hpp" -#include "hardware_interface/components/system_interface.hpp" +#include "hardware_interface/base_interface.hpp" +#include "hardware_interface/system_interface.hpp" #include "hardware_interface/types/hardware_interface_type_values.hpp" using hardware_interface::status; using hardware_interface::return_type; using hardware_interface::StateInterface; using hardware_interface::CommandInterface; -using hardware_interface::components::BaseInterface; -using hardware_interface::components::SystemInterface; +using hardware_interface::BaseInterface; +using hardware_interface::SystemInterface; namespace test_robot_hardware { @@ -112,4 +112,4 @@ class TestTwoJointSystem : public BaseInterface #include "pluginlib/class_list_macros.hpp" // NOLINT PLUGINLIB_EXPORT_CLASS( - test_robot_hardware::TestTwoJointSystem, hardware_interface::components::SystemInterface) + test_robot_hardware::TestTwoJointSystem, hardware_interface::SystemInterface) diff --git a/test_robot_hardware/test_robot_components.xml b/test_robot_hardware/test_robot_components.xml index f1c9e67200..9fb1ed288d 100644 --- a/test_robot_hardware/test_robot_components.xml +++ b/test_robot_hardware/test_robot_components.xml @@ -1,18 +1,18 @@ - + Test actuator component for a single position joint - + Test sensor component emulating a force torque sensor - + Test system component for a two degree of freedom position joint robot