How allan-almeida1/ur5-pick-and-place works
Main components
• Simulation Environment – CoppeliaSim with the “UR5.ttt” scene.
• Robot Control Module – The Python code (found in src/ur5.py) that implements the kinematics, trajectory planning, and control logic.
• Communication/Interface Layer – The ZMQRemote API libraries present in the “src/coppeliasim_zmqremoteapi_client” and “zmqRemoteApi” directories. These mediate command exchange between the control module and the simulator.
• Machine Learning Module – The CNN model stored as “machine_learning/cup_position_model.h5” and supporting routines (likely invoked within the Jupyter Notebook “Trabalho.ipynb”) that performs cup detection (converting image inputs to relative cup positions).
• Jupyter Notebook Interface – “Trabalho.ipynb” provides an interactive way to initialize the simulation, load dependencies, and execute various control scripts.
Relationships and interactions
• Data Flow from Camera to ML Module: Images (or image data) captured in the simulation could be fed into the CNN to predict the cup’s coordinates.
• ML to Control Module: The predicted positions (in image space converted to real-world XYZ coordinates) are used by the robot control logic to compute trajectories.
• Control Module to Communication Layer: The computed joint velocities (via forward/inverse kinematics and quintic trajectories) are sent to the CoppeliaSim simulator using the ZMQRemote API.
• User Interface (Jupyter Notebook) sits at the top, orchestrating the overall flow by invoking functions from both the machine learning and control modules.
Architectural patterns and design principles
• Separation of Concerns – Distinct modules for simulation interfacing, robot kinematics/control and vision (machine learning) make the system modular and easier to maintain.
• Asynchronous Communication – The presence of an “asyncio” directory suggests non-blocking operations in the simulation communication channel.
• Integration of Machine Learning with Real-Time Control – The design clearly decouples the prediction model from the control logic, connected through clearly defined data flows.
• Use of a Client-Server Pattern – The ZMQRemote API acts as a middleware between the control code and the simulation server (CoppeliaSim).
Final advice
• Every component shows its relationship with others.
• Avoid a “flat” picture – separate the conceptual layers (presentation/interface, application logic, simulation interfacing, and ML vision) to improve clarity.