Asked — Edited
Resolved Resolved by Dunning-Kruger!

Waitforservomove And Servowait

I am looking for a way to wait for a servo to get to a certain point before continuing on with my script. I have tired both the waitforservomove and servo_wait. But I cant get the servo to move.

The script example is below:

Servo(d1,100) waitforservomove(d1,1000)

and I tried

servo(d1,100) Servo_wait(d1,higher,99)

I am trying to get my servo to 100, have the script wait for that to happen, then continue on.

Any thoughts?


ARC Pro

Upgrade to ARC Pro

Harnessing the power of ARC Pro, your robot can be more than just a simple automated machine.

#1  

Since regular servos do not provide actual feedback on their position, what you want to do will never work... You will need to either tap into a regular servo's pot to provide feedback (then read it on an analog port) on the servo's current position or use a smart servo like a dynamixel....

PRO
USA
#3  

Thanks Richard, appreciate it.

PRO
Synthiam
#4  

You can use the auto position. That's the best bet if you want to wait for a servo or servos to move into position. Use...


Waitfor($autopositionstatus = 0)

After yiur ControlCommand() that starts the action. The above command will wait until the Auto Position has competed.

#5  

So what, exactly are Waitforservomove And Servowait used for? Anyone have a working block of code that demonstrates their usefulness?

PRO
Synthiam
#6  

If you have a servo that will be controlled by a joystick or a camera or speech or anything, a script can wait until the servo moves before continuing. The purpose of the command is up to the requirement of the program. Programming commands are not created for purposes, they're created to provide a purpose:)

#7  

So why doesn't this work? Is it because while the servo knows where it is the software has no idea (unless you track it with an ext device from another port...)?

Servo( D1, 100 ) # tell the servo to go to a position (which it knows because of feedback from the pot :: 1-180) Servo_Wait( D1, EQUALS, 100 ) # wait until the servo gets there...

do the next stuff