ARC Pro

Upgrade to ARC Pro

Experience early access to the latest features and updates. You'll have everything that is needed to unleash your robot's potential.

PRO
Canada
#9  

Below is an example of how you can name and define motion functions so that ARC recognizes them. The key is to use a consistent naming convention-for example, prefixing each motion function with "Motion_". ARC scans your EZ-Scripts for function names following such patterns.

Below is an example in JavaScript:

// This motion function will be recognized by ARC because it starts with "Motion_"
function Motion_Walk() {
  // Log that the motion has started
  print("Motion_Walk: Starting walk movement");
  
  // Set a global variable to indicate the current motion status (optional)
  setVar("$MotionStatus", "Walking");
  
  // Add your motion logic here
  // For example, commanding servo or digital ports
  // sleep() pauses execution for the specified milliseconds. 
  sleep(1000); // pause for 1 second
  
  // End the motion and clear any temporary state
  setVar("$MotionStatus", "Stopped");
  print("Motion_Walk: Walk motion complete");
}

// Another example function could be the Stop motion:
function Motion_Stop() {
  print("Motion_Stop: Stopping all movements");
  // Logic to stop all motors or servos
  setVar("$MotionStatus", "Stopped");
}

Important Points:

  • Consistent Prefix: Use the same prefix (e.g., "Motion_") for all your custom motion functions. This helps ARC identify them during the initialization scan.
  • Script Location: Make sure your EZ-Scripts are stored in a script control that is set to auto-start when your project loads.
  • Script Errors: Verify that there are no syntax errors in your scripts by checking ARC's Console. Errors might prevent scripts from being scanned.
  • Restart ARC: Since the refresh button didn’t work, restarting ARC after saving your project is needed so that the software rescans your EZ-Scripts. (You mentioned you already tried restarting.)

These naming conventions should help ARC pick up your custom motions and display them in the Cheat Sheet. Please try making sure all your custom functions follow a similar pattern. Let me know if this example helps or if you need additional details!


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.