Make an ARC Skill

Example: Custom Movement Panel

The ARC software uses controls that register themselves as a movement panel. This allows your plugin to listen to movement requests from other controls. When any control or EZ-Script calls for a movement direction (i.e. Forward, Left, Stop, etc), your plugin can be responsible for moving the robot. There can only be one Movement Panel per robot project. This is because there is only one method of locomotion for a robot, which this Movement Panel would be responsible for.

To understand more about how Movement Panels work in EZ-Builder, read this tutorial.

What's In A Movement Panel? A Movement Panel will have buttons that lets the user specify directions that the robot should move. Your Movement Panel will be responsible for the robot moving. This means that anywhere a direction is specified, your control will be responsible for moving the robot. Generally a Movement Panel has speed controls in the form of trackbars of some sort.

Code Example Want to make your own movement panel? Here is an example of how to implement code which will respond to movement requests:


public FormMain()
  : base() {

  InitializeComponent();

  // Assign this control as a  Movement Panel so the software knows who owns the movements
  EZ_Builder.FormMain.MovementPanel = this;

  // Assign the movement locomotion style for this control.
  // There are different kind of locomotion for your robot, and this helps other
  // controls know what to expect when a movement is happening.
  // Check out the ENUM to see what other locomotion styles there are that
  // fits your  Movement Panel type.
  EZBManager.MovementManager.LocomotionStyle = LocomotionStyleEnum.GAIT;

  // assign the movement event
  // this event is raised when another ARC  control requests movement
  EZBManager.MovementManager.OnMovement2 += Movement_OnMovement2;

  // assign the speed change event
  // this event is raised when another control or user changes the speed
  EZBManager.MovementManager.OnSpeedChanged += Movement_OnSpeedChanged;
}

private void FormModifiedServoMovementPanel_FormClosing(object sender, FormClosingEventArgs e) {

  // Remove this control as a  Movement Panel 
  EZ_Builder.FormMain.MovementPanel = null;

  EZBManager.MovementManager.OnSpeedChanged -= Movement_OnSpeedChanged;

  EZBManager.MovementManager.OnMovement2 -= Movement_OnMovement2;
}

private void Movement_OnSpeedChanged(int speedLeft, int speedRight) {

  // do something with the speed change
}

private void Movement_OnMovement2(MovementManager.MovementDirectionEnum direction, byte speedLeft, byte speedRight) {

  // **
  // do something based on the speed  
  // handle speed change here
  // **

  // Now do something based on the new movement direction

  if (direction == MovementManager.MovementDirectionEnum.Forward) {

    // handle custom Forward movement

  } else if (direction == MovementManager.MovementDirectionEnum.Reverse) {

    // handle custom Reverse movement

  } else if (direction == MovementManager.MovementDirectionEnum.Right) {

    // handle custom Right movement

  } else if (direction == MovementManager.MovementDirectionEnum.Left) {

    // handle custom Left movement

  } else if (direction == MovementManager.MovementDirectionEnum.Stop) {

    // handle custom Stop movement

  }
}


ARC Pro

Upgrade to ARC Pro

Get access to the latest features and updates before they're released. You'll have everything that's needed to unleash your robot's potential!

#17  

The error cannot read the COM file, I downloaded it and when I follow the instructions, I get an error, while other files read normally. .

User-inserted image

#18   — Edited

sorry for me but i tried many different ways but still show the error,I couldn't find EZ_B.dll file even though I downloaded it

PRO
Synthiam
#19  

None of the required references are in your list. Please follow the tutorial. It explains exactly how to click the browse button and navigate to the folder and select the files.

#20  

Sorry, but the reason I can't reference is because there is no file in the EZ_B folder and there is an error : this folder is empty , I am trying to solve it. I would like to thank DJ sure for answering my superfluous questions and I'm sorry for bothering you

Australia
#21   — Edited

I need to playback 5 Serial Bus servos in sequence.

PRO
Synthiam
#22   — Edited

What protocol is it? A "serial bus" is a generic term for anything using a UART that's chained together sharing the same RX line. Also, why did you add a photo with the question text added in your response?

Are you planning on making a skill control to do this? You wrote the question in the skill control thread in a comment - I'd like to make sure your question is in the right place to help you out.

To begin, I would recommend starting with servo Script control so you can make the serial bus protocol work - then consider making a skill control only if you're planning on distributing the effort to others: https://synthiam.com/Products/Controls/Scripting/Servo-Script-19068

#23  

He seems rather demanding as well.  I guess he needs the benefit of the doubt as English may not be his native language....

#24   — Edited

I have installed all the software dependencies and still ARC does not detect that I have Visual Studio installed. OS is Windows 10, .NET 4.8 or newer, Visual Studio Community 2019.