Skip to content

Conversation

sachinkum0009
Copy link

@sachinkum0009 sachinkum0009 commented Dec 21, 2024

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

  1. joint_states [sensor_msgs::msg::JointState]:

    • Publishes the state of the gripper joint and its configuration joint.
  2. 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:

  1. Limited scope. Your PR should do one thing or one set of things. Avoid adding “random fixes” to PRs. Put those on separate PRs.
  2. Give your PR a descriptive title. Add a short summary, if required.
  3. Make sure the pipeline is green.
  4. Don’t be afraid to request reviews from maintainers.
  5. 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:

  • Fork the repository.
  • 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.
  • Ensure local tests pass. (colcon test and pre-commit run (requires you to install pre-commit by pip3 install pre-commit)
  • Commit to your fork using clear commit messages.
  • Send a pull request, answering any default questions in the pull request interface.
  • Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation.

@sachinkum0009
Copy link
Author

This PR depends on this PR

Comment on lines 1 to 4
# 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.

Copy link
Member

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also write docs extensively about the internal state machine and also internal functionalities and external interface. As template, use the docs from another controller and adjust the content.

Copy link
Member

@destogl destogl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First set of comments. The second one comes tomorrow.

Comment on lines 1 to 4
# 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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also write docs extensively about the internal state machine and also internal functionalities and external interface. As template, use the docs from another controller and adjust the content.

@sachinkum0009 sachinkum0009 marked this pull request as draft January 2, 2025 14:55
return CallbackReturn::FAILURE;
}

if (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be optional.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will update the required code for the optional. Thanks.

}

// configuration joints parameter
if (params_.configuration_joints.empty())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

optional

}

// configurations parameter
if (params_.configurations.empty())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

optional

}

// configuration setup parameter
if (params_.configuration_setup.configurations_map.empty())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

everything configuration related is optional.

}

// gripper_specific_sensors parameter
if (params_.gripper_specific_sensors.empty())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

optional.

Comment on lines 913 to 914
"~/gripper_close", close_service_callback, rmw_qos_profile_services_hist_keep_all,
close_service_callback_group_);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"~/gripper_close", close_service_callback, rmw_qos_profile_services_hist_keep_all,
close_service_callback_group_);
"~/gripper_close", close_service_callback, qos_services, close_service_callback_group_);

}
}

void IOGripperController::handle_reconfigure_state_transition(const reconfigure_state_type & state)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Proposal here. Can we do this general check only when activating the controller, i.e., on_activate because later when we're switching states we know already which states do we expect, and then we check only those.

The main idea is to avoid so many iterations in every control step is this is not even necessary.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also please add tests with different initial states of the gripper? To make sure that we recognize it correctly.

}
}

void IOGripperController::handle_gripper_state_transition_open(const gripper_state_type & state)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find generally this function somewhat inconsistent with the closing state checks. Can we unify this a bit. Especially the part when setting low and high states. I would except there more or less copy-paste code, or better yet calling subfunctions as we constantly do the same.

@destogl destogl force-pushed the io_gripper_controller branch from 4ffbec4 to 2575a90 Compare September 1, 2025 14:35
@github-actions github-actions bot removed the stale label Sep 2, 2025
@destogl destogl changed the title Adding Io gripper controller 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) Sep 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants