Robot Control: The robot's movement is controlled through a graphical interface using mouse clicks. The robot's position and orientation are updated based on user input.
Motor Control: Two motors (left and right) drive the robot's forward, backward, and rotational movements.
Path Tracking: The path followed by the robot during movement is displayed on the screen. Users can clear the path if needed.
Target Movement: The robot moves towards a target point specified by the user with the mouse.
Technical Details
USB Connection: The USB_Port() function detects a suitable USB device connected to the platform and establishes a connection.
Qt Interface: A graphical user interface (GUI) built with PyQt5 enables users to visually control the robot.
Dynamic Motor Speed Adjustment: Motor speeds are dynamically adjusted based on the distance to the target and angular differences.
Reverse Mode: Users can enable reverse mode to make the robot move in the opposite direction.
Usage
When the application runs, it searches for a device connected to the USB port.
In the graphical interface, the robot is represented as a red rectangle (or green in reverse mode).
Users can set the robot's target by clicking on the desired position in the interface, and the robot will move towards it.
Control buttons like "Start," "Stop," "Clear," and "Reverse" allow users to manage the robot's movement.
Control Buttons
Start
Function: Initializes the robot's motors and begins the movement logic.
Use Case: Click this button to start the robot. The robot will move towards the target point set by clicking on the interface.
Stop
Function: Stops the robot's motors and halts movement.
Use Case: Use this button to pause the robot's movement at any time. The robot will remain stationary until "Start" is pressed again.
Clear
Function: Resets the robot's path and position.
Use Case: Click this button to clear the path drawn by the robot on the interface and reset its position to the center of the canvas. Useful for starting a new simulation.
Reverse
Function: Toggles the robot's movement direction between forward and reverse.
Use Case: Press this button to enable or disable reverse mode. When enabled, the robot will move backward relative to its target. The button text changes dynamically to indicate the current mode: