• No results found

Embedded system development

4.1 Development tools

This section describes the set of tools used in the development of the embedded applica-tion. First, an overview of the hardware is presented, highlighting the most important aspects that are of interest to the 3D face scanner application. This is then followed by a list of the software tools along with a short motivation for their selection. A so called remote development methodology was used for the compilation process. The idea is to

31

run an integrated development environment (IDE) on a client system for the creation of the project, editing of the files, and usage of code assistance features in the same manner as done with local projects. However, when the project is built, run, or debugged, the process runs on a remote server with output and input transferred to the client system.

4.1.1 Hardware

A current trend in the embedded world is the use of single-board computers (SBCs) as development platforms. SBCs combine most features of a conventional desktop computer into a single board which can be as small as a credit card. One or more processors of different types, memory, on-board peripherals for multiple USB devices, single or dual gigabit Ethernet connections, integrated graphics and audio capabilities, amongst others, are common features included in these devices. But perhaps what is most interesting for embedded developers is the availability of several SBCs that come under open source hardware category [36]. Such SBCs are suitable for the implementation of a wide range of applications on the basis of open operating systems.

Two different hardware environments were used in the development of the current em-bedded application: a conventional desktop personal computer (PC) with an Intel x86 architecture and a SBC that was selected according to the following survey.

4.1.1.1 Single-board computer survey

A prior survey of popular SBCs available in the market was conducted with the intention of finding the most suitable model for our application. Table 4.1 presents a subset of the considered models, highlighting the most relevant characteristics for the 3D face scanner application. Refer to [37] for the complete survey.

The model to be chosen has to comply with several requirements imposed by the 3D face scanner application. First, support for both, a camera and a projector, had to be offered. While all of the considered models showed special support for video output, not all of them provided suitable characteristics for camera signal acquisition. In fact, most of them rely on USB or Ethernet connections for this purpose. The problem of using USB technology for camera acquisition is that it is highly resource demanding. On the other hand, Ethernet connections imply streaming video in formats such as MPEG, which require additional computational resources and buffering for decoding the video stream. Explicit periphery support for camera acquisition was only offered by two of the considered models, the BeagleBoard-xM and the PandaBoard.

Table 4.1: Single-board computer survey.

BeagleBoard-xM

CPU ARM Cortex-A8 1000 MHz

RAM 512 MB

Video output DVI-D, HDMI, S-Video

GPU PowerVR SGX, OpenGL ES 2.0

Camera port Yes

Raspberry Pi Model B

CPU ARM1176 700 MHz

RAM 256 MB

Video output Composite RCA, HDMI, DSI

GPU Bradcom VideoCore IV, OpenGL ES 2.0

Camera port No

Cotton candy

CPU dual-core ARM Cortex-A9 1200 MHz

RAM 1 GB

Video output HDMI

GPU quad-core 200 MHz Mali-400 MP, OpenGL ES 2.0

Camera port No

PandaBoard

CPU dual-core ARM Cortex-A9 1000 MHz

RAM 1 GB

Video output HDMI, DVI-D, LCD

GPU PowerVR SGX540, OpenGL ES 2.0

Camera port Yes

Via APC

CPU ARM11 800 MHz

RAM 512 MB

Video output HDMI, VGA

GPU Built-in 2D/3D Graphic, OpenGL ES 2.0

Camera port No

MK802

CPU ARM Cortex-A8 1000 MHz

RAM 1 GB

Video output HDMI

GPU Mali-400 MP, OpenGL ES 2.0

Camera port No

Snowball

CPU dual-core ARM Cortex-A9 1000 MHz

RAM 1 GB

Video output HDMI, CVBS

GPU Mali-400 MP, OpenGL ES 2.0

Camera port No

A second issue in the selection of the SBC was concerned with the project objective of developing a module capable of visualizing the 3D reconstructed model by means of the embedded projector. It was considered that the achievement of this objective could be greatly simplified by selecting an SBC model that offered support for rendering of 3D computer graphics by means of an API, preferably OpenGL ES. Nevertheless, all of the SBC models considered in the survey featured a graphical processor unit (GPU) with such support.

Finally, one last important motivation for the selection came from the experience gath-ered through related projects. The BeagleBoard-xM had been used as the embedded computing unit in other projects [6] at Philips Research Eindhoven, and therefore, valu-able implementation effort could be saved if this option were adopted. Consequently, it was the BeagleBoard-xM that was selected as the SBC model for the development of the current project.

4.1.1.2 BeagleBoard-xM features

The BeagleBoard-xM (Figure 4.1) is an SBC produced by Texas instruments. It is a low-power, open-source hardware system that was designed specifically to address the Open Source Community. It measures 82.55 by 82.55 mm and offers most of the functionality of a desktop computer. It is based on Texas instruments’ DM3730 system on chip (SoC). At the heart of the SoC lies an ARM Cortex-A8 processor clocked at 1 GHz and 512 MB of LPDDR RAM. Several open operating systems have been made compatible with such processor, including Linux, FreeBSD, RISC OS, Symbian and Android. Moreover, the BeagleBoard-xM features a TMS320C64x+ DSP for accelerated video and audio decoding, and an Imagination Technologies PowerVR SGX530 GPU to provide accelerated 2D and 3D rendering that supports OpenGL ES 2.0 [38].

In addition to the previously mentioned characteristics, the ARM Cortex-A8 processor comes with a general-purpose SIMD (Single instruction, Multiple data) engine known as NEON. This technology is based on a 128-bit SIMD architecture extension that provides flexible and powerful acceleration for consumer multimedia products, as described [39].

4.1.2 Software

The main factors involved in the selection of software tools were: (i) available support by a large development community and (ii) acquisition costs and licensing charges. Open source software was adopted where possible. Moreover, prior experience with the tools was also taken into account. The software can be divided in two categories: (i) software

Figure 4.1: The BeagleBoard-xM offered by Texas instruments.

libraries that are used within the application and therefore are necessary for its execution and (ii) software tools used specifically for the development of the application and hence are not required for its execution. In what follows, each of these is briefly described.

4.1.2.1 Software libraries

The following software libraries are being used throughout the implementation of the embedded application:

libxml2: It is a software library used for parsing XML documents, which was originally developed for the Gnome project and was later made available for outside projects as well. The current application makes use of such tool for extracting the required information from the XML file that is included for each scan.

OpenCV: Is an open source computer vision and machine learning software library initiated by Intel. It provides the necessary functionality to construct the Delaunay triangulation described in Chapter 3. Though it was used in the initial versions of the application, later optimizations replaced OpenCV implementations.

CGAL: Consists of a software library that aims to provide access to algorithms in computational geometry. It is being used in the current application as a means to simplify the resulting mesh surface, i.e., to reduce the number of faces used to represent the surface while keeping the overall shape of the reconstructed model.

OpenGL ES: OpenGL ES is a subset of the more general OpenGL, designed specifi-cally for embedded systems. It consists of a cross-language, multi-platform Appli-cation Programming Interface (API) for rendering 2D and 3D computer graphics.

It is used in the current application as the means to visualize the 3D reconstructed model.

GLUT: The OpenGL Utility Toolkit consists of a system independent API for OpenGL used to create windows and/or frame buffers. It is being used in the visualization module of the application as well.

4.1.2.2 Software development tools

The following list presents a description of the most important software tools used for the development of the embedded application:

GNU toolchain: It refers to a collection of programming tools produced by the GNU Project that provide developing facilities for applications and operating systems.

Among the several projects that comprise the GNU toolchain, the following were used:

GNU Make: It is a utility that automates the building process of executable programs by reading the so-called makefiles which specify how to create the target program.

GCC: It is the official compiler of the GNU operating system and has been adopted as standard by most modern Unix-like computer operating systems.

GNU Binutils: Involves a set of programming tools that are used in the develop-ment process of creating and managing programs, object files, libraries, profile data, and assembly source code. The commands as (assembler), ld (linker) and gprof (profiler) were used among the complete set of binutil commands.

GNU Project debugger: It is the standard debugger for the GNU operating system, which was made available for the development of applications outside this project as well.

Valgrind: It is a programming tool that can automatically detect memory management errors. It also provides the functionality of a profiler.

Ubuntu: A Linux based operating system that is distributed as free and open source software. It was installed in both, the desktop PC and the SBC.