Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ros2_control/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<exec_depend>controller_interface</exec_depend>
<exec_depend>controller_manager</exec_depend>
<exec_depend>hardware_interface</exec_depend>
<exec_depend>ros2_control_components</exec_depend>
<exec_depend>transmission_interface</exec_depend>
<exec_depend>joint_limits_interface</exec_depend>

Expand Down
29 changes: 29 additions & 0 deletions ros2_control_components/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
cmake_minimum_required(VERSION 3.5)
project(ros2_control_components)

# Default to C++14
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 14)
endif()

# find dependencies
find_package(ament_cmake REQUIRED)
find_package(hardware_interface REQUIRED)

install(
DIRECTORY include/
DESTINATION include
)

if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
endif()

ament_export_include_directories(
include
)
ament_export_dependencies(
hardware_interface
)
ament_package()
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// Copyright 2020 ROS2-Control Development Team
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef ROS2_CONTROL_COMPONENTS__BASE_INTERFACE_HPP_
#define ROS2_CONTROL_COMPONENTS__BASE_INTERFACE_HPP_

#include <string>

#include "hardware_interface/hardware_info.hpp"
#include "hardware_interface/types/hardware_interface_status_values.hpp"

namespace ros2_control_components
{

template<class InterfaceType>
class BaseInterface : public InterfaceType
{
public:
hardware_interface::return_type configure(const hardware_interface::HardwareInfo & info) override
{
info_ = info;
status_ = hardware_interface::status::CONFIGURED;
return hardware_interface::return_type::OK;
}

std::string get_name() const
{
return info_.name;
}

hardware_interface::status get_status() const final
{
return status_;
}

protected:
hardware_interface::HardwareInfo info_;
hardware_interface::status status_;
};

} // namespace ros2_control_components

#endif // ROS2_CONTROL_COMPONENTS__BASE_INTERFACE_HPP_
19 changes: 19 additions & 0 deletions ros2_control_components/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>ros2_control_components</name>
<version>0.0.1</version>
<description>The package implements control components, i.e., joints and sensors, the logical building blocks of ros2_control system.
</description>
<maintainer email="denis@stogl.de">Denis Štogl</maintainer>
<license>Apache License 2.0</license>

<depend>hardware_interface</depend>

<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>

<export>
<build_type>ament_cmake</build_type>
</export>
</package>