|
1 | 1 | # EV3D4 |
2 | | -EV3D4 is designed to look like R2-D2 from Star Wars. There are two options for controlling EV3D4. The first is to use the IR remote to send commands to the IR sensor, run EV3D4RemoteControl to use this method. The second means of controlling EV3D4 is via a web browser, run EV3D4WebControl to use this method. |
| 2 | +EV3D4 is designed to look like R2-D2 from Star Wars. There are two options for |
| 3 | +controlling EV3D4. The first is to use the IR remote to send commands to the IR |
| 4 | +sensor, run EV3D4RemoteControl to use this method. The second means of |
| 5 | +controlling EV3D4 is via a web browser, run EV3D4WebControl to use this method. |
3 | 6 |
|
4 | 7 | **Building instructions**: https://www.lego.com/en-us/mindstorms/build-a-robot/ev3d4 |
5 | 8 |
|
6 | 9 | ### EV3D4RemoteControl |
7 | | -If you are using EV3D4RemoteControl the only other file you need from `demo/EV3D4/` is EV3D4.py. The other files are only needed by EV3D4WebControl. |
| 10 | +If you are using EV3D4RemoteControl the only other file you need from |
| 11 | +`demo/EV3D4/` is EV3D4.py. The other files are only needed by EV3D4WebControl. |
8 | 12 |
|
9 | | -EV3D4RemoteControl creates a child class of ev3dev/helper.py's RemoteControlledTank. |
| 13 | +EV3D4RemoteControl creates a child class of ev3dev/helper.py's |
| 14 | +RemoteControlledTank. |
10 | 15 |
|
11 | 16 |
|
12 | 17 | ### EV3D4WebControl |
13 | | -EV3D4WebControl creates a child class of ev3dev/helper.py's WebControlledTank. The WebControlledTank class runs a web server that serves the web pages, images, etc but it also services the AJAX calls made via the client. The user loads the initial web page at which point they choose the "Desktop interface" or the "Mobile Interface". |
14 | | - |
15 | | -Desktop Interface - The user is presented with four arrows for moving forwards, backwards, spinning clockwise or spinning counter-clockwise. Two additional buttons are provided for controlling the medium motor. There are two sliders, one to control the speed of the tank and the other to control the speed of the medium motor. |
16 | | - |
17 | | -Mobile Interface - The user is presented with a virtual joystick that is used to control the movements of the robot. Slide your thumb forward and the robot moves forward, slide it to the right and the robot spins clockwise, etc. The further you move the joystick towards the edge of the circle the faster the robot moves. Buttons and a speed slider for the medium motor are also provided. |
18 | | - |
19 | | -Both interfaces have touch support so you can use either Desktop or Mobile from your smartphone. When the user clicks/touches a button some jQuery code will fire off an AJAX call to let the EV3D4 web server know what the user clicked or where the joystick is if using the Mobile Interface. The web server in WebControlledTank services this AJAX call and adjust motor speed/power accordingly. |
20 | | - |
21 | | -You can see a demo of the web interface below. Note that the demo is on a simple Tank robot, not EV3D4, but that doesn't really matter as EV3D4 is also just a Tank robot. |
| 18 | +EV3D4WebControl creates a child class of ev3dev/helper.py's WebControlledTank. |
| 19 | +The WebControlledTank class runs a web server that serves the web pages, |
| 20 | +images, etc but it also services the AJAX calls made via the client. The user |
| 21 | +loads the initial web page at which point they choose the "Desktop interface" |
| 22 | +or the "Mobile Interface". |
| 23 | + |
| 24 | +Desktop Interface - The user is presented with four arrows for moving forwards, |
| 25 | +backwards, spinning clockwise or spinning counter-clockwise. Two additional |
| 26 | +buttons are provided for controlling the medium motor. There are two sliders, |
| 27 | +one to control the speed of the tank and the other to control the speed of the |
| 28 | +medium motor. |
| 29 | + |
| 30 | +Mobile Interface - The user is presented with a virtual joystick that is used |
| 31 | +to control the movements of the robot. Slide your thumb forward and the robot |
| 32 | +moves forward, slide it to the right and the robot spins clockwise, etc. The |
| 33 | +further you move the joystick towards the edge of the circle the faster the |
| 34 | +robot moves. Buttons and a speed slider for the medium motor are also provided. |
| 35 | + |
| 36 | +Both interfaces have touch support so you can use either Desktop or Mobile from |
| 37 | +your smartphone. When the user clicks/touches a button some jQuery code will |
| 38 | +fire off an AJAX call to let the EV3D4 web server know what the user clicked or |
| 39 | +where the joystick is if using the Mobile Interface. The web server in |
| 40 | +WebControlledTank services this AJAX call and adjust motor speed/power |
| 41 | +accordingly. |
| 42 | + |
| 43 | +You can see a demo of the web interface below. Note that the demo is on a |
| 44 | +simple Tank robot, not EV3D4, but that doesn't really matter as EV3D4 is also |
| 45 | +just a Tank robot. |
22 | 46 |
|
23 | 47 | **Demo Video**: https://www.youtube.com/watch?v=x5VauXr7W4A |
0 commit comments