Skip to content

Commit 1b8ec67

Browse files
committed
Repo Move: fault_controller and twist_controller
This commit does 3 things: 1. git filter-repo to move kortex2_controllers into fault_controllers 2. moves twist controller out of fault_controller 3. regex replaces kortex2_controllers to either twist_ or fault_ controller Previous commit moved some files using git-extras `git cp` because some files needed to copied and then manually split Signed-off-by: Alex Moriarty <[email protected]>
1 parent 4f5a822 commit 1b8ec67

File tree

12 files changed

+87
-96
lines changed

12 files changed

+87
-96
lines changed

fault_controller/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
cmake_minimum_required(VERSION 3.8)
2-
project(kortex2_controllers)
2+
project(fault_controller)
33

44
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
55
add_compile_options(-Wall -Wextra -Wpedantic)
@@ -23,7 +23,7 @@ set(THIS_PACKAGE_INCLUDE_DEPENDS
2323

2424
include_directories(include)
2525

26-
add_library(${PROJECT_NAME} SHARED src/twist_controller.cpp src/fault_controller.cpp)
26+
add_library(${PROJECT_NAME} SHARED src/fault_controller.cpp)
2727
target_include_directories(${PROJECT_NAME} PRIVATE
2828
include
2929
)
@@ -34,7 +34,7 @@ ament_target_dependencies(${PROJECT_NAME}
3434

3535
# Causes the visibility macros to use dllexport rather than dllimport,
3636
# which is appropriate when building the dll but not consuming it.
37-
target_compile_definitions(${PROJECT_NAME} PRIVATE "KORTEX2_CONTROLLERS_BUILDING_LIBRARY")
37+
target_compile_definitions(${PROJECT_NAME} PRIVATE "FAULT_CONTROLLER_BUILDING_LIBRARY")
3838
pluginlib_export_plugin_description_file(controller_interface controller_plugins.xml)
3939

4040
install(TARGETS ${PROJECT_NAME}

fault_controller/controller_plugins.xml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
1-
<library path="kortex2_controllers">
2-
<class name="kortex2_controllers/TwistController" type="kortex2_controllers::TwistController" base_class_type="controller_interface::ControllerInterface">
3-
<description>
4-
6dof twist controller
5-
</description>
6-
</class>
7-
<class name="kortex2_controllers/FaultController" type="kortex2_controllers::FaultController" base_class_type="controller_interface::ControllerInterface">
1+
<library path="fault_controller">
2+
<class name="fault_controller/FaultController" type="fault_controller::FaultController" base_class_type="controller_interface::ControllerInterface">
83
<description>
94
ros2 fault controller for kinova api
105
</description>

fault_controller/include/fault_controller/fault_controller.hpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,19 @@
2121
*/
2222
//----------------------------------------------------------------------
2323

24-
#ifndef KORTEX2_CONTROLLERS__FAULT_CONTROLLER_HPP_
25-
#define KORTEX2_CONTROLLERS__FAULT_CONTROLLER_HPP_
24+
#ifndef FAULT_CONTROLLER__FAULT_CONTROLLER_HPP_
25+
#define FAULT_CONTROLLER__FAULT_CONTROLLER_HPP_
2626

2727
#include <limits>
2828
#include <memory>
2929

3030
#include "controller_interface/controller_interface.hpp"
3131
#include "example_interfaces/msg/bool.hpp"
3232
#include "example_interfaces/srv/trigger.hpp"
33-
#include "kortex2_controllers/visibility_control.h"
33+
#include "fault_controller/visibility_control.h"
3434
#include "realtime_tools/realtime_publisher.h"
3535

36-
namespace kortex2_controllers
36+
namespace fault_controller
3737
{
3838
enum CommandInterfaces
3939
{
@@ -51,28 +51,28 @@ using CallbackReturn = rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface
5151
class FaultController : public controller_interface::ControllerInterface
5252
{
5353
public:
54-
KORTEX2_CONTROLLERS_PUBLIC
54+
FAULT_CONTROLLER_PUBLIC
5555
FaultController();
5656

57-
KORTEX2_CONTROLLERS_PUBLIC
57+
FAULT_CONTROLLER_PUBLIC
5858
controller_interface::InterfaceConfiguration command_interface_configuration() const override;
5959

60-
KORTEX2_CONTROLLERS_PUBLIC
60+
FAULT_CONTROLLER_PUBLIC
6161
controller_interface::InterfaceConfiguration state_interface_configuration() const override;
6262

63-
KORTEX2_CONTROLLERS_PUBLIC
63+
FAULT_CONTROLLER_PUBLIC
6464
CallbackReturn on_init() override;
6565

66-
KORTEX2_CONTROLLERS_PUBLIC
66+
FAULT_CONTROLLER_PUBLIC
6767
CallbackReturn on_configure(const rclcpp_lifecycle::State & previous_state) override;
6868

69-
KORTEX2_CONTROLLERS_PUBLIC
69+
FAULT_CONTROLLER_PUBLIC
7070
CallbackReturn on_activate(const rclcpp_lifecycle::State & previous_state) override;
7171

72-
KORTEX2_CONTROLLERS_PUBLIC
72+
FAULT_CONTROLLER_PUBLIC
7373
CallbackReturn on_deactivate(const rclcpp_lifecycle::State & previous_state) override;
7474

75-
KORTEX2_CONTROLLERS_PUBLIC
75+
FAULT_CONTROLLER_PUBLIC
7676
controller_interface::return_type update(
7777
const rclcpp::Time & time, const rclcpp::Duration & period) override;
7878

@@ -90,6 +90,6 @@ class FaultController : public controller_interface::ControllerInterface
9090
static constexpr double NO_CMD = std::numeric_limits<double>::quiet_NaN();
9191
};
9292

93-
} // namespace kortex2_controllers
93+
} // namespace fault_controller
9494

95-
#endif // KORTEX2_CONTROLLERS__FAULT_CONTROLLER_HPP_
95+
#endif // FAULT_CONTROLLER__FAULT_CONTROLLER_HPP_

fault_controller/include/fault_controller/visibility_control.h

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,38 +12,38 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#ifndef KORTEX2_CONTROLLERS__VISIBILITY_CONTROL_H_
16-
#define KORTEX2_CONTROLLERS__VISIBILITY_CONTROL_H_
15+
#ifndef FAULT_CONTROLLER__VISIBILITY_CONTROL_H_
16+
#define FAULT_CONTROLLER__VISIBILITY_CONTROL_H_
1717

1818
// This logic was borrowed (then namespaced) from the examples on the gcc wiki:
1919
// https://gcc.gnu.org/wiki/Visibility
2020

2121
#if defined _WIN32 || defined __CYGWIN__
2222
#ifdef __GNUC__
23-
#define KORTEX2_CONTROLLERS_EXPORT __attribute__((dllexport))
24-
#define KORTEX2_CONTROLLERS_IMPORT __attribute__((dllimport))
23+
#define FAULT_CONTROLLER_EXPORT __attribute__((dllexport))
24+
#define FAULT_CONTROLLER_IMPORT __attribute__((dllimport))
2525
#else
26-
#define KORTEX2_CONTROLLERS_EXPORT __declspec(dllexport)
27-
#define KORTEX2_CONTROLLERS_IMPORT __declspec(dllimport)
26+
#define FAULT_CONTROLLER_EXPORT __declspec(dllexport)
27+
#define FAULT_CONTROLLER_IMPORT __declspec(dllimport)
2828
#endif
29-
#ifdef KORTEX2_CONTROLLERS_BUILDING_LIBRARY
30-
#define KORTEX2_CONTROLLERS_PUBLIC KORTEX2_CONTROLLERS_EXPORT
29+
#ifdef FAULT_CONTROLLER_BUILDING_LIBRARY
30+
#define FAULT_CONTROLLER_PUBLIC FAULT_CONTROLLER_EXPORT
3131
#else
32-
#define KORTEX2_CONTROLLERS_PUBLIC KORTEX2_CONTROLLERS_IMPORT
32+
#define FAULT_CONTROLLER_PUBLIC FAULT_CONTROLLER_IMPORT
3333
#endif
34-
#define KORTEX2_CONTROLLERS_PUBLIC_TYPE KORTEX2_CONTROLLERS_PUBLIC
35-
#define KORTEX2_CONTROLLERS_LOCAL
34+
#define FAULT_CONTROLLER_PUBLIC_TYPE FAULT_CONTROLLER_PUBLIC
35+
#define FAULT_CONTROLLER_LOCAL
3636
#else
37-
#define KORTEX2_CONTROLLERS_EXPORT __attribute__((visibility("default")))
38-
#define KORTEX2_CONTROLLERS_IMPORT
37+
#define FAULT_CONTROLLER_EXPORT __attribute__((visibility("default")))
38+
#define FAULT_CONTROLLER_IMPORT
3939
#if __GNUC__ >= 4
40-
#define KORTEX2_CONTROLLERS_PUBLIC __attribute__((visibility("default")))
41-
#define KORTEX2_CONTROLLERS_LOCAL __attribute__((visibility("hidden")))
40+
#define FAULT_CONTROLLER_PUBLIC __attribute__((visibility("default")))
41+
#define FAULT_CONTROLLER_LOCAL __attribute__((visibility("hidden")))
4242
#else
43-
#define KORTEX2_CONTROLLERS_PUBLIC
44-
#define KORTEX2_CONTROLLERS_LOCAL
43+
#define FAULT_CONTROLLER_PUBLIC
44+
#define FAULT_CONTROLLER_LOCAL
4545
#endif
46-
#define KORTEX2_CONTROLLERS_PUBLIC_TYPE
46+
#define FAULT_CONTROLLER_PUBLIC_TYPE
4747
#endif
4848

49-
#endif // KORTEX2_CONTROLLERS__VISIBILITY_CONTROL_H_
49+
#endif // FAULT_CONTROLLER__VISIBILITY_CONTROL_H_

fault_controller/package.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
<?xml version="1.0"?>
22
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
33
<package format="3">
4-
<name>kortex2_controllers</name>
4+
<name>fault_controller</name>
55
<version>0.0.0</version>
66
<description>TODO: Package description</description>
7-
<maintainer email="[email protected]">lovro</maintainer>
7+
<author email="[email protected]">lovro</author>
8+
<maintainer email="[email protected]">Alex Moriarty</maintainer>
89
<license>TODO: License declaration</license>
910

1011
<buildtool_depend>ament_cmake_ros</buildtool_depend>

fault_controller/src/fault_controller.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@
2121
*/
2222
//----------------------------------------------------------------------
2323

24-
#include "kortex2_controllers/fault_controller.hpp"
24+
#include "fault_controller/fault_controller.hpp"
2525
#include <memory>
2626
#include "hardware_interface/loaned_command_interface.hpp"
2727

28-
namespace kortex2_controllers
28+
namespace fault_controller
2929
{
3030
using hardware_interface::LoanedCommandInterface;
3131

@@ -132,9 +132,9 @@ bool FaultController::resetFault(
132132
return resp->success;
133133
}
134134

135-
} // namespace kortex2_controllers
135+
} // namespace fault_controller
136136

137137
#include "pluginlib/class_list_macros.hpp"
138138

139139
PLUGINLIB_EXPORT_CLASS(
140-
kortex2_controllers::FaultController, controller_interface::ControllerInterface)
140+
fault_controller::FaultController, controller_interface::ControllerInterface)

twist_controller/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
cmake_minimum_required(VERSION 3.8)
2-
project(kortex2_controllers)
2+
project(twist_controller)
33

44
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
55
add_compile_options(-Wall -Wextra -Wpedantic)
@@ -23,7 +23,7 @@ set(THIS_PACKAGE_INCLUDE_DEPENDS
2323

2424
include_directories(include)
2525

26-
add_library(${PROJECT_NAME} SHARED src/twist_controller.cpp src/fault_controller.cpp)
26+
add_library(${PROJECT_NAME} SHARED src/twist_controller.cpp)
2727
target_include_directories(${PROJECT_NAME} PRIVATE
2828
include
2929
)
Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
1-
<library path="kortex2_controllers">
2-
<class name="kortex2_controllers/TwistController" type="kortex2_controllers::TwistController" base_class_type="controller_interface::ControllerInterface">
1+
<library path="twist_controller">
2+
<class name="twist_controller/TwistController" type="twist_controller::TwistController" base_class_type="controller_interface::ControllerInterface">
33
<description>
44
6dof twist controller
55
</description>
66
</class>
7-
<class name="kortex2_controllers/FaultController" type="kortex2_controllers::FaultController" base_class_type="controller_interface::ControllerInterface">
8-
<description>
9-
ros2 fault controller for kinova api
10-
</description>
11-
</class>
127
</library>

twist_controller/include/twist_controller/twist_controller.hpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,48 +21,48 @@
2121
*/
2222
//----------------------------------------------------------------------
2323

24-
#ifndef KORTEX2_CONTROLLERS__TWIST_CONTROLLER_HPP_
25-
#define KORTEX2_CONTROLLERS__TWIST_CONTROLLER_HPP_
24+
#ifndef TWIST_CONTROLLER__TWIST_CONTROLLER_HPP_
25+
#define TWIST_CONTROLLER__TWIST_CONTROLLER_HPP_
2626

2727
#include <memory>
2828
#include <string>
2929
#include <vector>
3030

3131
#include "controller_interface/controller_interface.hpp"
3232
#include "geometry_msgs/msg/twist_stamped.hpp"
33-
#include "kortex2_controllers/visibility_control.h"
33+
#include "twist_controller/visibility_control.h"
3434
#include "realtime_tools/realtime_buffer.h"
3535

36-
namespace kortex2_controllers
36+
namespace twist_controller
3737
{
3838
using CmdType = geometry_msgs::msg::TwistStamped;
3939
using CallbackReturn = rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn;
4040

4141
class TwistController : public controller_interface::ControllerInterface
4242
{
4343
public:
44-
KORTEX2_CONTROLLERS_PUBLIC
44+
TWIST_CONTROLLER_PUBLIC
4545
TwistController();
4646

47-
KORTEX2_CONTROLLERS_PUBLIC
47+
TWIST_CONTROLLER_PUBLIC
4848
controller_interface::InterfaceConfiguration command_interface_configuration() const override;
4949

50-
KORTEX2_CONTROLLERS_PUBLIC
50+
TWIST_CONTROLLER_PUBLIC
5151
controller_interface::InterfaceConfiguration state_interface_configuration() const override;
5252

53-
KORTEX2_CONTROLLERS_PUBLIC
53+
TWIST_CONTROLLER_PUBLIC
5454
CallbackReturn on_init() override;
5555

56-
KORTEX2_CONTROLLERS_PUBLIC
56+
TWIST_CONTROLLER_PUBLIC
5757
CallbackReturn on_configure(const rclcpp_lifecycle::State & previous_state) override;
5858

59-
KORTEX2_CONTROLLERS_PUBLIC
59+
TWIST_CONTROLLER_PUBLIC
6060
CallbackReturn on_activate(const rclcpp_lifecycle::State & previous_state) override;
6161

62-
KORTEX2_CONTROLLERS_PUBLIC
62+
TWIST_CONTROLLER_PUBLIC
6363
CallbackReturn on_deactivate(const rclcpp_lifecycle::State & previous_state) override;
6464

65-
KORTEX2_CONTROLLERS_PUBLIC
65+
TWIST_CONTROLLER_PUBLIC
6666
controller_interface::return_type update(
6767
const rclcpp::Time & time, const rclcpp::Duration & period) override;
6868

@@ -76,6 +76,6 @@ class TwistController : public controller_interface::ControllerInterface
7676
std::string logger_name_;
7777
};
7878

79-
} // namespace kortex2_controllers
79+
} // namespace twist_controller
8080

81-
#endif // KORTEX2_CONTROLLERS__TWIST_CONTROLLER_HPP_
81+
#endif // TWIST_CONTROLLER__TWIST_CONTROLLER_HPP_

twist_controller/include/twist_controller/visibility_control.h

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,38 +12,38 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#ifndef KORTEX2_CONTROLLERS__VISIBILITY_CONTROL_H_
16-
#define KORTEX2_CONTROLLERS__VISIBILITY_CONTROL_H_
15+
#ifndef TWIST_CONTROLLER__VISIBILITY_CONTROL_H_
16+
#define TWIST_CONTROLLER__VISIBILITY_CONTROL_H_
1717

1818
// This logic was borrowed (then namespaced) from the examples on the gcc wiki:
1919
// https://gcc.gnu.org/wiki/Visibility
2020

2121
#if defined _WIN32 || defined __CYGWIN__
2222
#ifdef __GNUC__
23-
#define KORTEX2_CONTROLLERS_EXPORT __attribute__((dllexport))
24-
#define KORTEX2_CONTROLLERS_IMPORT __attribute__((dllimport))
23+
#define TWIST_CONTROLLER_EXPORT __attribute__((dllexport))
24+
#define TWIST_CONTROLLER_IMPORT __attribute__((dllimport))
2525
#else
26-
#define KORTEX2_CONTROLLERS_EXPORT __declspec(dllexport)
27-
#define KORTEX2_CONTROLLERS_IMPORT __declspec(dllimport)
26+
#define TWIST_CONTROLLER_EXPORT __declspec(dllexport)
27+
#define TWIST_CONTROLLER_IMPORT __declspec(dllimport)
2828
#endif
29-
#ifdef KORTEX2_CONTROLLERS_BUILDING_LIBRARY
30-
#define KORTEX2_CONTROLLERS_PUBLIC KORTEX2_CONTROLLERS_EXPORT
29+
#ifdef TWIST_CONTROLLER_BUILDING_LIBRARY
30+
#define TWIST_CONTROLLER_PUBLIC TWIST_CONTROLLER_EXPORT
3131
#else
32-
#define KORTEX2_CONTROLLERS_PUBLIC KORTEX2_CONTROLLERS_IMPORT
32+
#define TWIST_CONTROLLER_PUBLIC TWIST_CONTROLLER_IMPORT
3333
#endif
34-
#define KORTEX2_CONTROLLERS_PUBLIC_TYPE KORTEX2_CONTROLLERS_PUBLIC
35-
#define KORTEX2_CONTROLLERS_LOCAL
34+
#define TWIST_CONTROLLER_PUBLIC_TYPE TWIST_CONTROLLER_PUBLIC
35+
#define TWIST_CONTROLLER_LOCAL
3636
#else
37-
#define KORTEX2_CONTROLLERS_EXPORT __attribute__((visibility("default")))
38-
#define KORTEX2_CONTROLLERS_IMPORT
37+
#define TWIST_CONTROLLER_EXPORT __attribute__((visibility("default")))
38+
#define TWIST_CONTROLLER_IMPORT
3939
#if __GNUC__ >= 4
40-
#define KORTEX2_CONTROLLERS_PUBLIC __attribute__((visibility("default")))
41-
#define KORTEX2_CONTROLLERS_LOCAL __attribute__((visibility("hidden")))
40+
#define TWIST_CONTROLLER_PUBLIC __attribute__((visibility("default")))
41+
#define TWIST_CONTROLLER_LOCAL __attribute__((visibility("hidden")))
4242
#else
43-
#define KORTEX2_CONTROLLERS_PUBLIC
44-
#define KORTEX2_CONTROLLERS_LOCAL
43+
#define TWIST_CONTROLLER_PUBLIC
44+
#define TWIST_CONTROLLER_LOCAL
4545
#endif
46-
#define KORTEX2_CONTROLLERS_PUBLIC_TYPE
46+
#define TWIST_CONTROLLER_PUBLIC_TYPE
4747
#endif
4848

49-
#endif // KORTEX2_CONTROLLERS__VISIBILITY_CONTROL_H_
49+
#endif // TWIST_CONTROLLER__VISIBILITY_CONTROL_H_

0 commit comments

Comments
 (0)