United Kingdom
Asked — Edited

Ping Roam 1.2.0 (In Progress)

I guess this could be classed as a blog type of topic. The idea is to show some insight in to how I work, how I go about updating the scripts etc.

I decided to totally scrap everything I had done on Ping Roam 1.2.0 a couple of days ago when the ControlCommand ScriptStartWait was brought to my attention. I wanted to use this, I knew it could be a better way of doing the whole Ping Roam script so out went what was done (despite it being around 98% complete).

So, since I was starting again on 1.2.0 the best thing to do was to print out all 10 pages (510 lines) of Ping Roam script and start to make some notes (this was while fighting the flu and spending any moment not at work in bed).

A couple of days later I ended up with a bunch of paper which looked exactly like this;

User-inserted image

User-inserted image

User-inserted image

User-inserted image

User-inserted image

User-inserted image

User-inserted image

User-inserted image

User-inserted image

User-inserted image

Now it's ready to start plugging in to ARC in it's new, modular, individual scripts. What better control for that than the Script Manager, aptly renamed as PingRoam

User-inserted image

Next post I will be posting up all of the sub routine scripts in their current state (untested) along with notes etc.

Hopefully this (and future posts) will help you understand how I tackle the process of turning ideas into reality and take an old script and add in new functions, refine it and make it run better. If not then it's at least a record for me:D


ARC Pro

Upgrade to ARC Pro

ARC Pro is your gateway to a community of like-minded robot enthusiasts and professionals, all united by a passion for advanced robot programming.

United Kingdom
#9  

Still need to find a suitable test platform. The code is all written but I've not had chance to run any tests.

I may use Jarvis' base and do some quick tests but he is too big, I need something small so I can test come complex navigation in like a maze of sorts. (my house is far too open and straight, I need lots of small corners etc. to really test the smart turning and boxed in).

United Kingdom
#11  

Due to life I'm kinda running behind with a lot of things to do with my robots and scripts so I've decided to throw this up as an Alpha release. What this means is I have not actually tried to run the code on a physical robot (since I don't have a suitable robot platform yet - ordered one today which should be here this week though).

The changes for Version 1.2.0 are;

  1. Changed escape return to use else therefore avoiding reversing and turning after an escape.
  2. Added in stop and sleep before any forward or reverse movements.
  3. Added emergency stop script.
  4. All ports are now constants, use ports specified in the head of the code or port summary or adjust the code to suit your ports.
  5. Smart turning for avoidance. Robot only turns the amount it needs to in order to miss the obstruction.
  6. Rewritten in Script Manager named PingRoam with Control Commands and ScriptStartWait.
  7. Removed all instances of Halt() (there was a compatibility issue previously however they are redundant anyway.

The (attempted) improvements;

  1. Better, smart turning which should remove the requirement for any boxed in or escape code. The robot will turn until the path is clear rather than turning for a fixed amount as previously written. This should also avoid constant "bumping" in to the same wall.
  2. Script manager used with ScriptStartWait to separate the different portions of the code for easier alterations and improvements in the future.

The project; Download it from the EZ-Cloud or click here

How to use You can either merge the project with your own and import the Ping Roam Script Manager (check each script for required ports for Ping Sensor, servo etc)

User-inserted image

Or you can open the project and build yours around it, or just try it unaltered.

Please, if you choose to try it out, let me know any feedback, comments, bugs, problems etc.

I should be testing it on a physical robot just as soon as I build one suitable:)

Full explanation of the code, walking through each step of how it was written, what it does, why it's there etc. will also be coming as a tutorial on EZ-Script in the near future.

And finally, please feel free to adapt the scripts however you wish. All I ask is that you share it if you make something awesome and give credit where it's due if you make something that earns you fame and fortune:D

United Kingdom
#12  

Update for today...

My small 4wd robot platform turned up yesterday so I immediately built it. It's nothing special, just a Dagu 4wd plastic thingy...

User-inserted image

However, the problem was, I was running it on a 2S LiPo (fully charged) and let's just say it went from one end of my house to the other end of my road in around 3 seconds!.. It's faster than my Audi S5!.. Well, nearly... Suffice to say, it couldn't react fast enough to avoid anything so I ended up with a slightly damaged skirting board and had to put the bluetooth module back in the header.

I just found out the recommended voltage for the motors is 3v, so that's the problem, I was feeding them with around 8v:D So I guess some regulation of the voltage or using PWM to restrict the speed is required before I can test this again but it's certainly progressing again.

Hopefully I'll have time tonight to play again and give it a good test though:)

#13  

Tested this tonight works awesome. Running 1 ping sensor does a really good job of avoiding for the most part. There was a few times he boxed himself in and couldn't get out. Other times he would get boxed in and make his way out . Going to keep playing with it

United Kingdom
#14  

Awesome:) It's great to see the new turning script looks like it works for the most part, I assume the times he was boxed in could be down to the sensor but we will see - I have a plan for that (although it may be at the cost of a slower response).

I'm back home now although it's 3am but tomorrow (which is technically today) I'll hopefully have chance to have a play with the rover and get it working at a suitable speed for testing and refining.