
MovieMaker
:start
stop()
:test
#See if someone comes too close to it
GetPing( d18, d17)
GetPing( d9, d8 )
Ping_wait(d18,d17,LOWER,20)
Ping_wait(d9,d8,LOWER,20)
if (ADC(ADC1 < 120)
sleep(500)
if (ADC(ADC2 < 120)
sleep(500)
goto (alarm)
goto(test)
:alarm
ControlCommand("Soundboard",Track_10)
goto(start)
#If speech recognition hears "Halt!"
say ("Exit ting Security Mode!")
halt()
RETURN()
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!
Any comments welcome.
ok,
:start ; #this is the start of the program
stop();# I stop the robot while I am making measurements
#It is to become a Security Guard simply TESTing the environment and Alarming if anything
#gets too close. I have two IRs and two sonars watching both vert and horz.
:test ; #this is a label to start the test
#See if someone comes too close to it ;this is a remark
GetPing( d18, d17) ;#i am getting the echo information from the Ping no. 1 Horizontal
GetPing( d9, d8 ) ;#here I am getting information from the Ping no. 2 Vertical Ping
Ping_wait(d18,d17,LOWER,20) # here I am waiting for a value of the ping to get lower than 20
Ping_wait(d9,d8,LOWER,20) # here the same on ping number 2, lower than 20
if (ADC(ADC1 < 120) ;#here I am checking sharp IR unit for a value under 120 on Horizontal IR
sleep(500) #here I am waiting a half of a second
if (ADC(ADC2 < 120) ;#same as above but Vertical IR
sleep(500) ;#rest for a half of a second
#If anyone gets too close I sound the Alarm, if not I test again.
goto (alarm) ;#sound the alarm
goto(test) ;# go back and test everything again
:alarm ;#another label name
ControlCommand("Soundboard",Track_10) ;#this actually plays the Alarm noise
goto(start) ;#got back and do everything from the start
#If speech recognition hears "Halt!"
say ("Exit ting Security Mode!") ;#let everyone know we are through with this script
halt() ;halt this script
RETURN(); # go back where it was called from.
#Needs to goto speech recognition and wait for command.
#I planned to use the little subroutine for antonymous navigating.
do I need two more RETURNS in there? I mean do I have to have a return for every goto?
I know that it is hard to believe, but in my prime, I have written some vertical markets and was a good programmer. I programmed in BASIC and DBASE and some c. But, that was a long time ago when my brain actually worked.
For example, the two ping_wait() commands. If I asked you to wait for something, you'd wait, right? Look at them a bit closer. You're waiting for two things in an order. Is that what you expect?
Also, getping()? What are you getting it for an where are you assigning it?
I may eventually rewrite it for you, but not until you try longer
You can give a man a fish and he'll eat for a day. Teach a man to fish, and.........
So, before I did the antonymous navigating, I thought i would start with a simple Security guard program. Everything is tied to the speech recognition. It is always on and listening. So, after it complete one assignment it needs to go back and listen. I also have a master program trying to call the different modes.
I am getting a ping value. and I don't know where it is going. I figured once I pinged it it would be where it needed to be in order to test it. Also, I am running get the value,ping wait,ping radar , and all of the ping stuff. Maybe I only need part of it running.
I have:
Master:
init
Security Mode
Chat Mode (this gets all of the rss, and things like that from speech rec.)
Find the Red Ball Mode
Operate the Hand Mode
Are you saying that I should be using the Ping_Wait OR the get_Ping instead of both? But the question would be HOW are the other units going to be read in time to stop a collision?
sorry for being so dense.
anyway, that is an overview what I am trying to accomplish. I will continue my work.
Thanks,
Mel
sometimes to takes about 4 or 5 times to get it right,then soon other scripts will be much easy to do
JUST DONT GIVE UP
I will not give up on this one. I gave up on the turtle-bot. But, I am still planning to tackle ROS. I have to have ROS for QBO.
Thanks for the Moral support. While I have you, what do you think about NAO?
Click File->Examples and load the Example - Script - Security Guard
Lets make sure that we all help each other as much as possible with any issues we have with scripts - for the uninitiated they can be damn daunting (like myself)
Oh and for the record - the best robot in a movie was in Rocky IV -Pauli's advances were a little worrying though!
I USED to be a good programmer back in the DOS days. I programmed in Basic. The way I learned to program was to read three books. The first one I forget the title was like Beginning Basic. But, the second two I will NEVER forget. One was called BASIC BASIC, The other was called ADVANCED BASIC. Each book had over a hundred programs listed in a readable format. I had all of that in the palm of my hand. I started off slow like "hello world." By the time I finished I was writing short useful programs. Then, I owned a computer store for 12.5 years. I was an authorized Peach-Tree Dealer. Software would come in on a regular basis not working. So, I had to correct it. Sometimes, I called the factory, but mostly by then, I could correct it myself. Then I started Customizing software for my customers. When Wayne Ratlif came out with Vulcan database it was Heaven. I started to program in DbaseII, and III. That is when Aston Tate bought out Vulcan and changed it's name to Dbase. I had all of the knowledge and was so good at it. But, that was about 35 years ago and one forgets. I am hoping to get back into programming. I just need a few good books. I did good with c for the arduino. But, like you said that is Mickey-Mouse compared to the EZB.
If I do succeed in all of this, it will be because of D.J. and the Wonderful People of this forum that gave me moral support.
God Bless All of you.
Mel
Thank You soooooo much. It is Perfect!!!!!!!!
I will use those subroutines to do many more projects.
Mel
.
thanks for the kind words.