I wanna build a robot car to collect the tennis balls on the tennis court in an autonomous way. But I am not sure what kind of sensor should I use to find the balls on the tennis court. Is ultrasonic sensor able to detect the balls which are relatively small? Or some othe sensors? If I should use ultrasonic sensor, would the signal be affected by the reflected sound wave from the ground since the ball is so close to the ground?
An ultrasonic sensor will give you the distance to a hard surface, but that would be any hard surface; tennis ball, wall, garbage etc.
We suggest that a camera is best, but that’s quite a bit of programming and object detection.
Alternatively, if everything on the court is a tennis ball or a post, then the robot could aim for any any all objects it detects and scoops them up.
Alternatively, you can simply have the robot push a long and flat scoop and push all of the balls to the side of the court - no detection needed aside from what to do around the poles holing up the net.
It depends on the configuration of the sensor; some are narrow which gives you a better distance to a point, while others are broad and pick up objects within a “cone” of detection.
If the ground is within the cone, there may be some odd values.