๐ค Pick Node
See the source code for implementation details.
The Pick Node controls the MyCobot arm and gripper to pick up objects once the robot reaches the target location.
It integrates directly with the Mission Manager Node and executes a predefined pick sequence.
๐ MyCobot Integrationโ
The Pick Node communicates with the MyCobot arm over:
- ROS2 topics/services (if using mycobot_ros2 driver)
- TCP/Wi-Fi API (if using direct API control)
Typical integration flow:
- Receive trigger from Mission Manager (
/pick_triggeror action call) - Calculate pick position (from
/target_poseor pre-defined offset) - Move arm to pre-grasp position (safe above object)
- Lower arm to grasp position
- Close gripper to grab object
- Lift to transport pose
- Send completion flag back to Mission Manager
โ Gripper Control Mechanismsโ
The gripper can be controlled in two ways:
1. Position Command:โ
- Send "open" or "close" angles directly
- Example:
gripper.publish(servo_angle)
2. Service Call:โ
- Use dedicated service:
/gripper_controlwith commandsopenorclose
Example (pseudo-ROS2 code):
def close_gripper():
self.gripper_pub.publish(Int16(100)) # Fully closed
def open_gripper():
self.gripper_pub.publish(Int16(0)) # Fully open
๐ก Error Handling Proceduresโ
| Error Case | Action Taken |
|---|---|
| Arm fails to reach pose | Retry up to N times, log warning |
| Gripper fails to close/open | Retry with adjusted force, log error |
| Timeout on pick sequence | Abort pick, return failure to Mission Manager |
| Object slips after pick | Trigger re-grasp attempt if enabled |
Safety First
Always implement a maximum number of retries to avoid damaging the arm or gripper.
๐งช Testing & Verificationโ
Before live tests:
- Simulation: Test pick sequence in MoveIt2 or Gazebo without real hardware
- Dry Run: Run arm sequence in the air (no object) to verify poses
- Slow Speed: Run live test at reduced joint speeds for safety
Verification checklist:
- โ Arm moves to correct pre-grasp pose
- โ Arm descends vertically to grasp pose
- โ Gripper closes fully and holds object
- โ Arm lifts without collision
๐ Troubleshooting Common Issuesโ
| Symptom | Possible Cause | Solution |
|---|---|---|
| Arm stops mid-motion | Power or connection issue | Check MyCobot power & network |
| Gripper does not respond | Wrong topic/service name | Verify correct ROS2 topic/service |
| Pick position is off | Wrong transform or pose offset | Calibrate TF frames, adjust offsets |
| Object slips during lift | Low grip force or wrong gripper pose | Increase grip force or close fully |
| Node crashes when triggered | Missing parameter or bad message | Validate inputs before starting |