All Tutorials / DJ Sures / How To Make An EZ-Builder Plugin

How To Make An EZ-Builder Plugin

Code: Moving Robot

If your plugin is to make a robot move, it doesn't need to know anything about the robot.

EZ-Builder has a concept of “Movement Panels”. Users can only add one Movement Panel per project, and this is how their robot moves. When a Movement Panel is added to a project, it binds itself to a common class that is exposed to the plugin system. This allows your program to easily tell the robot to move forward, left, right, stop, etc. regardless of the Movement Panel the user has added. This means if the robot is a humanoid, it will walk forward using the project's own method of walking. If the project is a hexapod, it will do the same. If the robot is a drone, it will also do the same. So for your plugin, it doesn’t matter what kind of robot it is – you simply tell it to move a direction. And here’s a few examples...

Code:


EZ_Builder.EZBManager.EZBs[0].Movement.GoForward();
EZ_Builder.EZBManager.EZBs[0].Movement.GoReverse();
EZ_Builder.EZBManager.EZBs[0].Movement.GoRight();
EZ_Builder.EZBManager.EZBs[0].Movement.GoRollLeft();
EZ_Builder.EZBManager.EZBs[0].Movement.GoUp();

Etc...



Within that Movement class, there are methods for moving in all directions. Up, Down, Left, Right, Stop, etc.. Not all Movement Panels will support Up, Down, RollLeft, RollRight as those are generally reserved for used with flying drone robots - but you get the point Smile

Note: It is important to note that all native EZ-Builder Movement Panels use EZB[0], as it is standard practice to put the movement servos/hbridges on the first EZB when designing a robot.