2

I have to solve a problem with EV3, using language C with ROBOTC.

I am trying to find a ball in the field, grab it and drop in the triangle area. I'm using a ultrasonic sensor in front of the robot.

My solution for now is:

Turn 360 degrees and find the closest object. After finding the ball, I would like to drop it in the reserved area. That's ok.

The big problem is:

How can I distinct the balls with the triangle area? After grabbing the ball, I need to drop in the trinagle.

How about the walls? How can I differentiate?

Steps: Turn 360 and find the closest ball. Go to the triangle. Drop it. Turn 360 and find the closest ball. And so on.

But with sonic sensor, I can't distinct what's the triangle area and balls.

Can you help me the best way?

It's following the images:

enter image description here

enter image description here

OnScreen
  • 47
  • 8
  • 3
    If you look not only at the shortest distance, but also at the development of that distance of the angles of 360, do you see a difference? I imagine that the ball will have a sharper peak of proximity than the wall of the triangle. – Yunnosch Aug 22 '19 at 20:10
  • Yeah. Maybe I can find first the wall. I don't know how to distinct the object shapes and so on. How can I distinct then? – OnScreen Aug 22 '19 at 20:19
  • 1
    I would say if only sensor you have is range, the method described by @Yunnosch is probably way to go without some more assumptions to simplify the problem. Do some experiments, put your robot to some locations in empty area, do 360 degree turns while saving sensor data for whole turn. Repeat this experiment with ball/balls, with triangle, with everything etc (maximum of 10 should be enough). Now for each turn data, plot it to a graph (y axis range, x axis degree/time) and try to see a patterns to distinguish different objects. Different objects should cause different peaks on the graph. – unlut Aug 22 '19 at 21:09
  • @unlut That is what I meant, thanks for elaborating. OnScreen, I was not talking about first finding the wall, I was talking about the process of looking for the closest object and observing the derivation of proximity over angle (probably similar to derivation of proximity over time if that is more obvious to understand). It Is also similar to look not only at distance but also at width. I.e. how many angles do register the close distance. Few angles: ball, More angles: wall. – Yunnosch Aug 23 '19 at 06:13
  • Hello close-voters for "too broad". Would you like to explain? This is in my opinion a well described algorithm question. More than the pseudo code given is not needed when combined with the appropriate pictures. And OP has demonstrated some own thinking effort (admittedly not an impressive amount, but enough to qualify). – Yunnosch Aug 23 '19 at 06:16
  • @Yunnosch I get what you say. But another problem is to find the "triangle", the place where the balls is. Thanks. – OnScreen Aug 23 '19 at 18:55
  • @unlut I will try something like that. Thanks a lot. – OnScreen Aug 23 '19 at 18:55
  • The method I described allows to tell one from the other, i.e. to find both. Please provide sample data. I.e. make a 360 degree measurement from a point which allows to "ping" both, the ball and the triangle. Then add the info to the question, by [edit]ing a table into it giving the detected distance for 72 measurements every 5 degrees. Then I will use your data to demonstrate how you can detect both, tell them apart and decide in which direction to go to reach the ball and then the triangle. I will put that in an answer. – Yunnosch Aug 23 '19 at 20:29

0 Answers0