EZ-B v4 & IoTiny

Movement Panels

One of the powerful features of EZ-Builder is the concept of Movement Panels. A Movement Panel is a control which is responsible for how your robot moves in directions (forward, left, right, stop, reverse, etc.). The power of a movement panel is how it integrates with the EZ-Builder environment and allows other controls or EZ-Script to easily instruct the robot to move any direction. When a movement panel is added to your project, it registers itself as the responsible control for directional movements. EZ-Builder has many movement panels, for example there are HBridges, Continuous Rotation Servos, Auto Position GAITs and even AR Parrot Drones or iRobot Roombas.

*Note: A maximum of one movement panel may be added to a project AND the movement panel must be on the first ezb (connection 0). See the end of this lesson for links to available Movement Panel types and popular controls utilizing Movement Panel commands within EZ-Builder.

When a movement panel is added to your project, other controls will know how to instruct the robot to move.

Move Robot

EZ-Script

When a Movement Panel is added and configured in your project, there are documented EZ-Script commands which will instruct the movement panel to begin moving the robot. It is recommended to reference the EZ-Script manual in EZ-Builder, as it will be updated more often than this documentation. Some of these commands are...

Forward( [speed], [milliSeconds] )
Using a Movement Panel Control, this will start your robot in the Forward direction. 
Optionally, you can provide the speed and/or number of milliseconds to move.
You will require at least one movement panel to be configured within the project. This function will control that movement panel.
Speed is a number between 0 and 255
Example: Forward()
Example: Forward(200)
Example: Forward(255, 5000)

Reverse( [speed], [milliSeconds] )
Using a Movement Panel Control, this will start your robot in the Reverse direction. 
Optionally, you can provide the speed and/or number of milliseconds to move.
You will require at least one movement panel to be configured within the project. This function will control that movement panel.
Speed is a number between 0 and 255
Example: Reverse()
Example: Reverse(200)
Example: Reverse(255, 5000)

Stop()
Using Movement Panel Control, this will stop your robot.
You will require at least one movement panel to be configured within the project. This function will control a movement panel.
Example: Stop()

Left( [speed], [milliSeconds] )
Using a Movement Panel Control, this will turn your robot left.
You will require at least one movement panel to be configured within the project. This function will control that movement panel.
Optionally, you can specify the speed and/or number of milliseconds to turn. 
Speed is a number between 0 and 255
Example #1: Left()
Example #2: Left(200)
Example #2: Left(200, 5000)

Right( [speed], [milliSeconds] )
Using a Movement Panel Control, this will turn your robot right.
You will require at least one movement panel to be configured within the project. This function will control that movement panel.
Optionally, you can specify the speed and/or number of milliseconds to turn. 
Speed is a number between 0 and 255
Example #1: Right()
Example #2: Right(200)
Example #2: Right(200, 5000)

Up( [milliSeconds] )
Using the servo port settings from a Movement Panel Control, this will raise your drone robot up
Optionally, you can specify the number of milliseconds to turn. 
Example #1: Up()
Example #2: Up(1000)

Down( [milliSeconds] )
Using the servo port settings from a Movement Panel Control, this will lower your drone robot up
Optionally, you can specify the number of milliseconds to turn. 
Example #1: Down()
Example #2: Down(1000)

RollRight( [milliSeconds] )
Using the servo port settings from a Movement Panel Control, this will roll your drone robot right
Optionally, you can specify the number of milliseconds to turn. 
Example #1: RollRight()
Example #2: RollRight(1000)

RollLeft( [milliSeconds] )
Using the servo port settings from a Movement Panel Control, this will roll your drone robot left
Optionally, you can specify the number of milliseconds to turn.
Example #1: RollLeft()
Example #2: RollLeft(1000)

Land()
Tell your flying drone to land
Example: Land()

TakeOff()
Tell your flying drone to take off
Example: TakeOff()

If anywhere in your project, the command Forward() was executed, the script engine will instruct the project's Movement Panel to begin moving forward.



How About Speech Recognition?

Some controls, such as the Speech Recognition Control will trigger EZ-Script based on user input (speech). The default configuration of the Speech Recognition Control includes speech commands and respective EZ-Script for instruction the Movement Panel to move the robot. If you view the Speech Recognition configuration, you will see EZ-Script direction commands...

Robot Speech Recognition

What About Other Controls?

Good question! Now that we know how EZ-Script can instruct a movement panel to move, how do other controls work with movement panels? Well, that's the magic of EZ-Builder. As an example, if a Joystick Control was added to your project, pushing forward on the joystick will instruct the Movement Panel to begin moving forward. This is because the Joystick control is pre-configured to send the Forward command to EZ-Builder, and the registered Movement Panel will respond to the direction request. Let us take a look at the settings menu for the Joystick Control. Here you will see the checkbox which assigns the Joystick #1 to "Control Movement Panel".

Movement Panel

Even The Camera Control?

Yes! The camera control has an option in the settings to instruct Movement Panels to move any direction based on the tracking method configured. The the tracking method is how the robot will respond to tracking a specific tracking type. You can find out more about the camera control and terminology by clicking HERE. If the Camera Control is configured to follow an object with MOVEMENT, then it will instruct the current Movement Panel. Let's take a look at the Camera Settings and where the option is to have the camera control a movement panel.

Robot Camera Control

*Note: Highlighted in RED is the section that contains options to configure how the Camera Control will communicate with the Movement Panel. Highlighted in BLUE is the checkbox which enables/disabled the ability for the Camera Control to track with movement. There are blue question marks which provide more information.



Mobile Interface Builder

The trend in this lesson is that any control or EZ-Script that deals with movement will instruct the current Movement Panel to begin moving the robot in the specified direction. This also applies to widgets within the Mobile Interface Builder. Within the Mobile Interface Builder, you may add buttons to control movement direction with EZ-Script commands (Forward(), Left(), Stop(), etc.). Or, you may add the Joystick Pad.

Here is an example of buttons added to the Mobile Interface Builder which will instruct movement using EZ-Script commands (Forward(), Left(), Stop(), Right(), Reverse(), etc.).

Robot Mobile App Buttons


Here is an example of using the Joystick Pad in the Mobile Interface Builder, which itself will automatically instruct the Movement Panel. One advantage to the mobile interface builder's Joystick Pad is that it can control speed, if the movement panel supports it. Some movement panels (such as the Auto Position GAIT) do not support speed.
*Note: You can tell if a movement panel supports speed because it will have a speed slider on it.

Robot Mobile App Joystick

RoboScratch

Any reference to moving (Forward, Left, Right, Stop, etc.) will automatically instruct the project's current Movement Panel to begin moving. This also includes using either RoboScratch, which is a great beginning programming interface included with EZ-Builder.

RoboScratch

Blockly

Any reference to moving (Forward, Left, Right, Stop, etc.) will automatically instruct the project's current Movement Panel to begin moving. This also includes using either Blockly, which is a great intermediate programming interface included with EZ-Builder.

Blockly

Can I Create My Own Movement Panel?

As mentioned earlier, EZ-Builder has many movement panels for HBridges, Continuous Rotation Servos, Auto Position GAITs and even AR Parrot Drones or iRobot Roombas. However, if you seek to create a custom movement panel, the Custom Movement Panel is what you are looking for. The Custom Movement panel contains events for each direction (Forward, Left, Right, Stop, Reverse) that you may add custom code for.

When another control requests to move your robot (i.e. forward, left, right, stop, reverse), the respective event in the Custom Movement Panel will be executed. Yes, the joystick will control your custom movement panel. Yes, the camera will control your custom movement panel. The point to this document is that any mention of a movement in EZ-Builder will instruct the movement panel to move the robot, even a custom movement panel.

Using Custom Movement Panel




Continue to Next lesson

Last updated 2/11/2017

Table of Contents




2. Blockly