kamaroman68
USA
Asked
— Edited
Hey guys I need a bit of assistance with this tiny part of a script.
IF ($Lelbowposition >68) And ($Relbowposition <1)
I want this to be known as "safe position"
So later in my larger script it will check arm" safe position "before moving forward.
Can I just use an equals sign at the end of the statement and call it " safe position"
Thanks Chris
Hey Chris - not sure I'm following you. Can you expand on this?
Also, might be a great idea to start with blockly. Follow some examples in the robot program to learn how comparisons work for IF conditions.
Hey DJ thanks for the reply. Everything Ive done is in scripting. Basically all I want is IF left elbow position is greater than 68 and left elbow is less than 1, I want to say arms are in a safe position in order to move.
so if left elbow position>68 and right elbow position <1 = safe position
Then I can use " safe position" = true to allow robot movement
how can a servo position be less than 1?
is this script to prevent the robot from physically moving if the arms are in the way?
Hi Chris,
How about this:
The "do something" is where you can put your command for movement or a Goto command to go to a movement section of your script. You can also place Say commands in each IF or ELSEIF section to have you robot tell you he's about to move or stopped because it's to dangerous to move.
Yes that is what im looking for. Thanks Dave! And yes Dj it is to prevent the robot from physically moving if the arms are in a unsafe position. I came up with something different but Dave your solution is a bit more elegant. Thanks
Ah I see. There's a movement script control. It will execute every time a Movement Panel is instructed to move. You can override it by checking that condition with the movement. Specify a Stop() in it if the condition is not met.
Here's the control: https://synthiam.com/Tutorials/Help.aspx?id=47