Answers.Body: <p>It's been quite a while since I've programmed a robot, but using only the sonic sensor does make it a bit more challenging.  Also, not knowing anything else about the robot you've built (it's size, other sensors &amp; their location, the ball grabbing mechanism, etc.) it further complicates any possible advice.   </p>
  
  <p>That being said, the only solution I could think of would be to use the opening/doorway to the room as a reference point for the robot.  The sensor should be able to locate it since it's "open", and the robot sent towards it.  The line on the ramp leads me to believe your robot has a color sensor for line following, therefore should be able to detect the line at the doorway once it arrives.  This will also allow the robot to "true" its location, which would allow rotating "x" degrees to have you pointing directly at the drop-off point.  Then straight forward and (?) because I have no idea how your robot even picks the balls up or drops them. </p>
  
  <p>My other solution would be to have a mechanical release lever for the ball.  The lever would be positioned so only the low wall of the triangle could push it.  This would be a much more simple solution in theory.     </p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-08-25T09:37:31.803Z
Answers.LastActivityDate: 2019-08-25T09:37:31.803Z
Answers.UserDisplayName: JohnnyB
Body: <p>I am trying to find a ball in the field, grab it, and drop in the specified area. I'm using an ultrasonic sensor on the front of the robot.  </p>
  
  <p><a href="https://i.sstatic.net/H3B4U.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/H3B4U.jpg" alt="enter image description here"></a>  </p>
  
  <p>My current solution for locating the ball is: Turn 360 degrees and find the closest object. This part works.</p>
  
  <p>After obtaining the ball it needs to be dropped in the reserved triangular area.  What can I do to make the sonic sensor distinguish between the ball, walls, and the triangular drop area?  </p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-08-25T08:45:10.247Z
Comments.Text: Are you limited to only the ultrasonic sensor on your robot?
Comments.UserDisplayName: JohnnyB
Tags: <ev3><programming><robotc><sensor-ultrasonic>
Title: How to distinguish between objects using a sonic sensor?
UserDisplayName: OnScreen
ThreadText: # How to distinguish between objects using a sonic sensor?
  
  (Asked by: username_0 on 2019-08-23)
  
  I am trying to find a ball in the field, grab it, and drop in the specified area. I'm using an ultrasonic sensor on the front of the robot.
  
  [![enter image description here](https://i.sstatic.net/H3B4U.jpg)](https://i.sstatic.net/H3B4U.jpg)
  
  My current solution for locating the ball is: Turn 360 degrees and find the closest object. This part works.
  
  After obtaining the ball it needs to be dropped in the reserved triangular area. What can I do to make the sonic sensor distinguish between the ball, walls, and the triangular drop area?
  
  **Tags:** ev3, programming, robotc, sensor-ultrasonic
  > **Comments:**
  > **username_1**: Are you limited to only the ultrasonic sensor on your robot?  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-08-25. Score: 1
  
  It's been quite a while since I've programmed a robot, but using only the sonic sensor does make it a bit more challenging. Also, not knowing anything else about the robot you've built (it's size, other sensors & their location, the ball grabbing mechanism, etc.) it further complicates any possible advice.
  
  That being said, the only solution I could think of would be to use the opening/doorway to the room as a reference point for the robot. The sensor should be able to locate it since it's "open", and the robot sent towards it. The line on the ramp leads me to believe your robot has a color sensor for line following, therefore should be able to detect the line at the doorway once it arrives. This will also allow the robot to "true" its location, which would allow rotating "x" degrees to have you pointing directly at the drop-off point. Then straight forward and (?) because I have no idea how your robot even picks the balls up or drops them.
  
  My other solution would be to have a mechanical release lever for the ball. The lever would be positioned so only the low wall of the triangle could push it. This would be a much more simple solution in theory.
  
  
  ---
  
  