Skip to content

Commit af740ca

Browse files
moriartyabake48
andauthored
fault_controller -> picknik_reset_fault_controller (#2)
* fault_controller -> picknik_reset_fault_controller This commit does two things: 1) renames fault_controller to reset_fault_controller 2) prefixes with picknik_ The first change, is to be more specific what this controller is used for. The second change is because we want to move this controller into ros2_controllers and when that is complete we can drop the picknik_ and depricate this version allowing for a transition period. --------- Signed-off-by: Alex Moriarty <[email protected]> Co-authored-by: Anthony Baker <[email protected]>
1 parent 649c651 commit af740ca

File tree

12 files changed

+121
-111
lines changed

12 files changed

+121
-111
lines changed

.github/workflows/ci-coverage-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
import-token: ${{ secrets.GITHUB_TOKEN }}
2727
# build all packages listed in the meta package
2828
package-name:
29-
fault_controller
29+
picknik_reset_fault_controller
3030

3131
vcs-repo-file-url: |
3232
https://raw.githubusercontent.com/${{ github.repository }}/${{ github.sha }}/picknik_controllers-not-released.${{ env.ROS_DISTRO }}.repos?token=${{ secrets.GITHUB_TOKEN }}

.github/workflows/ci-ros-lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
distribution: rolling
1919
linter: ${{ matrix.linter }}
2020
package-name:
21-
fault_controller
21+
picknik_reset_fault_controller
2222

2323

2424
ament_lint_100:
@@ -37,5 +37,5 @@ jobs:
3737
linter: cpplint
3838
arguments: "--linelength=100 --filter=-whitespace/newline"
3939
package-name:
40-
fault_controller
40+
picknik_reset_fault_controller
4141
picknik_controllers

.github/workflows/reusable-ros-tooling-source-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
target-ros2-distro: ${{ inputs.ros_distro }}
3838
# build all packages listed in the meta package
3939
package-name:
40-
fault_controller
40+
picknik_reset_fault_controller
4141

4242
vcs-repo-file-url: |
4343
https://raw.githubusercontent.com/ros2/ros2/${{ inputs.ros2_repo_branch }}/ros2.repos

README.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
1+
# picknik_controllers
12

3+
Package defining custom controllers that are generic and we want to contribute them into ros2_controllers.
4+
The controllers have been prefixed with `picknik_` so that when they eventually land upstream the prefix can be removed and the versions here will become deprecated.
25

3-
# kortex2_controllers
4-
Package defining custom controllers created for kinova robots.
5-
- `kortex2_controllers::TwistController`
6-
- `kortex2_controllers::FaultController`
6+
- `picknik_twist_controller::PicknikTwistController`
7+
- `picknik_reset_fault_controller::PicknikResetFaultController`
78

89

9-
## TwistController
10-
Cartesian twist controller created to use builtin controller on the kinova robot.
10+
## PicknikTwistController
11+
Generic ROS2 controller to forward cartesian twist commands.
12+
We plan to land this upstream in ros2_controllers: https://github.com/ros-controls/ros2_controllers/pull/300
1113

1214
### Usage
13-
Example of instance within `ros2_control` can be found in the [configuration file](../kortex2_bringup/config/kortex_controllers.yaml).
15+
Example of instance within `ros2_control` can be found in the [configuration file](https://github.com/PickNikRobotics/ros2_kortex/blob/main/kortex_description/arms/gen3/7dof/config/ros2_controllers.yaml).
1416
Defined interfaces have to exist within the `hardware_interface::SystemInterface` implemented for the robot (e.g. driver).
1517
Stop any commanding controller and then start `TwistController`to use kinova's builtin cartesian twist controller.
1618

@@ -25,11 +27,11 @@ ros2 control switch_controllers --activate streaming_controller --deactivate joi
2527
By publishing `geometry_msgs::msg::TwistStamped` to `/streaming_controller/commands`, the commands will be piped to the driver
2628
and streamed to the robot controller.
2729

28-
## FaultController
29-
Controller used to reset faults on the kinova arm.
30+
## PicknikResetFaultController
31+
ROS 2 controller that offers a service to clear faults in a hardware interface
3032

3133
### Usage
32-
Example of instance within `ros2_control` can be found in the [configuration file](../kortex2_bringup/config/kortex_controllers.yaml).
34+
Example of instance within `ros2_control` can be found in the [configuration file](https://github.com/PickNikRobotics/ros2_kortex/blob/main/kortex_description/arms/gen3/7dof/config/ros2_controllers.yaml).
3335
Interfaces are already hardcoded in the `hardware_interface::SystemInterface` implemented for the robot (e.g. driver)
3436

3537
Spawn `FaultController` if it is not already spawned
@@ -60,7 +62,6 @@ ros2 control swithc_controllers --activate joint_trajectory_controller gripper_c
6062
## Build status
6163

6264

63-
6465
ROS2 Distro | Branch | Build status | Documentation | Released packages
6566
:---------: | :----: | :----------: | :-----------: | :---------------:
6667
**Rolling** | [`rolling`](https://github.com/PickNikRobotics/picknik_controllers/tree/rolling) | [![Rolling Binary Build](https://github.com/PickNikRobotics/picknik_controllers/actions/workflows/rolling-binary-build-main.yml/badge.svg?branch=main)](https://github.com/PickNikRobotics/picknik_controllers/actions/workflows/rolling-binary-build-main.yml?branch=main) <br /> [![Rolling Semi-Binary Build](https://github.com/PickNikRobotics/picknik_controllers/actions/workflows/rolling-semi-binary-build-main.yml/badge.svg?branch=main)](https://github.com/PickNikRobotics/picknik_controllers/actions/workflows/rolling-semi-binary-build-main.yml?branch=main) | [![Doxygen Doc Deployment](https://github.com/PickNikRobotics/picknik_controllers/actions/workflows/doxygen-deploy.yml/badge.svg)](https://github.com/PickNikRobotics/picknik_controllers/actions/workflows/doxygen-deploy.yml) <br /> [Generated Doc](https://PickNikRobotics.github.io/picknik_controllers_Documentation/rolling/html/index.html) | [picknik_controllers](https://index.ros.org/p/picknik_controllers/#rolling)

fault_controller/controller_plugins.xml

Lines changed: 0 additions & 7 deletions
This file was deleted.

fault_controller/include/fault_controller/visibility_control.h

Lines changed: 0 additions & 49 deletions
This file was deleted.

fault_controller/CMakeLists.txt renamed to picknik_reset_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(fault_controller)
2+
project(picknik_reset_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/fault_controller.cpp)
26+
add_library(${PROJECT_NAME} SHARED src/picknik_reset_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 "FAULT_CONTROLLER_BUILDING_LIBRARY")
37+
target_compile_definitions(${PROJECT_NAME} PRIVATE "PICKNIK_RESET_FAULT_CONTROLLER_BUILDING_LIBRARY")
3838
pluginlib_export_plugin_description_file(controller_interface controller_plugins.xml)
3939

4040
install(TARGETS ${PROJECT_NAME}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<library path="picknik_reset_fault_controller">
2+
<class name="picknik_reset_fault_controller/FaultController" type="picknik_reset_fault_controller::FaultController" base_class_type="controller_interface::ControllerInterface">
3+
<description>
4+
ROS 2 controller that offers a service to clear faults in a hardware interface
5+
</description>
6+
</class>
7+
</library>

fault_controller/include/fault_controller/fault_controller.hpp renamed to picknik_reset_fault_controller/include/picknik_reset_fault_controller/picknik_reset_fault_controller.hpp

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

24-
#ifndef FAULT_CONTROLLER__FAULT_CONTROLLER_HPP_
25-
#define FAULT_CONTROLLER__FAULT_CONTROLLER_HPP_
24+
#ifndef PICKNIK_RESET_FAULT_CONTROLLER__PICKNIK_RESET_FAULT_CONTROLLER_HPP_
25+
#define PICKNIK_RESET_FAULT_CONTROLLER__PICKNIK_RESET_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 "fault_controller/visibility_control.h"
33+
#include "picknik_reset_fault_controller/visibility_control.h"
3434
#include "realtime_tools/realtime_publisher.h"
3535

36-
namespace fault_controller
36+
namespace picknik_reset_fault_controller
3737
{
3838
enum CommandInterfaces
3939
{
@@ -48,31 +48,31 @@ using CmdType = example_interfaces::srv::Trigger;
4848
using FbkType = example_interfaces::msg::Bool;
4949
using CallbackReturn = rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn;
5050

51-
class FaultController : public controller_interface::ControllerInterface
51+
class PicknikResetFaultController : public controller_interface::ControllerInterface
5252
{
5353
public:
54-
FAULT_CONTROLLER_PUBLIC
55-
FaultController();
54+
PICKNIK_RESET_FAULT_CONTROLLER_PUBLIC
55+
PicknikResetFaultController();
5656

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

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

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

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

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

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

75-
FAULT_CONTROLLER_PUBLIC
75+
PICKNIK_RESET_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 fault_controller
93+
} // namespace picknik_reset_fault_controller
9494

95-
#endif // FAULT_CONTROLLER__FAULT_CONTROLLER_HPP_
95+
#endif // PICKNIK_RESET_FAULT_CONTROLLER__PICKNIK_RESET_FAULT_CONTROLLER_HPP_
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
// Copyright 2021, PickNik Inc.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
#ifndef PICKNIK_RESET_FAULT_CONTROLLER__VISIBILITY_CONTROL_H_
16+
#define PICKNIK_RESET_FAULT_CONTROLLER__VISIBILITY_CONTROL_H_
17+
18+
// This logic was borrowed (then namespaced) from the examples on the gcc wiki:
19+
// https://gcc.gnu.org/wiki/Visibility
20+
21+
#if defined _WIN32 || defined __CYGWIN__
22+
#ifdef __GNUC__
23+
#define PICKNIK_RESET_FAULT_CONTROLLER_EXPORT __attribute__((dllexport))
24+
#define PICKNIK_RESET_FAULT_CONTROLLER_IMPORT __attribute__((dllimport))
25+
#else
26+
#define PICKNIK_RESET_FAULT_CONTROLLER_EXPORT __declspec(dllexport)
27+
#define PICKNIK_RESET_FAULT_CONTROLLER_IMPORT __declspec(dllimport)
28+
#endif
29+
#ifdef PICKNIK_RESET_FAULT_CONTROLLER_BUILDING_LIBRARY
30+
#define PICKNIK_RESET_FAULT_CONTROLLER_PUBLIC PICKNIK_RESET_FAULT_CONTROLLER_EXPORT
31+
#else
32+
#define PICKNIK_RESET_FAULT_CONTROLLER_PUBLIC PICKNIK_RESET_FAULT_CONTROLLER_IMPORT
33+
#endif
34+
#define PICKNIK_RESET_FAULT_CONTROLLER_PUBLIC_TYPE PICKNIK_RESET_FAULT_CONTROLLER_PUBLIC
35+
#define PICKNIK_RESET_FAULT_CONTROLLER_LOCAL
36+
#else
37+
#define PICKNIK_RESET_FAULT_CONTROLLER_EXPORT __attribute__((visibility("default")))
38+
#define PICKNIK_RESET_FAULT_CONTROLLER_IMPORT
39+
#if __GNUC__ >= 4
40+
#define PICKNIK_RESET_FAULT_CONTROLLER_PUBLIC __attribute__((visibility("default")))
41+
#define PICKNIK_RESET_FAULT_CONTROLLER_LOCAL __attribute__((visibility("hidden")))
42+
#else
43+
#define PICKNIK_RESET_FAULT_CONTROLLER_PUBLIC
44+
#define PICKNIK_RESET_FAULT_CONTROLLER_LOCAL
45+
#endif
46+
#define PICKNIK_RESET_FAULT_CONTROLLER_PUBLIC_TYPE
47+
#endif
48+
49+
#endif // PICKNIK_RESET_FAULT_CONTROLLER__VISIBILITY_CONTROL_H_

0 commit comments

Comments
 (0)