The easiest way to program the most powerful robots.
Use technologies by leading industry experts.
ARC is a free-to-use robot programming software that makes servo automation, computer vision, autonomous navigation, and artificial intelligence easy.
yeah, the link for your project works fine. I had a quick look through it and can't see what is causing the issue I'm afraid. Hopefully someone else will be able to figure it out for you.
I think that the stand up sequence is running and then evaluating the gyro before the robot has a chance to get to a point that the gyro is in a standing position. I would add more time to the sleep command at the bottom. You might take it up to 10000 and see if that is the issue. If so, you could start reducing this down to however long it takes.
You would think that the line waiting for the auto positioner running to be false would prevent this from happening but, give it a shot. If that "Fixes" the issue, we will have a better idea of how to completely fix the issue.
Yea, I expected it to delay the standup time, but it answers that the script must be being called 2 times from somewhere. I don't have one of these sensors so I don't have a way to test. I think DJ is going to be your best help unless others have one and a JD that they can test with.
Use this code and then post the output in the little black window under the script back to this thread. Make sure to get all of it which might require that you scroll up a bit.
Code:
ControlCommand("MPU9150", Init)
sleep(100)
:loop #Added these because $AccelX and $AccelY were not recognized print("Start of loop") $XAccel = $AccelX $YAccel = $AccelY
The issue was with having to specify other variables and not updating these variables in the script. Nomad, please post the working script and have a great day!
Show us the script you're using.
its says run once
hope this works
yeah, the link for your project works fine. I had a quick look through it and can't see what is causing the issue I'm afraid. Hopefully someone else will be able to figure it out for you.
I think that the stand up sequence is running and then evaluating the gyro before the robot has a chance to get to a point that the gyro is in a standing position. I would add more time to the sleep command at the bottom. You might take it up to 10000 and see if that is the issue. If so, you could start reducing this down to however long it takes.
You would think that the line waiting for the auto positioner running to be false would prevent this from happening but, give it a shot. If that "Fixes" the issue, we will have a better idea of how to completely fix the issue.
also you have the effect that jd will lie down for long time .
before getting up.
Code:
#autopositionstatus = ""
ControlCommand("MPU9150", Init)
sleep(100)
:loop
$YACCEL = $ACCELY
$XACCEL = $ACCELX
if($autopositionstatus=true)
print("autopositioner alredy running")
sleep(1000)
goto(loop)
endif
ControlCommand("MPU9150", RunOnce)
print("x8:" + $XACCEL)
print("y8:" + $YACCEL)
if($YACCEL > 8000)
print ("GETTING UP FROM FRONT")
controlcommand("auto position",autopositionaction,"getup")
waitfor($autopositionstatus=false)
elseif($YACCEL <-8000)
print("getting up from rear")
ControlCommand("Auto Position", AutoPositionAction, "stand from sit")
waitfor($autopositionstatus=false)
endif
sleep(1000)
goto(loop)
Start of loop
y = (something here)
x = (Something here)
Getting up from rear
end of loop restarting
This will be in the little black box at the bottom of the script window.
Also, get the code I sent a couple of posts ago. It has a couple of more things that might solve or point to the problem.
sleep(100)
:loop
#Added these because $AccelX and $AccelY were not recognized
print("Start of loop")
$XAccel = $AccelX
$YAccel = $AccelY
if ($AutoPositionStatus = true)
print("AutoPositioner already running...")
sleep(2000)
goto(loop)
endif
ControlCommand("MPU9150", RunOnce)
$XAccel = $AccelX
$YAccel = $AccelY
print ("x: " + $XAccel)
print ("y: " + $YAccel)
if ($YAccel > 8000)
print("Getting up from front")
ControlCommand("Auto Position", AutoPositionAction, "Getup")
waitfor($AutoPositionStatus = false)
$XAccel = $AccelX
$YAccel = $AccelY
print ("x: " + $XAccel)
print ("y: " + $YAccel)
ELSEif ($YAccel < -8000)
print("Getting up from rear")
ControlCommand("Auto Position", AutoPositionAction, "stand from sit")
waitfor($AutoPositionStatus = false)
$XAccel = $AccelX
$YAccel = $AccelY
print ("x: " + $XAccel)
print ("y: " + $YAccel)
endif
sleep(500)
$XAccel = $AccelX
$YAccel = $AccelY
print("End of loop...Restarting")
goto(loop)
thank you d.cohran
thats two jd's getting up now.d.cohran is good programmer.