This project implements a Pick and Place Robot using a UR5 robotic arm in CoppeliaSim. The robot is programmed to identify, pick, and place colored boxes (red and blue) into designated areas using a finite state machine (FSM) for control. The project showcases the integration of sensors, inverse kinematics, and state-based logic for precise robotic operations.
- UR5 Robotic Arm:
- Controls the motion of the manipulator to pick and place objects.
- Color Detection:
- Proximity and vision sensors detect objects and differentiate between red and blue boxes.
- Finite State Machine (FSM):
- Manages operational states, ensuring smooth transitions between detecting, picking, moving, and placing objects.
- Robust Control:
- Implements inverse kinematics for precise movement and collision avoidance.
- UR5 Robotic Arm: The primary manipulator.
- Colored Boxes: Red and blue boxes to be sorted into designated areas.
- Proximity and Vision Sensors: Detects object presence and identifies their colors.
- Finite State Machine (FSM): Controls the sequence of operations:
- Detecting objects.
- Moving to object positions.
- Grasping and releasing objects.
- Handles for the UR5 arm, end effector, sensors, and objects are initialized.
- A list of all boxes in the scene is created (
objects_to_move
). - The initial positions for picking and placing boxes are calculated.
- FSM states are defined.
- Called at each simulation step.
- Retrieves the current box to be processed.
- Adjusts box positions for collision-free grasping.
- Updates the robotic arm's state using the
moveSimpleManipulator
function.
- Core state transitions and actions:
state_start
: Initialization phase.state_start2pick
: Moves towards the box.state_pick
: Grasps the box.state_pick2start
: Returns to the start position.state_place
: Releases the box in its designated area.state_stop
: Ends the operation.
- Utilizes the
moveIK
function to control the arm’s motion using inverse kinematics.
- Computes positions based on the current and target positions.
- Interpolates movement over a specified duration.
- Grasping:
- Uses the vision sensor to identify and pick up boxes based on color detection.
- Sets flags (
is_red
) for color-based sorting.
- Releasing:
- Updates the parent of the attached shape to release the object in the correct area.
- Insert a UR5 robotic arm model into a new CoppeliaSim scene.
- Add red and blue boxes at various positions.
- Set up proximity and vision sensors.
- Attach the provided Lua script to the UR5 arm. The script includes control logic for picking and placing.
- Ensure the vision sensor outputs color data to distinguish red and blue boxes.
- Start the simulation to observe the arm detecting, picking, and placing boxes:
- Red boxes → Right area.
- Blue boxes → Left area.
- Adjust sensor configurations or FSM parameters (e.g., durations) for smooth operation.
- Initial State:
- The arm starts at its default position, ready to operate.
- Detect Blue Box:
- Identifies and picks up the blue box, placing it in the left area.
- Detect Red Box:
- Identifies and picks up the red box, placing it in the right area.
- Final Sorted State:
- All boxes are sorted into their designated areas.
- Set Up:
- Open the CoppeliaSim scene with the UR5 arm and colored boxes.
- Attach Script:
- Link the provided Lua script to the UR5 model.
- Run Simulation:
- Start the simulation and observe the pick-and-place operation.