Chapter 4. LeJOS – Unleashing EV3

We have already come a long way in our understanding and use of EV3. We learned how to program it on the brick using the visual programming language, enough to build our first autonomous (obstacle-avoiding) robot. In the process, we also learned about the limitations of this approach.

In this chapter, we will overcome these limitations using a powerful framework designed to grant an extraordinary degree of control over EV3, namely LeJOS.

In this chapter, we will cover the following topics:

  • LeJOS fundamentals
  • Installing LeJOS
  • Testing LeJOS on EV3

Classic programming on EV3

LeJOS is what happens when robot and software enthusiasts set out to hack a robotics kit. Although Lego initially intended the Mindstorms series to be primarily targeted towards children, it was taken up with gleeful enthusiasm by adults. The visual programming language, which was meant to be used both on the brick and on computers, was also designed with children in mind.

The visual programming language, although very powerful, has a number of limitations and shortcomings, some of which were outlined in the last chapter. Enthusiasts have continually been on the lookout for ways to program Mindstorms using traditional programming languages. As a result, a number of development kits have been created by enthusiasts to allow the programming of EV3 in a traditional fashion, by writing and compiling code in traditional languages.

A development kit for EV3 consists of the following:

  • A traditional programming language (C, C++, Java, and so on)
  • Firmware for the brick (basically, a new OS)
  • An API in the chosen programming language, giving access to the robot's inputs and outputs
  • A compiler that compiles code on a traditional computer to produce executable code for the brick
  • Optionally, an Integrated Development Environment (IDE) to consolidate and simplify the process of developing the brick

The release of each robot in the Mindstorms series has been associated with a consolidated effort by the open source community to hack the brick and make available a number of frameworks for programming robots using traditional programming languages. Some of the common frameworks available for Mindstorms are GNAT GPL (Ada), ROBOTC, Next Byte Code (NBC), an assembly language, Not Quite C (NQC), LeJOS, and many others.

This variety of frameworks is particularly useful for Linux users, not only because they love having the ability to program in their language of choice, but also because the visual programming suite for EV3 does not run on Linux at all. In its absence, these frameworks are essential for anyone who is looking to create programs of significant complexity for EV3.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.178.157