Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ This script uses the detect_ball function to detect the ball in the image captur

The catch_ball function continuously gets images from the camera and calls the detect_ball function to detect the ball in the image. If the ball is detected, it calculates the velocity vx and vy to move towards the ball's location by dividing the difference between the ball's and robot's locations by 2. Then it calls the move_by_velocity function to move the robot towards the ball.

This implementation uses a simple visual servoing approach where the robot moves towards the ball at a constant velocity. The velocity is proportional to the difference between the ball's and robot's locations, so the robot will move faster as it gets closer to the ball. You can adjust the gain (i.e., the multiplication factor of 0.5) to control the speed of the robot.
This implementation uses a simple visual servoing approach where the robot moves towards the ball at a constant velocity. The velocity is proportional to the difference between the ball's and robot's locations, so the robot will move slower as it gets closer to the ball. You can adjust the gain (i.e., the multiplication factor of 0.5) to control the speed of the robot.

---------------------------------------------------------------------------

Expand Down Expand Up @@ -143,4 +143,4 @@ To show the movement of the robot, we can add two \<polyline\> elements. The fir

You can adjust the position of the ball and the movement of the robot by changing the cx and cy attributes of the \<circle\> element and the points attribute of the \<polyline\> elements.

---------------------------------------------------------------------------
---------------------------------------------------------------------------