-
Notifications
You must be signed in to change notification settings - Fork 336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding Io gripper controller #1439
base: master
Are you sure you want to change the base?
Adding Io gripper controller #1439
Conversation
This PR depends on this PR |
# IO Gripper Controller | ||
|
||
The IO Gripper Controller is provides implementation to control the gripper using IOs. It provides functionalities like open, close and reconfigure which can be used either though action server or service server and also publishes `joint_states` of gripper and also `dynamic_interfaces` for all command and state interfaces. | ||
|
||
## Description of controller's interfaces | ||
|
||
- `joint_states` [`sensor_msgs::msg::JointState`]: Publishes the state of gripper joint and configuration joint | ||
- `dynamic_interfaces` [`control_msgs::msg::DynamicInterfaceValues`]: Publishes all command and state interface of the IOs and sensors of gripper. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should go into the doc folder in the rst format. For an example please check the joint_trajectory_controller
.
@@ -0,0 +1,234 @@ | |||
// Copyright (c) 2024, Stogl Robotics Consulting UG (haftungsbeschränkt) (template) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Copyright (c) 2024, Stogl Robotics Consulting UG (haftungsbeschränkt) (template) | |
// Copyright (c) 2024, Stogl Robotics Consulting UG (haftungsbeschränkt) |
// Source of this file are templates in | ||
// [RosTeamWorkspace](https://github.com/StoglRobotics/ros_team_workspace) repository. | ||
// |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Source of this file are templates in | |
// [RosTeamWorkspace](https://github.com/StoglRobotics/ros_team_workspace) repository. | |
// |
IDLE = 0, | ||
SET_BEFORE_COMMAND = 1, | ||
CLOSE_GRIPPER = 2, | ||
CHECK_GRIPPER_STATE = 3, | ||
OPEN_GRIPPER = 4, | ||
START_CLOSE_GRIPPER = 5, | ||
SET_AFTER_COMMAND = 6, | ||
HALTED = 7, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest documenting what these mean above in a longer docstring
std::vector<std::string> command_ios_open, command_ios_close, set_before_command_open, set_after_command_open, reconfigure_command; | ||
std::vector<double> command_ios_open_values, command_ios_close_values, set_before_command_open_values, set_after_command_open_values, reconfigure_command_values; | ||
std::vector<std::string> state_ios_open, state_ios_close, set_before_command_close, set_after_command_close; | ||
std::vector<double> state_ios_open_values, state_ios_close_values, set_before_command_close_values, set_after_command_close_values, set_after_command_open_values_original_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one variable per line please. I know it will get long...
// Copyright (c) 2024, Stogl Robotics Consulting UG (haftungsbeschränkt) (template) | ||
// | ||
// 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. | ||
|
||
// | ||
// Source of this file are templates in | ||
// [RosTeamWorkspace](https://github.com/StoglRobotics/ros_team_workspace) repository. | ||
// | ||
|
||
#ifndef GRIPPER_IO_CONTROLLER__VISIBILITY_CONTROL_H_ | ||
#define GRIPPER_IO_CONTROLLER__VISIBILITY_CONTROL_H_ | ||
|
||
// This logic was borrowed (then namespaced) from the examples on the gcc wiki: | ||
// https://gcc.gnu.org/wiki/Visibility | ||
|
||
#if defined _WIN32 || defined __CYGWIN__ | ||
#ifdef __GNUC__ | ||
#define GRIPPER_IO_CONTROLLER__VISIBILITY_EXPORT __attribute__((dllexport)) | ||
#define GRIPPER_IO_CONTROLLER__VISIBILITY_IMPORT __attribute__((dllimport)) | ||
#else | ||
#define GRIPPER_IO_CONTROLLER__VISIBILITY_EXPORT __declspec(dllexport) | ||
#define GRIPPER_IO_CONTROLLER__VISIBILITY_IMPORT __declspec(dllimport) | ||
#endif | ||
#ifdef GRIPPER_IO_CONTROLLER__VISIBILITY_BUILDING_DLL | ||
#define GRIPPER_IO_CONTROLLER__VISIBILITY_PUBLIC GRIPPER_IO_CONTROLLER__VISIBILITY_EXPORT | ||
#else | ||
#define GRIPPER_IO_CONTROLLER__VISIBILITY_PUBLIC GRIPPER_IO_CONTROLLER__VISIBILITY_IMPORT | ||
#endif | ||
#define GRIPPER_IO_CONTROLLER__VISIBILITY_PUBLIC_TYPE GRIPPER_IO_CONTROLLER__VISIBILITY_PUBLIC | ||
#define GRIPPER_IO_CONTROLLER__VISIBILITY_LOCAL | ||
#else | ||
#define GRIPPER_IO_CONTROLLER__VISIBILITY_EXPORT __attribute__((visibility("default"))) | ||
#define GRIPPER_IO_CONTROLLER__VISIBILITY_IMPORT | ||
#if __GNUC__ >= 4 | ||
#define GRIPPER_IO_CONTROLLER__VISIBILITY_PUBLIC __attribute__((visibility("default"))) | ||
#define GRIPPER_IO_CONTROLLER__VISIBILITY_LOCAL __attribute__((visibility("hidden"))) | ||
#else | ||
#define GRIPPER_IO_CONTROLLER__VISIBILITY_PUBLIC | ||
#define GRIPPER_IO_CONTROLLER__VISIBILITY_LOCAL | ||
#endif | ||
#define GRIPPER_IO_CONTROLLER__VISIBILITY_PUBLIC_TYPE | ||
#endif | ||
|
||
#endif // GRIPPER_IO_CONTROLLER__VISIBILITY_CONTROL_H_ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's not add this or any visibility macros in general here please.
#1053
S1 from this list is the preferred solution which we'll implement in the rest of the controllers too
This Pull Request introduces the IO Gripper Controller, an implementation for controlling a gripper using IOs. The controller supports functionalities such as open, close, and reconfigure, which can be triggered either through an Action Server or a Service Server. Additionally, the controller publishes the gripper’s state via joint_states and provides dynamic_interfaces to expose all command and state interfaces.
Features
Interfaces
Published Topics
joint_states
[sensor_msgs::msg::JointState
]:dynamic_interfaces
[control_msgs::msg::DynamicInterfaceValues
]:This addition enables better modular control of robotic grippers, paving the way for seamless integration in complex robotic systems.
Contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that:
To send us a pull request, please:
colcon test
andpre-commit run
(requires you to install pre-commit bypip3 install pre-commit
)