
I have been trying to get this code to work,Code:
#Power Up
ControlCommand("Script Manager", ScriptStart, "Amp On")
Sleep(500)
ControlCommand("Auto Release", PauseOn)
Sleep(2000)
ControlCommand("Auto Position 3", AutoPositionFrame, "Tilt Straight",100,7,4)
sleep(5000)
ControlCommand("Auto Position", AutoPositionFrame, "Rest",25,10,5)
Sleep(5000)
Sayezbwait("i am ready")
ControlCommand("Script Manager", ScriptStop, "LowPowerMonitoring")
sleep(500)
ControlCommand("Camera", CameraStart)
Sleep(500)
ControlCommand("Script Manager", ScriptStart, "Monitor")
The problem is the Auto PositionFrame "Rest" will not run,however, if I run the the code again, it will. I've played with various sleep duration's between lines in the code. I'm stumped ! Anyone got any ideas?
its difficult to diagnose without seeing the project. There could be commands delayed from the other scripts that are being called which interfere with the servos being used in the Rest frame.
Like DJ says, it is very hard to diagnose the issue without knowing what else may be running in conjunction with this script.
if the auto positioner displays the "rest" in the log, that means it is executing that frame. So, if you see "rest" in the status log and you believe it is not running, something else is having it stop or it's already in position. Post your project and I'll look.
Code:
Basically what i'm doing is - This script powers down the robot, the previous script powers it up.
Rather than using Auto Release control because there are so many synchronous things happening at once, use the Release() command in EZ-Script for the servos that you wish to release.
They do not need to be released during startup, which is also what's happening. They only need to be released during shutdown script.
1) remove the Auto Release control
2) remove Auto Release control references from startup script
3) add Release() commands to shut down script
Code:
to the end of the power down script and that shuts everything, just what I want.
Now when I run the Power Up script, the auto positions "Rest" and "Tilt Straight" run but the servos don't move.
When the servos are in the same position and the release is called, the servos do not go back into the same position due to locking into pwm timing. The latest software release should compensate for that.