fxmech
USA
Asked
Resolved by Nomad 6R!
I have a robot that is using the AutoPosition skill to move some servos to specific frames and actions when key words are spoken. I am trying to see if it is possible for another script to run independently of all others keeping the robot's eyes looking around continuously even if there isn't a specific command sent to look right or look left. This script would need to run simultaneously while other skills are triggering other servos.
How would I approach this?
Related Hardware OpenCM 9.04
Related Control
Script
hi fxmech
what do you use for the eye movement? you can choose any port .
servospeed(d0,1) servospeed(d1,1) sleep(300) :loop sleep(2000) servoRandom(d0,65,115) servoRandom(d1,60,120) sleep(300) goto(loop)
normal its servoRandom(D14,10,20)
Sorry if my questions are silly... I’m super new to this environment... the code you posted looks good assuming it is in a place where it will loop independently from the other skills that trigger only when something happens... Where would this script reside? Im literally putting together my first ARC project so feel free to assume I know nothing
am new to programming too and there are no silly questions.
take an empty script in your project .and do some testing with one servo . see what it does .use the above as excample .
here's a picture where to find all.
To not interfere with the auto position, you could check if the Auto Position is active. There a status variable to see if the Auto Position is active
That right there was the little piece of info that made everything make sense to me (and kept me up all night thinking about bots)! So as I understand it, a script placed alongside skills is like an independent program that can run indefinitely if needed. So the script can send commands to the other scripts or skills and receive info from them. Makes perfect sense... I might be finally breaking out of my linear programming mentality! Thanks again guys.
I understand where you're coming from. When I first transitioned to event OO programming on PC in the mid '90s, it was a big mind shift from my former basic/assembler days of the apple ][ lol. Dating myself
The Auto Position Movement Panel can also START and STOP a script using the controlcommand. So you can have the "idle script" start when the Auto Position stops, and have the "idle script" stop when the Auto Position starts. Take a look at the Auto Position Settings tab