Hi guys,
I need to program an arduino robot (driven by 2 dc motors and equipped with ultrasonic sensors) to navigate an arena (image attached). The robot will start on one of the starting locations (labeled 1,2,3,4) and then drive to each of the four objectives (labeled A,B,C,D) in a set order. I want to be able to input any starting location, and any objective order into the code and have the robot properly navigate. [It would also be nice if it could repeat the process of hitting the objectives in order after completing it] I'm really stuck as to how to begin the code for this task.
What level of programming experience do you have?
If this is your first program, you need to start with something simpler.
Can you even run the motors at various speeds, both forwards and backwards?
1- Start the engines, make them move in all the necessary directions, and at the right speeds.
2- Receive the signal from the sensors, check the behavior of the sensor, and the working scale that the sensor provides.
3- Then do fixed route routines, step by step.
4- So, change one of the route points to be flexible, when you can make it possible to change this point, then you can repeat the idea for the other points.
I suggest you use a flowchart to help you better visualize the program routine, search for:
vaj4088:
What level of programming experience do you have?
If this is your first program, you need to start with something simpler.
Can you even run the motors at various speeds, both forwards and backwards?
vaj4088:
What level of programming experience do you have?
If this is your first program, you need to start with something simpler.
Can you even run the motors at various speeds, both forwards and backwards?
Yes, I have programmed the robot to drive in both directions, turn, and avoid obstacles using the ultrasonic sensor. I'm just not sure how to account for the random order of the starting point and objectives.
Can you get from a starting point to an objective? How do you keep track of where you are? How are you going to input the starting point and the order of objectives?
How does an ultrasonic sensor give you the ability to navigate?
It lets you know if something is in front of the sensor, and how far it is.
I do not see how you can use that to translate into navigation from a point to another point.
What tells your robot where it is in the arena? Or where the next objective is?
Hi guys,
I need to program an arduino robot (driven by 2 dc motors and equipped with ultrasonic sensors) to navigate an arena (image attached). The robot will start on one of the starting locations (labeled 1,2,3,4) and then drive to each of the four objectives (labeled A,B,C,D) in a set order. I want to be able to input any starting location, and any objective order into the code and have the robot properly navigate. [It would also be nice if it could repeat the process of hitting the objectives in order after completing it] I'm really stuck as to how to begin the code for this task.
Thanks!
My suggestion is to modify your project to accurately measure the distance traveled between your chosen points. You might be able to do this by counting wheel turns.
When you get this working, then you need to be able to store this distance, along with an identifying id, so you can find this starting point when you wish to input a starting point. At this time your starting point must correspond to the starting point of your recorded entry. In order to vary the starting point that is not a recorded starting point will require much more logic.