hi.i am 4th year ece stude ,i m working on my SWARM ROBTICS project.
In my Project i use arduino board,dc motor and HC-SRO4 ultrasonic sensor.my first task is to perform square loop which is completed,my second task is too perform square loop with obstacle detection (mean when obstacle is present in ur path it should be detect it nd avoide it and the follow a same contiuos path)
i tried this program but it check obstacle in only corner site no in path so plz help me
The kiss of death for any posting title is to include the word “urgent”. Another significant negative is asking for help on homework.
With that said, what do you think your program does and what does it actually do?
If you were my student, you would get a failing grade on this program. There is not a single comment. How are we supposed to know how you connected the Arduino? What pins go to what devices? Also very poor choice of names. Subroutines should be given verb like names (TurnRight, stop, SelfDestruct) not something like ‘f’.
So document your program, think what your real questions are (rather than generic ‘help’), and try again.
I was less impressed by a lack of a good description of what the problem is.
Aside from trying to translate this;
it check obstacle in only corner site no in path
into English, it doesn't say what happened, what was expected to happen, what tests were done to figure out the problem. And as said above, the code is uncommented and leaves the casual reader guessing how it's supposed to work. For example I might guess that the turn() function does a 90 turn. OK but if that's the case then when it's called when distance <= 25 (I again have to guess this is the obstacle avoidance), I don't see code for a series of following turns to get back on the original path. Also it would seem to check for obstacles all the time, not just in the "corners" as indicated by the problem "description" above.
Very true, but reading this post certainly reminded me of that old chestnut.
This just reinforces the need to read the “how to ask a good question” FAQ (http://www.catb.org/~esr/faqs/smart-questions.html) to not fall victim of asking questions that violate the good manners of being a proper net citizen.
I also don’t get the difficulty… if he managed to do the first part of the project (going in a square), he should be able to do the second part. All the second part requires is programming another path, an ‘obstacle avoiding’ path to implement whenever the obstacle sensor goes off…