Asked — Edited

Help Me With Security Guard Script Please

: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()

ARC Pro

Upgrade to ARC Pro

Unleash your robot's full potential with the cutting-edge features and intuitive programming offered by Synthiam ARC Pro.

#1  

oh, sorry. This is the Security Guard script. I have two sonars. A horizontal and a Vertical Sonar. I have two IR units. Both Sharp IR.

Any comments welcome.

Australia
#2  

I would love to have a sentry like your setting up and wish I could help MovieMaker but I have no idea on how these script things work except at a basic level. This is where I thought EZ-ROBOTS could help us with cloud examples - unfortunately - no change tired tired sleep

PRO
Synthiam
#3  

I'll help you understand what's wrong with the script... Write in point form what you think each line does.

#4  

Thanks, D.J.

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.

PRO
Synthiam
#5  

Programs read from top to bottom like a book. Each command is executed and the next command is not executed until the previous command finishes.

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.........

#6  

I appreciate it. What I am trying to do is all four at once. I don't know how to word it. I need when it is running here and there to stop and not run into things. That is what I was trying for in the little center part. Get the ping information, all of it. If the horizontal ping doesn't see it, I need the vertical one to see it. If the sonic doesn't see it, I need the IR to see it. Most of the robot is complete except it was sometimes sounding the alarm correctly and then it did it over and over and over and my wife threatened to kick me out of my own apartment. I guess when I try again, I'll have to lower the volume.

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

#7  

poor guy is trying,hope you can fix it MEL dont give up,scripts are little hard 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

#8  

Fred,

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?