Asked — Edited
Resolved Resolved by Rich!

Skipping Lines?

hello, i have been working to create a more complicated demo and am having some issues with it skipping between lines, i have found it will go from the middle of one action the the next, currently by adding sleep marks i have corrected many of these issues but i just wanted to make sure that the problem is in my inexperience programing for this robot and not a bug, i have uploaded the configuration file to the public site by accident and the demo2 script in there is what i am having issues with. also if you could take it down off the public site as it seems to have to many issues for now, i will upload it to the public site once i get the bugs all worked out

Thank you Richard


ARC Pro

Upgrade to ARC Pro

Get access to the latest features and updates before they're released. You'll have everything that's needed to unleash your robot's potential!

United Kingdom
#1  

It's a little unclear what you mean. Scripts will not skip lines unless they are surrounded by an If and the statement is not true.

However, if you are using the script to trigger the Auto Position actions (I presumed by actions this is what you meant) then the script is most likely acting as it should. You will need to include Sleep commands between changing actions as the script will continue running regardless of what the action is doing unless you have added a ControlCommand to the action to pause the script which triggered it.

The script I wrote for Six dancing used sleep commands to sync the moves with the music.

#2  

cool thanks thats another question i was looking into, i will check out your script so that i have a head start when i try that.

i have been using sleep commands tho and adding time but that doesn't seem to be enough to cover all the issues im having

the project is public under humanoid robot and its called "richard advanced robot" but you will need to update all the sleep times to min 6000 and that fixes most the bugs but when you get to the push up example it goes from in the middle of the pushups to trying to do sit ups without standing up

i created the script by copying and pasting parts of the original demo to prevent errors and just changed what was done and said and the sleep timers so i think i have covered that but im still new and unsure

United Kingdom
#3  

It'll be a case of trial and error to be honest. Unless you spend the time to run every action and record how long they take to be completed.

PRO
Synthiam
#5  

Our compiler does not "Skip lines" - if it did, NASA would not be using our product:)

If your Auto Position Action does not "repeat for ever" , than simply do this instead with WaitFor()...


ControlCommand("Auto Position", AutoPositionAction, "Wave")

# pause for a short period of time to ensure the action is running before we check
Sleep(500)

# now wait for the action status to change from a 1 to a 0 (true to false) 
WaitFor($AutoPositionStatus = 0)

ControlCommand("Auto Position", AutoPositionAction, "Attack")

# pause for a short period of time to ensure the action is running before we check
Sleep(500)

# now wait for the action status to change from a 1 to a 0 (true to false) 
WaitForChange($AutoPositionStatus = 0)

sayezb("Done")

The variable $AutoPositionStatus stores the active status of the Auto Position. The WaitFor() will wait for ever until the provide expression is true.

#6  

D.J., Please tell us more about N.A.S.A.

United Kingdom
#7  

A variable I wasn't aware of, just out of interest how long has $AutoPositionStatus been there?

Yes that makes it much easier:)

PRO
Synthiam
#8  

It's been there since the release of the Auto Position 2 years ago:)

Much like the Camera Control, Joystick, WiiMote, and a few other controls.. you can see which variables are used in their respective CONFIG menu