Now that we are close to completing our implementation of the Line-follower robot, let's review the project's code structure one last time. All the project code is placed in a folder named LineFollower
. Inside this main folder are the following files and subfolders:
LineFollower | ---- ev3 | | ---- DBusJava | | ---- ev3classes | | ---- src | | ---- ColorSensor.java | | ---- Controller.java | | ---- DifferentialDrive.java | | ---- LineFollower.java | | ---- build.gradle | ---- Makefile (optional)
The ev3
subfolder contains two further subfolders: DBusJava
and ev3classes
, which are cloned (copied) from the LeJOS Git repository and contain libraries that we use to import the ev3
classes into our own code.
The src
subfolder is where we place all the Java files (classes) that we write to control the Line-follower. The purpose of each file is explained in the next section, where we will discuss the contents of each file.
The familiar
build.gradle
file is used to configure Gradle, telling it where the various parts of the project are and how to bring it all together to compile the code. The compilation produces an executable .jar
file that we can place in EV3 and run.
Finally, the Makefile
is optional and is intended for users who want to use the make utility to automate the compile-transfer-execute cycle. I recommend that you read Appendix A, The Make Utility, if you haven't already, and learn how to use the Makefile
. It will make debugging and deploying your code much easier.
18.223.195.97