Award
Congratulations Steve S, for answering the question and has received an EZ-Credit award! Share what you have learned and create a tutorial to help others by clicking here.

Roomba 400 Series Scripting Commands , Verbage To Use

Assistance Requested

Help jstarne1 with their question and receive $10 of EZ-Credit to get more robots and parts from our store. The following information was provided about their previous efforts searching tutorials for a resolution.

jstarne1 claims to have checked these sources:
 
#1

I have has excellent success in this hack thanks to EZ- Robot and now I need a little assistance. The Movement Panel works great, but ultimately it must be a autonomous script. I need to know what verbage / language to use when scripting. I will give example of some things that must happen.

To Dock -

INIT ( initialize)
Select Clean
Select Seek Dock

To undock itself-

Select Disable sensors
Select INIT (initialize)
Select Disable Sensors ( agian)
Drive in Reverse

Can anyone write an acceptable example for each of these to try. I will research it in the meantime but combining talents makes things so much quicker. Smile

EDIT: I found this as well, now I just need help putting it all together

Roomba( cmd )
Execute the specified command on a connected Roomba Vacuum on Port D0 and EZ-B 0. Look for the available Roomba commands further below in this document.
You may also add the Roomba Movement Panel for graphical controls.
Example: Roomba(init)
Example: Roomba(SideBrushOn)

I have found a few conversations, tutorials and activities that may help with your question. Take a look at these links. I've sorted them by what I believe to be most relevant but that is not always the case as I'm still learning.


Also, consider reviewing the Learn section for informative lessons and activities. Check it out!


#2

Here is what I could find looking through the SCRIPT " ?" , I just dont know how they are to be written to work.

Roomba Commands-
Init
EnableSensors
DisableSensors
PowerOff
SpotClean
Clean
MaxClean
DisableAllBrushes
MainBrushOn
MainBrushOff
SideBrushOn
SideBrushOff
VacuumOn
VacuumOff
SeekDockingStation

#3

Would it be? -

Return to base from sitting-

Roomba(Init)
Roomba(Clean)
Roomba(Seekdockingstation)

Do I need to enter a wait timer between or is this fine?

Remove from base-

Roomba(disablesensors)
Roomba(Init)
Roomba(Reverse)

#4

I think you're going to have to send serial strings to the D0 port with the Roomba Open Interface commands that will place the robot into the different modes like "clean", "seek dock".

Do an internet search for this document: iRobot® Roomba® Serial Command Interface (SCI) Specification

That document contains all the commands that can be sent to your Roomba.

The script commands will look something like this to start

Code:


1 # This command starts the SCI and must be sent
2 # before any other command
3
4 SendSerial(d0,57600,128)
5
6 # This command places the Roomba in the Clean mode
7
8 SendSerial(d0,57600,135)
9
10# This commands tell the Roomba to look for the Dock
11
12 SendSerial(d0,57600,143)

#5

Josh,
Here are some scripts I currently use on my Robot with ICreate platform with voice commands.
I use the script below in connection script, beep allows me to know Create is init. You must use the "" now in all the commands.
Roomba("init"Winky
#Beep
SendSerial(D0,57600,140,3,1,90,32,141,3)

My robot is somewhat tall, the command below reduces rocking.
# Forward slow Command
SendSerial(D0,57600,137,0,100,128,0)
sleep(500)
#forward
SendSerial(d0,57600,137,0,180,128,0)
sleep(2000)
# Forward slow Command
SendSerial(D0,57600,137,0,100,128,0)
sleep(500)
#stop
SendSerial(D0,57600,137,0,0,0,0)

#REVERSE
SendSerial(D0,57600,137,255,56,128,0)
sleep(2000)
#stop
SendSerial(D0,57600,137,0,0,0,0)

Roomba Commands
. Init
. EnableSensors
. DisableSensors
. PowerOff
. SpotClean
. Clean
. MaxClean
. DisableAllBrushes
. MainBrushOn
. MainBrushOff
. SideBrushOn
. SideBrushOff
. VacuumOn
. VacuumOff
SeekDockingStation
I cannot test the docking for you, because my docking station is broken.
There are other usefull scripts by RobMcc and Doug Pope.
Good Luck,
Steve S
Edit- I don,t know why the smilling face shows above with the
Roomba("init"Winky

#6

Josh,
Did any of the script suggestions help you?
You can change the script arrangements and sleep times to fit your wishes.
Don,t forget the " " around Roomba commands. Example Roomba("SeekDockingStation"Winky
Steve S

#7

@ Steve. I have not been home yet to try some example scripts , I will try tonight I believe. I appreciate the help. Whatever I test I will post the result back up.

#8

Josh,
The script for turning right is, sleep value gives my Robot about a 90 degree turn. You can adjust.
#Right
SendSerial(D0,57600,137,0,100,255,255)
Sleep(3000)
SendSerial(D0,57600,137,0,0,0,0)

#Left
SendSerial(D0,57600,137,0,100,0,1)
sleep(3000)
SendSerial(D0,57600,137,0,0,0,0)

Steve S

#9

@Steve S, Jstarne1 Josh, be sure to get a copy of Serial Command Interface (SCI) Specification for Roomba... I do it the way Steve S does it, just not on the EZB (since I don't have one yet).... It works well on the AtomPro, so it will work on the EZB (as Steve can attest to)...

#10

Just a quick note on the Roomba commands, they need to be enclosed within quotes to meet EZ-Script syntax.

I.E.

Code:


Roomba("disablesensors")
Roomba("Init")
Roomba("Reverse")



That's provided those commands are correct, I've not got a roomba to play with so have never used the commands.

The newest update (today) should now include the roomba and robosapien commands in the Cheat Sheet "click & paste" section of EZ-Script.