
Jayutmb
So I have found some great help in learning from Rich and others who post script examples for us to learn from... However, I cant find a really good post with lots of examples as I learn best from this kind of thing... Anyone have a link to any threads that is filled with good examples to learn from ? ( i have read most of the popular tutorials..ect just looking for more of the hidden gems)
Upgrade to ARC Pro
Get access to the latest features and updates with ARC Early Access edition. You'll have everything that's needed to unleash your robot's potential!
Alan
So true, @Rich has some serious programing skills... sometimes the way he does things makes me feel embarrassed as my code is usually not as well "polished" as his...
Give me an idea of what you want to achieve and I'll knock up an example script with explanation of how to achieve it step by step (provided it's nothing too extravagant such as autonomous returning to a charging station or 3d mapping from the ping sensor and encoders or gps etc.)
1) How is the waypoint set?
2) How does the robot measure the distances and angles that it's moved?
Avoiding obstacles is easy with the native controls for the ping sensor or by using the ping roam script I wrote (and modifying it to suit your needs). But in order to script movement to a waypoint the above information is needed.
Unless you add in sensors the robot will no know where it is, where it's going or where it has been. Those sensors could be many different types and connect digitally/serially, by analogue or via I2C. To write a script, or even guide you on writing one, without this information is impossible without covering every combination of methods.
But if nothing exist, then what about using a Gyro/compass/accel to know where it is, and direction its heading, the encoders to track its movement? Complete newbie spit balling here. So for example, Move forward 50 feet, then it plots a course to that point, but works to avoid obstacles along the way. Think in terms of how the Mars rovers are controlled vs direct control over steering, since this is what i'm shooting for in the end.
In my perfect world, i could plot a course with APM, or similar, then the rover takes it from there.
http://ardupilot.com/
It would really just be a case of storing the current heading when an object is detected, the new heading when the avoidance script has run to point the robot in a clear path, the distance travelled off course and a little bit of simple geometry to calculate the current position.
Of course this is one of those "looks great on paper" ideas, and time will tell if it is feasible, but thats the plan.
This is intended to be an educational platform, so im avoiding a lot of nifty point and click options. Many different exercises being planned out, with this type of navigation being part of it.