Skip to content

Commit

Permalink
add detail userdoc and configurable state interface
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Gesel <[email protected]>
  • Loading branch information
pac48 committed Apr 2, 2024
1 parent 2a5754f commit 7145368
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
5 changes: 5 additions & 0 deletions antipodal_gripper_controller/doc/userdoc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ Antipodal Gripper Action Controller
-----------------------------------

Controller for executing a ``AntipodalGripperCommand`` action for simple antipodal grippers.
This controller supports grippers that offer position only control as well as grippers that allow configuring the velocity and effort.
By default, the controller will only claim the `{joint}/position` interface for control.
The velocity and effort interfaces can be optionally claimed by setting the `max_velocity_interface` and `max_effort_interface` parameter, respectively.
By default, the controller will try to claim position and velocity state interfaces.
The claimed state interfaces can be configured by setting the `state_interfaces` parameter.

Parameters
^^^^^^^^^^^
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,7 @@ void GripperActionController::accepted_callback(
// This is the non-realtime command_struct
// We use command_ for sharing
command_struct_.position_cmd_ = goal_handle->get_goal()->command.position[0];
if (
!params_.max_velocity_interface.empty() && !goal_handle->get_goal()->command.velocity.empty())
if (!params_.max_velocity_interface.empty() && !goal_handle->get_goal()->command.velocity.empty())
{
command_struct_.max_velocity_ = goal_handle->get_goal()->command.velocity[0];
}
Expand Down Expand Up @@ -380,10 +379,12 @@ GripperActionController::command_interface_configuration() const
controller_interface::InterfaceConfiguration
GripperActionController::state_interface_configuration() const
{
return {
controller_interface::interface_configuration_type::INDIVIDUAL,
{params_.joint + "/" + hardware_interface::HW_IF_POSITION,
params_.joint + "/" + hardware_interface::HW_IF_VELOCITY}};
std::vector<std::string> interface_names;
for (const auto & interface : params_.state_interfaces)
{
interface_names.push_back(params_.joint + "/" + interface);
}
return {controller_interface::interface_configuration_type::INDIVIDUAL, interface_names};
}

GripperActionController::GripperActionController()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ antipodal_gripper_action_controller:
type: string,
read_only: true,
}
state_interfaces: {
type: string_array,
default_value: [position, velocity],
}
goal_tolerance: {
type: double,
default_value: 0.01,
Expand Down

0 comments on commit 7145368

Please sign in to comment.