Asked
— Edited
I'm going to make my rc car robot autonomous.
theres just one problem... It's an rc car! it has custom turn and drive scripts!
does anyone have an idea or example on how to make a script for radar? one that I can modify to accomidate my custom movements?
You can use ControlCommand to stop scripts, so use to to start, sleep for however long then stop script.
so like controlcommand("left", scriptstop)?
In EZ-Script on the right you can click on the tap for controls and it lists them all, click on the right one and it instantly pastes it in the script.
Depending on if it's a script on it's own or part of script manager will depend on the command. But the easiest way is to do as I described above.
heres the script updated.
is this good?
Upon a quick scan through that looks like it'll work.
One thing you could do though since your movement differs to the normal and you will have different factors which determine turning. How about adding in some code so left and right are based on previous travel direction?
For instance, if the car is moving forwards then a left turn would be forward and left or right would be forward and right. But, if the sensor reading is very close to an object then make it back up and turn a little, then forwards and turn.
Excuse the crude sketch but something like this...
ok so make it back up then turn if value is 220-255(very close)?
very close on a ping sensor is the lower end. so 1 to 15 or so... I think it measures inches but not 100% sure since I use IR (which are the other way around)
However, it should never get to a distance where it needs to back up since the further distance of forward turning will happen first, unless it turns into a wall. But you could have other variables and sensors etc. set up to have it decide what action to take.
ok. i'll look into it. will probably post it tomorrow. maybe tonight.