The Android App is adapted from the FTC SDK with small changes to the FTDI USB serial driver.
The goal of this project is to create a standalone app that will replace the USB connected Modern Robotics hardware (USB Motor Controller, Legacy Motor Controller, USB Servo Controller) with a networked connected computer. This computer will then run a simulation of the controllers and provide a 3d view of a simulated robot. To accomplish this, the FTDI USB to serial driver library file will be removed and replaced with a stub driver that implements the required calls. The old USB calls will then be rerouted to the computer using UDP packets.
- Android Studio
- Version: 1.2.1.1
- Eclipse
- Version: Mars Release (4.5.0)
- Need JavaFX; use http://efxclipse.bestsolution.at/install.html#all-in-one for pre-packaged install.
- V-Rep Pro EDU
- Version: 3.2.1
- Vendor: Coppelia Robotics
- Java JDK
- Version: jdk1.8.0_45
- TCPView (Used to kill process holding port 6500 when pc java program doesn't release it. TODO: fix)
- Vendor: www.sysinternals.com
Windows: Download Git for Windows from:
https://windows.github.com
and follow the remaining steps in the Git Shell.
Clone the repo using Git:
git clone https://github.com/HagertyRobotics/ftc_app_networked_simulator
Remember, please use the "onboard" branch as the master branch is still in flux.
In the repo you'll find the following directories and files.
File/Folder | Provides |
---|---|
Android/App | Android app cloned from the FTC Robot Controller (Android Studio) |
PC/Java | PC side simulator. Connects phone to v-rep (Eclipse Project) |
PC/V-rep | Coppelia Robotics V-rep simulator scene files. |
LICENSE.md | Project license information. |
README.md | Details for quickly understanding the project. |
- Use Android Studio to open existing project and point to Android/App.
- Change PC_IP_ADDRESS define to your PC's address in file: FtcRobotController/src/main/java/com/ftdi.j2xx/D2xxManager.java
- Compile and run the app
- Setup the newly found legacy controller with two motors "motor_1" and "motor_2"
- Save configuration
- Open PC Path editor and add following directory to PATH variable:
- C:\Program Files (x86)\V-REP3\V-REP_PRO_EDU\programming\remoteApiBindings\java\lib\64Bit
- Open V-Rep simulator and open scene file PC/V-rep/FTCRobot.ttt
- Open Eclipse and import PC/Java/RobotSimulator
- Compile and Run RobotSimulator
- Robot Simulator will listen on the socket selected in the GUI for incoming packets from the Phone and forward motor commands to the V-Rep simulator
- Press the "Start Simulator" button to start the simulation.
- Compile and Run RobotSimulator
- Open the Driver Control Station App on a 2nd Phone and start ether the TestOp or the TestTankOp commands.
- The TestTankOp Mode requires a joystick connected with a OTG cable.
- The TestOp will increment both motors in a loop. This will currently show the bug where the 2nd motor write will overwrite the first and the robot will drive in circles.