Control Gripper
control_gripper.py
Overview
control_gripper.py is an ActionLib server that commands the TIAGo gripper to open or close. It accepts a boolean goal—True to grip, False to release— and publishes a std_msgs/Bool on the gripper command topic. After a short delay, it reports success or honours any pre-emption/abort requests.
Interfaces (strongly-typed, stateless)
Direction |
Topic / Name |
Type / Semantics |
---|---|---|
Publish |
|
|
Action server |
|
|
Contract
Pre-conditions
Action server started before goals arrive.
Publisher on /cmd_vel/gripper is available.
Post-conditions
On goal reception, publishes exactly one boolean command.
After delay, sets Action to succeeded, pre-empted, or aborted.
Feedback published once per goal with a brief status.
Invariants
Delay duration and command topic are configurable in execute_cb().
No persistent state beyond wiring subscribers/publishers.
Tuning knobs
actuation_delay = 2.0 seconds – adjust for real hardware response.
- class control_gripper.ControlGripperServer[source]
Bases:
object
ActionLib server wrapping a boolean gripper command.
Variables
- cmd_pubrospy.Publisher
Publishes Bool on /cmd_vel/gripper.
- serveractionlib.SimpleActionServer
Serves gripper_control goals.
Workflow
Read robot_number from CLI.
Initialise ROS node <robot>_control_gripper_node.
Advertise /cmd_vel/gripper.
Start SimpleActionServer on /gripper_control.