Add GPIO Tool controller - Controller that can manage different tools (grippers, lifts, forks) and states (automatic/manual) that can be set and determined using IOs (analog or digital)
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
- Action and Service Integration: Offers flexible control of gripper operations through action or service calls.
- State Publishing: Continuously publishes the gripper's joint states and dynamic interface values for real-time monitoring.
Interfaces
Published Topics
-
joint_states[sensor_msgs::msg::JointState]:- Publishes the state of the gripper joint and its configuration joint.
-
dynamic_interfaces[control_msgs::msg::DynamicInterfaceValues]:- Publishes all command and state interfaces related to the gripper's IOs and sensors.
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:
- Limited scope. Your PR should do one thing or one set of things. Avoid adding “random fixes” to PRs. Put those on separate PRs.
- Give your PR a descriptive title. Add a short summary, if required.
- Make sure the pipeline is green.
- Don’t be afraid to request reviews from maintainers.
- New code = new tests. If you are adding new functionality, always make sure to add some tests exercising the code and serving as live documentation of your original intention.
To send us a pull request, please:
- [X] Fork the repository.
- [X] Modify the source; please focus on the specific change you are contributing. If you also reformat all the code, it will be hard for us to focus on your change.
- [X] Ensure local tests pass. (
colcon testandpre-commit run(requires you to install pre-commit bypip3 install pre-commit) - [X] Commit to your fork using clear commit messages.
- [x] Send a pull request, answering any default questions in the pull request interface.
- [x] Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation.
This PR depends on this PR
Some major things to fix:
- [ ] fix compilation
- [ ] use a new
handle_gripper_transitionmethod for all transitions:- [ ] update how
closedata is stored — use struct and lambda function to manage this in the code to make the code shorter and nicer (see example for open ios) - [ ] update how parameters for configurations are used and stored using the new structure
- [ ] use only one method with the same transitions, this means that all transitions should have before and after states, i.e., this should be added for configurations.
- [ ] update how
- [ ] Add support for also getting feedback from
beforeandafterstates (if those exist, or are set) - [ ] react by aborting action if timeout happens and
HALTEDis set - [ ] Fill out the new
IOGripperControllerStatemessage with the names of the overall states we are in and transitions if we are in the transition at the moment. Check the message.
Let me know if you have any questions.
@Raivias thanks for your review. @sachinkum0009 and I have few more things to clean, some of those are related to your comments.
This pull request is in conflict. Could you fix it @sachinkum0009?
This PR is stale because it has been open for 45 days with no activity. Please tag a maintainer for help on completing this PR, or close it if you think it has become obsolete.
gpio controller won't compile with C++17 due to this type:
std::atomic<std::shared_ptr<std::string>> target_configuration_;
std_shared does nto have a trivial copy constructor which can be handled with C++17 atomic.
In this PR, I've opted for using realtime_tools::RealtimeThreadSafeBox for access to the string.
COLCON_INGORE io_gripper_controller
Consider deleting io_gripper_controller from the repo, it is empty and this replaces it.
This PR is stale because it has been open for 45 days with no activity. Please tag a maintainer for help on completing this PR, or close it if you think it has become obsolete.