
kamaroman68

Is it possible to interact vocal commands into a running script? For example..... My robot at this point is only a lower half using serial commands for movement via script. The way it works is via timing that I have set up using the sleep command. However for whatever reason the robot does not always track the same way every time. This causes the robot to crash into things. This is still just a testing phase, there is no sensor feedback as I am awaiting my second ezb for that. I would like to be able to say "STOP" when it starts to track incorrectly and start heading towards a wall. My script for example is something llike this...
Sendserial(d0,38400,255)
Sendserial(d0,38400,127)
Sleep(3000)
Sendserial(do,38400,255)
Sendserial(d0,38400,10) - This line causes a differential in the tracks causing it to turn.
etc etc.
Now where would I insert the Stop command? Would it be after every sleep command so after every running portion of the script it would STOP upon command? So would I need to insert multiple STOP commands in the script. Thanks for the help, always appreciated.
Chris
So your voice command could be ... something like this...
"Stop Robot"
So the script behind that voice command would read...
SendSerial(D0,38400,0) #Stop your bot
ControlCommand("Whatever Script",PauseOn) #pause the running script
or
SendSeial(D0,38400,0)
ControlCommand("Whatever Script",Stop) #stop the running scrip
ControlCommand("Whatever Script", Resume) #resumes the previously paused script
Chris
In the voice recognition control:
Phrase........................Command
Stop | controlcommand("script manager", scriptstart, "emerg stop")
ControlCommand() with the ScriptStopAll command will stop all scripts within the specified script manager.
Neither will change a Forward() command to a Stop() command though,
Generally I always write an Emergency Stop script which basically sets all digital ports to low, fires off a Stop() command to the Movement Panel and releases all servos.
i.e.
Code:
With serial commands you would need to send the stop command via sendserial. Depending on the device will depend on the command.
Stop()
Sendserial (D0,38400,xxx)
SendSerial(D0,38400,xxx)
should do it?
Stop() # works with movement panel
SendSerial(D0,38400,0) # will stop both motors