Asked
Is there a skill in Synthiam ARC to plot your D1 (X) and D2 (Y) locations on an X-Y map? I'm trying to simulate the locations by running the program without any actual motors connected. Sometimes I use equations to compute the locations, and I'd like to simulate it first with a skill to verify the positions before having the motors move around.
Related Hardware EZ-B v4
@athena
add print debugging to this script so he can see what the servo positions and calculated values are
Sure, I'll add print statements to the script so you can see the values of the servo positions and the calculated values. This will help you understand what's happening at each step.
Here's the updated script with debugging print statements:
How to Use the Script
What to Look For
By observing these values, you can understand how the positions are being calculated and plotted. If you notice any unexpected values, you can use this information to debug and adjust your code accordingly.
Feel free to run the script and let me know if you need any further assistance!
I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.
@Athena In the latest script aren't you just plotting the value of V26 and V26 one time. Can you add a feature where I can define how long that I would like it to run- example 30 seconds. Another feature that would be nice is to be able to insert a certain script and this Sketch pad script continues till that certain script is completed and then shuts off automatically.
Absolutely! I can add a feature to define how long the script should run and also allow it to run until a certain script is completed. Here's the updated script with these features:
How to Use the Script
runDuration
variable to the desired duration in milliseconds (e.g., 30000 for 30 seconds).Additional Feature: Run Until a Certain Script is Completed
$CertainScriptCompleted
variable. You can set this variable totrue
in your other script when it completes.Example of Setting
$CertainScriptCompleted
in Another ScriptBy using these features, you can control how long the script runs and also have it stop automatically when another script completes. Feel free to run the script and let me know if you need any further assistance!
I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.
@ Athena I'm pretty sure you cannot initialize a variable to be a negative number // Initialize previous positions var prevX = -1; var prevY = -1; I'm pretty sure this is not legal either return Math.floor((position - 1) * (32767 / 49999)); because what if it is position 1 then 1-1 =0 and there is no position 0. Please rewrite the script to be a legal script in the ARC scripting enviroment.
You might confuse her, and your questions are incorrect, making her code different from what you want.
the original script she posted loops forever, plotting until you press stop. That’s what you want. Now she made a bunch of stuff with timing for 30 seconds, which added complexity to a script that you can’t understand to begin with
the math that calculates zero is not about the servo position. It takes the servo position as an input and calculates it into a position to be plotted.
the damaging number assignment is to initialize a variable that keeps track of when a servo position changes
My recommendation is to focus on the outcome - which is a 2d plot of 2 servos. Don't add complexities such as timing because you can hit the start and stop buttons yourself. You are also reading her comments to understand what script has already been generated and what it does. The point of debugging is to explain the actual behavior you witnessed, not the thing you assume to be incorrect, without understanding the script. It's a good exercise, and one thing Athena could get better at would be asking questions to help walk you through the process.
Athena documented the script and explained everything. It’s a simple script that works well, and with debugging, I’m hoping it’ll help you follow what it looks like. Look at it again and see if you understand what it’s doing. Read her comments that explain what it’s doing.
@athena this uses the mapping function. i also notice that an image of 32000 pixels is too large for most computers. So the image is scaled to 2,000 pixel image.
Ok I'm backtracking, I copied and pasted the above script. Started my changing numbers script for V26 and V27. Started the above script. It mentions that the input string was not in correct format. Tried to turn it off, cannot do it and have to shut down Arc. This why I was asking for the time limit because I cannot turn it off. I am understanding what is happening with your code but there must be some small issue somewhere that is throwing it off.