# Virtual Reality and the Application in Virtual Experiment for Agricultural Equipment

Yu Zang, Zhongxiang Zhu, Zhenghe Song, Enrong Mao

► To cite this version:

Yu Zang, Zhongxiang Zhu, Zhenghe Song, Enrong Mao. Virtual Reality and the Application in Virtual Experiment for Agricultural Equipment. 4th Conference on Computer and Computing Technologies in Agriculture (CCTA), Oct 2010, Nanchang, China. pp.257-268, 10.1007/978-3-642-18354-6_32 hal-01563432

HAL Id: hal-01563432

https://inria.hal.science/hal-01563432

Submitted on 17 Jul 2017

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
Virtual Reality and the Application in Virtual
Experiment for Agricultural Equipment

Yu Zang, Zhongxiang Zhu, Zhenghe Song, Enrong Mao*

College of Engineering, China Agricultural University, P. R. China,

* Corresponding author, Address: P.O. Box 47,17 Tsinghua East Road, Beijing 100083, P. R. China, Tel: +86-10-62736370, Fax: +86-10-62737998, zyxx_427@hotmail.com

**Abstract.** The meaning and characteristics of the virtual experiment and the significance of applying virtual prototype into agricultural equipment were analyzed in this paper. Then a kind of virtual experiments system platform on agricultural equipments was founded by using MultiGen Creator, Vega Prime software and VC++ programming language. According to the functions of the virtual experiment system, the structure and all components of the system were introduced. Furthermore, the methods of network design, synchronous driving, image edge-blending and geometric calibration, and the key technologies such as tractors dynamics modeling, experiment reappearance and real-time test of virtual experiment were discussed. Finally, based on three-dimension geometry model and Vega Prime, the digitalization of tractor testing ground and real-time performance simulation were realized, which provides a new research means and technical method for the tractor performance testing. The test results show that the platform could make the observers immersed among the virtual environment to experience testing process directly and intuitively, and could achieve the real-time interaction between users and environment. This study proves stable operation of the system with reliability and validity, its velocity can reach 30 frames/s and the delay time is 0.025s.

**Keywords:** Virtual reality (VR), Agricultural equipment, Virtual experiment, Test repetition, Real-time test

# 1 Introduction

Virtual reality is a kind of simulated environment which can create and experience the virtual world. It is simulation system as well as 3D dynamic scene fused multi-source information [1]. Using three-dimensional computer graphics, interactive devices, and high-resolution display, a virtual world can be realized in which imaginary objects can be picked up as if they are in the physical world. Therefore, virtual environment, immersion, tactile feedback (a response to user input) and interaction are the most important points during experiencing the virtual reality.

Indeed, the significance and advantages of rapid product development and cost saving have been recognized in recent years. For this, countries in the world are making a study of virtual reality and its applications, and many researchers have worked on developing various techniques while priority research areas were changed
from technique at first to using VR at present and what VR can do for people at the same time. As a kind of practical technology, virtual reality is well-known and is currently investigated for practical use in various industrial fields such as computer graphics, CAD, CAM, CIM, robotics, medical/health care, architectural design, entertainment, education, multimedia, games and so on [2–5]. Many companies have launched commercial products which can be used for developing VR application systems. However, its application in virtual experiment for agricultural equipment is not widely used. The final objective of this study is to introduce VR technology and establish virtual experiment system for agricultural equipment based on VR.

# 2 Virtual experiment for agricultural equipment based on VR

## 2.1 What is virtual experiment

During virtual experiment, software is used to generate kinds of virtual environment instead of part or all of hardware in the computer system. In this condition, customers could complete all scheduled projects as if they are in the true environment, and the experimental results obtained from virtual experiment are close to real test results. As a matter of fact, there are several means of realization, such as computer simulation technology, virtual instrument technology and virtual reality technology [6].

Specifically, there are many advantages of virtual experiment, which can be roughly categorized into four areas: (1) overcoming danger and inconvenience during the real experiment; (2) avoiding destructive effect and property losses during using physical objects; (3) unlimited number of tests and repeatability of the results; (4) good interactivity between users and environment. Therefore, from the view of virtual prototype, as a typical VR application in design and manufacturing industry, virtual experiment could realize multi-mode virtual environment including audibility, visibility and sense of touch by VR technology with input/output device, while users could do experiments, operate machines interactively, and inspect or evaluate the product performance.

## 2.2 Significance of the application in virtual experiment for agricultural equipment

In recent years, new models of agricultural equipment are invented continuously, but the tractor performance tests are always the same, just by using a real vehicle and analyzing data collected in physical test site. As a result, the tests in this way not only pollute the environment, but also consume a large amount of manpower and resources. Further more, it is liable to injure testing personnel during operating, and the test period is long relatively. In particular, the affects on test results caused by non-objective factors cannot be avoided during tests, for example, the skilled level of operators.

Consequently, the significance of applying VR technology into agricultural equipment experiment is great, especially for large-scale agricultural machinery,
because of its complex structure, long period of production design and high cost. With VR in test, designers could simulate the performance and modify the products, while customers could understand the properties and functions of the products directly. In brief, virtual experiment for agricultural equipment, which helps to organize the preparation work for production, plays an important role in safe reliability, shortening product-manufacturing period, enhancing product quality, reducing product cost and tractor innovative design.

# 3 The construction of virtual experiment system for agricultural equipment

## 3.1. System function

Actually, agricultural equipment virtual experiment is a kind of performance simulation on various working conditions in virtual test scene, which maps the simulation data of the theoretical model or practical data obtained from operation to the computer screen and exports the result as the form of graphics and moving points. By means of various interaction methods of VR, researchers could feel tractor performance in different conditions, and they experience personally as if doing the actual test. Therefore, the system functions are as follows:

(1) visualization of physical model and testing grounding environment;

(2) response to collision or display and extraction of the tractor driving attitude or geographic coordinates in real time;

(3) point of view switch and input control with interactive devices;

(4) kinematics and dynamics analysis and calculation of tractor model, researchers could simulate traction, braking, and steering control performance according to the results;

(5) network communication interface so as to do real-time data transmission.

## 3.2. System structure

According to the testing requirements and operating characteristics of the tractors, virtual experiment for agricultural equipment makes simulation with virtual prototyping technique and follows the principles of openness, extensibility and repeatability. Users could control the tractor models in a virtual environment and do some experiments during virtual tests. On the basis of the characteristics of tractor virtual test system, the system is divided into several parts as follows (Fig. 1), every part transmits information through interface parameters.
<figure><img src="image_2.png" /><figcaption>Fig. 1. Structural framework of virtual experiment system</figcaption></figure>

## 3.3. System hardware composition

This system adopts PC-driven and Client/Server system mode, which consists of one server, six IPC, three-channel passive projection system, stereo glasses, steering wheel, joystick, spaceball and other devices, and all of them are connected to a LAN. The projectors are controlled by the IPC, and each of two projectors displays the same channel, but one shows for left eye and the other for right eye through the polarizers. Observers look at the scene which is made up of six pictures by wearing the stereo glasses, so as to restoration the images to stereo effect, which are divided into three parts.

# 4 Implementation of virtual experiment visual system

## 4.1. Virtual experiment environment modeling

Virtual experiment environment is created based on geometric model, which is computer-graphics-based. First of all, designers need to abstract the real scene so as to use polygons to construct the three-dimensional geometric model of the virtual landscape (including terrain, buildings, trees, etc.). Second, designers must finish the light and material of models in virtual environment. Third, it is necessary to set the control parameters and complete the texture mapping. Finally, researchers render the visual images in real-time by output devices in order to complete drawing the whole scene. Fig. 2 is the flow diagram by which the tractor virtual proving ground was
constructed. In this system, several typical roads were set up in virtual proving ground, such as ring test track, alternating vibration road, farm road, driver's vision test road, washboard road and so on. All of the test roads are provided for tractor virtual experiment.

<figure><img src="image_3.png" /><figcaption>Fig. 2. Flowsheet of virtual environment based on geometric model</figcaption></figure>

During modeling, visual effect and real-time performance should be given overall consideration. On one hand, the simple model will impact on the reality of the simulation, and on the other hand, complex environment will affect the system operation in real time. Therefore, by the premise of guarantee of system running, some critical technologies were used to set up the models as far as possible to meet the visual authenticity of scene model.

(1) Billboard: Billboard is to map a texture to a plane – a single polygon which rotates within the simulation, so that the image of the model always faces the eyepoint. When viewed from ordinary perspectives in a scene, such symmetrical models appear realistic enough, while using only a small amount of system resources so as to increase the running speed. The trees and signs were constructed on basis of the billboard technology in the system.

(2) Texture: Textures are bitmapped images that are mapped onto polygons. However, when the 2D texture is applied to a 3D model, the u and v coordinates of the texture image are mapped to the x, y, and z coordinates of the model. Creator provides seven kinds of texture mapping, such as three-point put tool, four-point put tool, surface project texture tool, spherical project texture, radial project texture tool, environment map texture tool and geo-put texture tool. With textures viewer will experience a photo-realistic appearance without increasing the polygon count. In this system, texture technology was carried through from beginning to end.

(3) Level of Detail: Levels of detail (LODs) are sets of models that represent the same object or terrain area with varying degrees of complexity. The real-time system selects one of the LODs to display, depending on the distance from the eyepoint to the LOD and the number of polygons the real-time system can process. If the eyepoint is far away from an object, the object is displayed as a low LOD, containing relatively few polygons. As the eyepoint moves towards the object, the real-time system replaces it with increasingly complex LODs. LODs play an important part in optimizing a visual scene for drawing, so it was used to render the terrain to improve operation velocity. The 3D scene in virtual experiment system is shown in Fig. 3.
<figure><img src="image_4.png" /><figcaption>Fig. 3. 3D scene model in virtual experiment system</figcaption></figure>

## 4.2. System network design

The system selected Master/Slave mode, because several PC were used in internet to drive the virtual environment. The server is Master node and IPC is Slave node. Fig. 4 is the flow diagram of network system.

<figure><img src="image_5.png" /><figcaption>Fig. 4. Flowsheet of network system</figcaption></figure>

This structure has some features:
(1) Each of nodes has the same application program and data copy, the system only need to update the interactive information, control instructions and the scene change information in run-time.

(2) The Master node is responsible for receiving information, handling user interaction information, and transmitting threads, input (keyboard, mouse, joystick, etc.) and other user data to the slave applications.

### 4.3. Synchronous driven in real-time

Distributed rendering utilities (drUtil) of VP were used in this system. The principle is to receive input from the server and to send rendering information and time-stamped data packets through drUtil in real-time, so as to respond to the control and synchronize the master's scene graph with the slave's scene graph among three channels. Main code:

```c
// Set synchronous mark
vuDistributed::setSyncEnable(vuDistributed::SYNC_label_
    PRE_SWAPBUFFERS, true );
vuDistributed::setSyncEnable(vuDistributed::SYNC_label_
    POST_SWAPBUFFERS, false );
// Synchronize ACF
vuDistributed::setSyncEnable(vuDistributed::SYNC_label_
    ACF, true );
// Synchronize the time
vuDistributed::setSyncEnable(vuDistributed::SYNC_label_
    TIME, true );
// Synchronize window message
vuDistributed::setSyncEnable( vuDistributed::SYNC_label_
    _MESSAGES, true );
```

### 4.4. Correction and Fusion

Geometric distortion correction is one of the key technologies in virtual reality projection system. However, a kind of geometric correction algorithm based on viewpoint locations and texture mapping was proposed in this system, so that the image distortion correction for single projection screen and alignment correction for multi-projection screen could be completed. The principle is shown in Fig. 5. Furthermore, in order to solve uneven brightness caused by overlapping area between two projectors, the method of color edge fusion based on weight was used, that is, each pixel in bright band is given a preset weight, and the color component gray value of corresponding pixels will be multiplied by default weight while rendering the image, thus the high light parts in overlapping area between two adjacent channels are processed to smooth brightness.
<figure><img src="image_6.png" /><figcaption>Fig. 5. Schematic diagram of image geometric calibration</figcaption></figure>

# 5 Design and development of system software

The system used Visual C++.net of Microsoft company as integrated develop
environment. The virtual experiment system for agricultural equipment runs on the
Multigen Creator and Vega Prime as modeling and visual simulation software, with
OPENGL and other auxiliary software, and it fits for Windows XP operating systems.

5.1. Dynamic model of tractor

To realize the interactive control tractor in virtual experiment, the system established
a tractor dynamic model of tractor for real-time simulation, including the whole
vehicle model, engine model, transmission system model, brake system model,
steering system model and tire model. In this model, driver, tractor and virtual
environment constitute the closed-loop system, as shown in Fig. 6, in order to achieve
steering, acceleration / deceleration, braking and other acts of simulated operation. As
a result, the driver could control the tractor in real time and experience the control
effects in a virtual environment.

<figure><img src="image_7.png" /><figcaption>Fig. 6. Closed-loop of tractor dynamic model</figcaption></figure>
## 5.2. Implementation of tractor virtual experiment

The system calls VP class function in VC++.net so as to achieve the management and calls of the scene, view control, steering control, and texture control during virtual experiments. For example, the researchers could finish changing the position or rotation of the tractor model by class function called vpTransform in VP, whose getTranslate() function and getRotate() function mainly return the position and orientation information of controlled objects or motion models. Otherwise, if the information of x, y, z coordinates, h (heading angle), p (pitch angle), and r (roll angle) are changed during interaction process, setTranslate() function and setRotate() function will be used to set the new position and orientation. Therefore, the parameters change of tractor motion could be realized in virtual environment.

### 5.2.1. Test repetition.
In the part of test repetition, tractor performance was analyzed by virtual prototype, and the results were read by linked list to realize the test repetition. The linked list data structure of tractor components is defined as follow:

```cpp
struct ReplayDataList
{
    double cog_ster[37]; //cog_ster[37] represents the time, x, y, z coordinates and h, p, r angle of the centroid component
    ReplayDataList *next;
    ReplayDataList()
    {
        for (int i=0; i<37; i++)
            cog_ster[i] = 0.0;
        next=NULL;
    }
};

//Assign the data to tractor model after obtain the data from linked list
m_tractor->setTranslate(r->cog_ster[1], r->cog_ster[2], r->cog_ster[3], false);
m_tractor->setRotate(-r->cog_ster[4], r->cog_ster[5], r->cog_ster[6], false);
......
```

The system can reappear the tractor real experiment, such as braking performance, traction performance and steering performance. In addition, researchers can control playing speed and process depending on requirement, and display the speed - acceleration - time curve. The system operation interface is shown as Fig. 7.
<figure><img src="image_8.png" /><figcaption>Fig. 7. Operation interface of experiment reappearance</figcaption></figure>

5.2.2. Real-time test. In the part of real-time test, the operator can drive the tractor by interactive manipulation by switching the view point and using steering wheel, joy stick, spaceball and other virtual devices so as to simulate the field operations. During driving interactively, the driving attitude and the information about location coordinate of the tractor are shown and extracted. Otherwise, the system can response to collision detection when the tractor is moving.

Take the steering wheel turning as example and the concrete program codes are shown as follows:

/* Judge input device type*/
if (m_nRealTestInputType==1) // Judge whether the input device is
  tractor drive test-bed
m_strcDriveTracData=g_strcDriveTracData; // Transmit signal
data
/* Read the sensor signals from tractor drive test-bed and calibrate the data*/
x=(BYTE)(Read.lpBuffer[In88+2]); // Read the steering wheel sensor
signal from memory address
dFangxiang=360*x/240; // Convert the unit to degree
if (dFangxiang>648)dFangxiang=648;
else if (dFangxiang<-648)dFangxiang=-648; // Limit the range of
  signal from -648 to +648
dFangxiang=450*360*dFangxiang/240/648; //Limit the range of
  steering wheel from -450° to +450°
g_strcDriveTracData.m_Fangxiang=dFangxiang;
/* Find the node of steering wheel*/
vpObject* m_tractor; // Define the tractor as an object
m_tractor=vpObject::find("myObject_Tractor"); // Get the
  object of tractor
vsDOF *m_SteerDof; // Define the freedom of steering wheel
vsNode *myNode; // Define a node
myNode=m_tractor->find_named("steer"); // Get the node of steering wheel from tractor model
if (myNode&myNode->isOfClassType (vsDOF::getStaticClassType()))
m_SteerDof=(vsDOF*)myNode;
/* Put the motion control onto the steering wheel*/
m_dSteeringAng=-tractordata.m_Fangxiang; // Get the information of steering wheel angle
m_SteerDof->setRotateH(m_dSteeringAng, false); // Update the information of steering wheel angle

Researchers test the virtual experiment system for agricultural equipment by carrying out a certain type of tractor virtual experiment. The simulation effect is shown as Fig. 8. There are three kinds of virtual scenes for selection, such as road test scene, field test scene and washboard road test scene. The current information, for instance, speed, acceleration and front wheel angle of the tractor, will be displayed on the interface dynamically. However, the experiment results will be stored in the database in order to process data and reappear the experiment. The experiment results show stable operation of the system with the reliability and validity and its velocity can reach 30 frames/s and the delay time is 0.025s.

<figure><img src="image_9.png" /><figcaption>Fig. 8. Operation interface of virtual experiment</figcaption></figure>

6. Conclusions

In this study, virtual reality was applied into agricultural equipment by multi-channel
immersive virtual reality technique and tractor kinetic theory was used as well based
on traditional method of tractor performance testing in the system. It realized the
three-dimensional display of the models and could drive the models in real-time to
complete the experiment reappearance and real-time test of the tractor. The test results
show that the virtual experiment for agricultural equipment, which achieves the real-
time interaction between users and environment, could make the observers immersed
among the virtual environment to experience testing process directly and intuitively.
This research provides a new method to the tractor performance test, and this way
plays an important role in safe reliability, shortening product-manufacturing period,
enhancing product quality and production efficiency, avoiding the physical model-
making, reducing product cost and tractor innovative design.

ACKNOWLEDGEMENTS

This research was supported by National Key Technology R&D Program during
the 11th Five-Year Plan Period of China (No. 2006BAD11A01) and Special Fund for
Agro-scientific Research in the Public Interest (No. 200903050-5-1).

References

1. Zou Xiangjun, Sun Jian, HE Hanwu, et al.: The Development and Prospects of Virtual Reality. Journal of System Simulation 16(9), 1905-1909 (2004)

2. Hu Jianping, Dong Chunhua, Chen Yadong, et al.: Application of Virtual Reality Technology in Urban 3D Geosciences Modeling. Computer Engineering and Design 30(8), 2001-2007 (2009)

3. Du Fei, Li Weiwei, Zhong Yanjiong, et al.: The Application of Virtual Reality in Driving Simulator. Microcomputer Information 22(10), 292-295 (2006)

4. Zhang Yu: Design and Develop of Virtual Reality Technology in Program-Based Learning.
Hubei (2009)

5. Wang Kaizhan, Ma Ruijun: Virtual Reality Technology and Its Application in Agricultural Machinery Design. Journal of System Simulation 18(2), 500-503 (2006)

6. Jiang Fachao, Cao Zhengqing, Chen Quanshi: Virtual Test Technology and the Application on the Vehicle. Tractor & Farm Transporter 7(4), 3-8 (2004)

7. Junji Nomura, Kazuya Sawada: Virtual Reality Technology and Its Industrial Applications.
Annual Reviews in Control 25, 99-109 (2001)

8. S.H. Choi, H.H. Cheung: A Versatile Virtual Prototyping System for Rapid Product Development. Computers in Industry 59(5), 477-488 (2008)

9. Stefan Woksepp, Thomas Olofsson: Credibility and Applicability of Virtual Reality Models in Design and Construction. Advanced Engineering Informatics 22(4), 520-528 (2008)

10.Cheng Tzong-Ming, Tsung-Han Tu: A Fast Parametric Deformation Mechanism for Virtual Reality Applications. Computers & Industrial Engineering 57(2), 520-538 (2009)

11.Wu dalin, Zheng Zhigang, Majisheng, et al.: Modeling and simulation of a self-propelled gun base on the virtual prototype technology. Proceedings of 6th International Symposium on Test and Measurement, Liaoning (2005)

12.Fabio Bruno, Maurizio Muzzupappa: Product interface design: A participatory approach based on virtual reality. International Journal of Human-Computer Studies 68(5), 254-269 (2010)

13. Zheng Yingli: Study on Experienced Virtual Lab. Shanghai (2008)

14.MultiGen-Paradigm, Inc: Vega Prime Programmer's Guide. U.S.A (2004)