• No results found

A Tool for Visualizing Properties of Paths for

N/A
N/A
Protected

Academic year: 2021

Share "A Tool for Visualizing Properties of Paths for"

Copied!
52
0
0

Loading.... (view fulltext now)

Full text

(1)

MASTER’S THESIS

2004:132 CIV

MATS STAFFANSON

A Tool for Visualizing Properties of Paths for

Autonomous Vehicles

MASTER OF SCIENCE PROGRAMME Department of Computer Science and Electrical Engineering

Division of Computer Science and Networking

(2)

A tool for visualizing and evaluating properties of paths for autonomous vehicles

Mats Staffanson April 26, 2004

(3)

Abstract

The shape of the path that a vehicle traverses affects the possible speed as well as the wear of the vehicle. That is why path planning becomes important when optimizing the use of an autonomous vehicle for these factors.

This report discusses the development of a tool for visualizing the paths and their properties for evaluation purposes. The tool is capable of visualizing the length, location, curvature and derivative of curvature of any path given as a sequence of 7th degree polynomials, as well as the corresponding environment.

For the specific vehicles used by the mining company LKAB the transport time, speed and limits in curvature and derivative of curvature are also visualized. The tool was developed in java and can therefore be used on several platforms.

(4)

Acknowledgments

This report presents the results of the work performed by the author at Lule˚a University of Technology during the second half of 2003. I would like to thank Tomas Berglund first of all for all the help, it has been absolutely essential, but also just for being such a nice guy. My supervisor H˚akan Jonsson and the project leader Kent Mrozek, for keeping me on the right track and giving lots of useful feedback. Ulf Erikson whom I’ve never actually met, but who left a lot of useful code behind. And finally Ulf Ohlsson, Mats Str¨omsten and Per-Olof Samskog for the opportunity to do this project.

Mats Staffanson Lule˚a, 2004-04-20

(5)

Contents

1 Introduction 6

2 The properties 8

2.1 Independent properties . . . . 8

2.1.1 Length . . . . 8

2.1.2 Curvature . . . . 8

2.1.3 Derivative of curvature . . . . 9

2.2 Dependent properties . . . . 9

2.2.1 Time and speed . . . . 10

2.2.2 Limits in manoeuvrability . . . . 11

3 Implementation 14 3.1 Importing the environment . . . . 14

3.1.1 Visualization of the environment . . . . 14

3.2 Importing the path data . . . . 15

3.2.1 Points . . . . 15

3.2.2 Segments . . . . 16

3.2.3 Visualization of the path data . . . . 16

3.3 Computing the properties of paths . . . . 17

4 Evaluation 20 4.1 Introduction . . . . 20

4.2 Using the map . . . . 20

4.2.1 Load the environment data . . . . 20

4.2.2 Zooming the map . . . . 20

4.2.3 Menu options . . . . 23

4.3 Examining a path . . . . 23

4.3.1 Selecting and building a path . . . . 25

4.3.2 Properties in the main panel . . . . 28

4.3.3 Properties in the graph panel . . . . 31

4.3.4 Properties in the speed panel . . . . 32

4.4 Comparing two paths . . . . 32

4.4.1 Comparison in the main panel . . . . 34

4.4.2 Comparison in the graph panel . . . . 37

4.4.3 Comparison in the speed panel . . . . 37

4.4.4 An example of comparing two paths . . . . 37

4.5 Verification of the computations . . . . 40

(6)

5 Discussion 44 5.1 Future work . . . . 44

A HDF sample file 47

B Test data 49

(7)

List of Figures

2.1 Definition of curvature. . . . . 9

2.2 Tamrock Toro 2500 electrical wheel loader. . . . 10

2.3 Time calculation of a path. . . . 11

2.4 Model of the wheel loader. . . . 12

3.1 The mining area map of area 82039 viewed with a CAD program. 15 3.2 The mining area map of Figure 3.1 as visualized by the program. 16 3.3 The mining area map from Figure 3.2 and visualized path data from an accompanying HDF file. . . . 18

3.4 Discrete calculation of curvature. . . . 19

4.1 The main and mini map windows. . . . 21

4.2 The file menu. . . . 21

4.3 Load file dialogue window. . . . 22

4.4 Main and mini map window with the map of area 82039 loaded. 22 4.5 Main and mini map window when zoomed in on part of a map. . 23

4.6 Main window showing the map menu. . . . 24

4.7 Main window showing the rulers and the view menu. . . . 24

4.8 Main and mini map window with path data loaded. . . . 25

4.9 Start point selected from path data. . . . 26

4.10 Main window with a path selected. . . . 26

4.11 Showing the paths sub-menu. . . . 27

4.12 Main window showing the active path. . . . 27

4.13 Showing location information of the path using the cross-hair. . . 28

4.14 Showing the paths curvature using curvature vectors. . . . 29

4.15 Showing the paths curvature using osculating circles. . . . 29

4.16 Showing the paths curvature using curvature radius vectors. . . . 30

4.17 Showing derivative of curvature vectors. . . . 30

4.18 Showing the curvature and derivative of curvatures as graphs. . . 31

4.19 The curvature graph and the curvature limit. . . . 32

4.20 The derivative of curvature graph and the limits. . . . 33

4.21 The speed diagram of the path. . . . 33

4.22 Selecting a path to compare that corresponds to the already ac- tive path. . . . 34

4.23 Comparing the safety distance to surrounding obstacles. . . . 35

4.24 Comparing the curvature vectors. . . . 35

4.25 Comparing the osculating circles. . . . 36

4.26 Comparing the curvature radius vectors. . . . 36

4.27 Comparing the derivative of curvature vectors. . . . 37

(8)

4.28 Comparing the curvature graphs. . . . 38

4.29 Comparing the derivative of curvature graphs. . . . 38

4.30 Comparing the speeds. . . . 39

4.31 The selected half-cycle . . . . 39

4.32 The curvature graphs. . . . 40

4.33 The derivative of curvature graphs. . . . 41

4.34 The speed graphs. . . . 41

4.35 The quarter circle and its 7th order Taylor approximation. . . . 42

4.36 The curvature and its derivative of the polynomial approximation of a unit circle computed by matlab. . . . 43

4.37 The curvature and its derivative of the same polynomial as in Figure 4.36 computed by the tool. . . . 43

(9)

Chapter 1

Introduction

Autonomous vehicles, or mobile robots, are currently mainly used in the indus- try where they are used for repetitious transportations that may be tedious or even dangerous for humans. The vehicles are often protected from public ac- cess, as safety is the most important aspect. Because of this the transition into public applications is slow, but very active. For example, systems have been incorporated into cars that can aid the driver to avoid collisions [8]. This could be considered to be the first step towards fully automated vehicles that move in everyday traffic, something that is likely to appear in the next few decades.

Automating the navigation of a vehicle generally consists of four steps, mod- eling the environment, planning a path, positioning of the vehicle and controlling the vehicle. The implementation of each of the steps is dependent on the appli- cation and is beyond the scope of this report. The focus here will be on already planned paths and how to evaluate them. Planning a path is not an easy task.

The shape of the path affects the maximum speed and the wear to the vehicle.

Smoother paths will allow for higher speeds and will cause less stress to the steering system. A good path should also make sure the vehicle is kept at a safe distance from obstacles. The problem of automatic generation of paths that are good in this sense is being studied at LTU (Lule˚a University of Technology) [3].

Once a path is produced it would be desirable to be able to visually verify it. To be able to see the path along with the environment will make it easy to determine if the path fulfills the most obvious requirements; that it transports the vehicle from the correct start point to the stop point in an allowable fashion (i.e. without colliding with obstacles, attempting dangerous cornering or simply that an undesirable route has been chosen). However, it is difficult, even for experienced people with deep understanding of the problem, to determine just from inspection what qualities a path has. For example, a path that appears smooth may have little curvature but a large derivative of curvature. Also is not possible to see properties dependent on the application, such as the traversal time of a specific vehicle along the path. This is why it would be useful to be able to visualize the path and its properties.

LKAB (Luossavaara Kirunavaara Aktiebolag) is a Swedish mining company located in Kiruna [4]. They use autonomous vehicles to transport iron ore within the mines. LKAB uses a system called LDS that can display paths and do calculations on their properties, but it has limited capabilities for visualization.

Other related work includes a tool written by Shin Yoshizawa for visualizing

(10)

the properties of a closed curve [13], but this tool is not intended for visualizing paths. Matlab [6], Mathematica [11] and Maple [5] are general tools that can be used for visualization. A program could also be written specifically for this purpose.

This report describes a tool that was developed to visualize paths, their properties and, optionally, the environment in which the paht resides. It allows for the comparison of two or more paths. It is written in java which makes it portable. It runs on most modern computers that has a graphical display, a mouse, a keyboard and a working copy of a recent JRE (Java Runtime Envi- ronment) [7]. The visualization is based on known principles. The tool is able to read arbitrary environments and paths from files using the DXF and HDF formats. The properties of the paths that are visualized are length, curvature and derivative of curvature.

In Chapter 3 the implementation of the program is outlined and its function- ality described. The functionality is evaluated in Chapter 4 through a number of examples. But first the properties that are visualized are formally described.

(11)

Chapter 2

The properties

The properties that are to be visualized can be divided into two types. Those that can be derived directly from a path independently of its origin and use, and those dependent on the application, such as the physics of a vehicle that drives along it.

2.1 Independent properties

The program can visualize the length, curvature and derivative of curvature for any path, provided that it is described using the HDF format. In this section the definitions of these properties are presented.

2.1.1 Length

Calculating the length of the path is done by integrating the paths arc length elements ds. Consider a curve that is the graph of a function y = f (x). Then ds =

r 1 +

dy dx

2

dx and the length s between point A and B on the path is given by

s= Z B

A

s

1 + dy dx

2

dx

provided that f has a continuous derivative in the interval [A, B].

2.1.2 Curvature

One of the most fundamental properties of a curve is its curvature. The curva- ture is a measure of the rate of curving or simply how much the curve bends.

Consider the path to be a curve that is traced at unit speed and is parameterized in terms of the arc length s.

r(s) =

 x(s) y(s)



The unit tangent vector

t(s) = dr(s) ds

(12)

x y

r(s)

t(s) n(s)

θ s

P R

Figure 2.1: Definition of curvature.

is in the direction of the curve for which s grows, as seen in Figure 2.1. The angle of this vector in relation to the positive x-axis is denoted θ. The signed curvature is defined as

k(s) =

ds (2.1)

The normal vector n(s) forms the counter-clockwise oriented frame with t(s).

From this definition, the sign of curvature changes if the direction of which the curve is traced changes, but the curvature vector k(s)n(s) does not depend on the direction. The figure also depicts the osculating circle in the point P . This is the circle that best approximates the curve in this point. The radius of the osculating circle can be shown to be

R= 1

k(s) (2.2)

The osculating circle is not defined for points where k = 0. For the proof of equation 2.2 see Reference [1].

2.1.3 Derivative of curvature

The derivative of curvature is calculated by differentiating equation 2.1 with respect to arc length.

dk(s) ds =d2θ

ds2 (2.3)

The sign of the derivative of curvature does not depend on the direction that the curve is traced. But since the normal vector n(s) changes orientation, the direction of the derivative of curvature vectork(s)ds n(s) changes with the direction of the trace.

2.2 Dependent properties

The properties described here are those specific for the paths used by LKAB.

They depend both on the characteristics of the paths as well as the vehicle and

(13)

the control system. The properties are time, speed and the limits placed on the paths curvature and derivative of curvature by the manoeuvrability of the vehicle.

In the following, HUNS (High speed Underground Navigation System) is the control system for the LHD (Load-Haul-Dump) vehicles used by LKAB. The LHD used is the Tamrock Toro 2500 [12]. It is an electrical wheel loader with articulated steering (Figure 2.2).

Figure 2.2: Tamrock Toro 2500 electrical wheel loader.

2.2.1 Time and speed

If transportation is a bottleneck in the production, the most important property is the time used by the vehicle to drive along the path. To calculate the time, all transportations are divided into three parts. The first part being of constant acceleration (a). Then a stretch of constant speed (vmax) and the final part being of constant deceleration (d). Let vstartand vstopbe the initial speed and the speed at the end of the path respectively. Let l be the length of the segment (Figure 2.3). The time of the acceleration and deceleration can be calculated using classical physics of motion.

ta= vmax− vstart

a td= vmax− vstop

d

The arc length is needed for the constant speed part of the path (smax) in order to calculate the time. This is done by determining the length of the acceleration and deceleration and subtracting them from the total length of the path.

sa= at2a

2 + vstartta

(14)

v

t vmax

vstart

vstop

ta ta+ tmax ttot

Figure 2.3: Time calculation of a path.

sd=dt2d

2 + vstoptd

smax= l − sa− sd

The total time is the sum of all the parts.

tmax= smax

vmax

ttot= ta+ tmax+ td

The time tmaxand length smaxis allowed to be negative, and they are so when the maximum speed never is achieved on the path.

The vehicle has four gears. The driving speed of each gear is specified in the documentation of the vehicle. However, they differ from the speeds that have been measured at LKAB. The measured values are the ones used to perform the time calculations above. The maximum speed (vmax) is given by the speed of the gear used. The power output to the wheels of the vehicle is about 165kW on average and it weighs from about 80 to 120 tonnes depending on the amount of loaded ore in the bucket. A weight of 85 tonnes gives a power-to-weight ratio of 1.9. Using this ratio the acceleration for each gear can be calculated as the power-to-weight ratio divided by the average speed on the gear. (Table 2.1).

The deceleration is measured to be constant at 0.9 meters per seconds for all gears.

2.2.2 Limits in manoeuvrability

The paths should not exceed the capabilities of the vehicle or the control system.

The steering angle of the vehicle is limited, which poses a restriction on the curvature of the path it follows. There is also a limit on how fast the steering can be done, this relates to the paths derivative of curvature. The maximum steering angle allowed by HUNS is 38◦ and the maximum derivative of steering angle is 10◦/s.

(15)

Gear Measured speed (m/s) Acceleration (m/s2)

1 1.0 3.8

2 1.9 1.3

3 3.1 0.8

4 5.0 0.5

Table 2.1: Gear speeds and accelerations.

A model of the vehicle was built from its technical specification. The distance from the front wheels to the joint is the same as for the back wheels and is denoted l. For this vehicle it is 2.55 meters. The steering angle is denoted α and the radius R (Figure 2.4). The figure shows that the radius could be

l l

R α

Figure 2.4: Model of the wheel loader.

calculated from the steering angle using trigonometry.

R= 2.55 tan α2

From Equation 2.2 the curvature can be calculated from the radius.

k(s) = tan(α2)

2.55 (2.4)

Setting α = 38◦ in Equation 2.4 gives the maximum allowable curvature for the path.

k(s) = tan

38

2



2.55 ≈ 0.135

To calculate the maximum derivative of curvature, differentiate Equation 2.4 with respect to s.

dk(s) ds =

ds

5.1 cos2(α2)

(16)

ds is the change in steering angle with respect to s. dt = dsdsdt where dsdt is the speed and dt is at most 10◦/s. We can also identify α as 2 tan−1(2.55k(s)) from Equation 2.4. Together this gives us an equation to calculate the maximum allowable derivative of curvature.

dk

ds = 10◦

5.1 cos2(tan−1(2.55k))dsdt (2.5) The limits placed on the derivative of curvature that has been calculated using this model depends on the speed and the curvature.

(17)

Chapter 3

Implementation

The program is written in Java [7] and the GUI (Graphical User Interface) is built using Swing which is a part of JFC (Java Foundation Classes). It consists of 21 classes in total. To compile it a version of J2SE (Java 2 Standard Edi- tion) 1.4.1 or later is needed. All computations are done using double precision arithmetic.

3.1 Importing the environment

The environment data is read by the program from a DXF (Drawing eXchange Format) file [10]. This is a format developed by Autodesk for storing technical drawings made by professional CAD programs. This makes it quite complex.

Figure 3.1 shows an example of a mining area map as used by LKAB when viewed with a CAD program that shows all the components of the drawing.

The level of detail presented would make it difficult to also show the path.

To visualize the environment only a subset of the DXF specification was implemented. Currently the LINE and POLYLINE entities are supported and only the X, Y and LAYER values are used. The difference between a LINE entity and a POLYLINE, is that the former simply contains two coordinates that define the endpoints of the line. The latter contains a set of VERTEX entities (i.e. points) that are connected by lines.

3.1.1 Visualization of the environment

The environment data uses a global coordinate system, which means that the drawing starts at an offset from the origin. This offset is needed for the visual- ization to be correct and it can be determined by finding the coordinates of the lower left corner. This can be done either by comparing all coordinates or by reading a variable in the DXF header.

To avoid unnecessary information to clutter the display, the user can select which layers of the drawing to show. The most relevant environment information is assumed to reside in a layer named “1”. This is the only layer the tool displays by default. This is also the way in which the mine area maps are drawn by LKAB, with all the mine walls residing in this layer. See Figure 3.2 for a view of the same mining area that only displays the information needed for the

(18)

Figure 3.1: The mining area map of area 82039 viewed with a CAD program.

visualization. Note how there still seems to be extra information, objects that are not a part of the mine walls. These are lines located in the same layer as the walls and can not easily be removed. As they are not a problem for visualizing the paths, no effort is made to attempt to remove them either.

3.2 Importing the path data

The path data contains the information from which it is possible to select paths.

The program imports path data from HDF (HUNS Definition Format) files.

The format was developed by the company Q-Navigator AB, that also devel- oped HUNS. HDF is a text format and it is divided into sections, each section starting with a tag. The HDF file has a lot of sections as it holds all the in- formation for controlling an LHD-vehicle, but for the visualization only two of these are needed; the points and the segments sections. Each section holds a specific number of tab separated values. The values are string representations of integers. An example of an HDF file can be found in Appendix A.

3.2.1 Points

The points section defines coordinates of way points, i.e. locations that the vehicle can visit. Between two points there may exist a route (a segment) that connects the points. A vehicle can get from one point that is not directly connected to another by visiting other points that are joined by segments. The

(19)

Figure 3.2: The mining area map of Figure 3.1 as visualized by the program.

segments are directed, so even if there exists a path (a sequence of segments) that connects point A with point B, there is no guarantee that B is connected with A. Each entry in this section has 8 values, listed in Table 3.1.

3.2.2 Segments

A segment defines the route between two points. A route is a 7th order polyno- mial and the segment defines its coefficients. The points and segments sections together defines a directed graph, only the nodes are called points and the edges are called segments. Each entry has 15 values, listed in Table 3.2.

When the path data is loaded, points and segments are stored in two arrays.

As denoted in Table 3.2, each segment identifies the start and stop points by the id value. To speed up the identification of the points later on, the s pnt and e pnt identifiers are replaced by the corresponding point’s index in the points array. This is done by simply looping through all points twice for each segment, looking for the correct identifier.

3.2.3 Visualization of the path data

Figure 3.3 shows the mining area with the HDF data displayed. The points are drawn as circles. This makes them visible and allows the user to click them.

The segments are drawn as lines. Note that the segments polynomial are not

(20)

Name Description

id The id number of the point.

x The points x coordinate.

y The points y coordinate.

theta The direction of the vehicle in this point.

K The curvature of the path (not used here).

Ks The derivative of curvature (not used here).

nbrin The number of segments leading into the point (not used here).

nbrout The number of segments leading out of the point (not used here).

Table 3.1: Table of the values of an entry in the points section in the HDF file.

evaluated and visualized. The line only indicates that a segment exists between two points. The direction of the segment is not indicated.

The user builds a path by selecting the points that should be a part of the path. The program then attempts to find segments connecting the points. This is done using the depth first search algorithm [2] with cycle detection. If multiple paths are found, the shortest is selected. Points that have been selected turn red to provide the user with feedback. If and only if a path is found between the points, the segments in the path will also turn red, and the user can choose to make the path active via a menu option. This will cause the polynomials of the segments in the path to be evaluated, the properties to be computed and the visualization of the path to begin.

3.3 Computing the properties of paths

To compute the properties of a path, the polynomials are first evaluated between 0 an 1. The number of points it is evaluated at, is the desired number of plot points per meter times the segment length. The plot points of each segment are scaled and rotated to fit between the start and stop point and are stored in two arrays called x and y. The plot points are then used to calculate the curvature using discrete versions of the equations in Chapter 2. The angle element dθ is approximated by

∆θi= tan−1 yi+1− yi

xi+1− xi



− tan−1 yi− yi−1

xi− xi−1



and the arc length element ds by

∆si=p(xi− xi−1)2+ (yi− yi−1)2

(21)

Name Description

id The id number of the segment.

speed Maximum allowable speed.

length The length of the segment.

s pnt The id number of the start point.

e pnt The id number of the end point.

plist Parameter list (not used here).

attr Attributes of the segment (not used here).

a7 Seventh order coefficient of the polynomial.

a6 Sixth order coefficient of the polynomial.

a5 Fifth order coefficient of the polynomial.

a4 Fourth order coefficient of the polynomial.

a3 Third order coefficient of the polynomial.

a2 Second order coefficient of the polynomial.

a1 First order coefficient of the polynomial.

a0 Constant coefficient of the polynomial.

alpha Segment direction correction.

Table 3.2: Table of the values of an entry in the segments section in the HDF file.

Figure 3.3: The mining area map from Figure 3.2 and visualized path data from an accompanying HDF file.

(22)

x y

θi

∆θi

∆si

(xi, yi)

Figure 3.4: Discrete calculation of curvature.

(23)

Chapter 4

Evaluation

4.1 Introduction

In this chapter the program is used both to visualize the properties of a single path and to compare the properties of two paths. This is done by guiding the reader through a number of examples where actions are performed and their consequences in terms of visualizations are given. This serves to motivate that the program works as intended. The examples also shows the functionality of the program.

4.2 Using the map

When the program is started, two empty windows are opened. The Main Win- dow and the Mini Map (Figure 4.1). The main window has a menu bar with the following menus; File, View, Map and Paths. Only the file menu is available at this point. Menus were used because it is an easy and well known way for users to make selections [9].

4.2.1 Load the environment data

Selecting the File menu (Figure 4.2) and then selecting the Load (map/path) menu item opens a dialogue window that allows the user to browse for envi- ronment data and path files (Figure 4.3). A map does not have to be opened to visualize a path, but without it there will be no visual verification of the location of the path. When a file containing the environment data is selected both the main and mini map windows show the map (Figure 4.4).

4.2.2 Zooming the map

By pressing the mouse button and dragging the mouse in either of the windows, a rectangle appears to indicate the selection. When the button is released, the main window will be zoomed in on that area. (Figure 4.5). The main purpose of the mini map is to make it possible for the user to navigate the map. At all times the mini map shows a picture of the entire loaded environment in which the area shown in the main window is marked with a rectangle. This gives the

(24)

Figure 4.1: The main and mini map windows.

Figure 4.2: The file menu.

(25)

Figure 4.3: Load file dialogue window.

Figure 4.4: Main and mini map window with the map of area 82039 loaded.

(26)

Figure 4.5: Main and mini map window when zoomed in on part of a map.

user good overview. By pressing the mouse button inside the rectangle of the zoomed area and dragging the mouse, the user can quickly move around the map. This can also be done by using the scrollbars in the main window. To zoom out again select an area in the mini map window outside of the rectangle.

4.2.3 Menu options

When a map is loaded, the view and map menus are enabled. Selecting the Map menu (Figure 4.6) shows all the layers, presented as check-box options in the menu. By default only layer 1 is shown, but by using the check-boxes, the user can select which layers to visualize. At the top there is an option Show map that enables the user to select if the map should be visualized at all. And at the bottom of the menu there is also an option to close the map.

In the view menu only one option is available, Show rulers. Selecting this option will show rulers in the left and bottom part of the main window, see Figure 4.7 for an example of the rulers while showing the view menu. The rulers show the coordinates of the map. The unit used is the same as the one used to produce the map. In the figure the rulers coordinates is given in meters as it is the unit used by LKAB.

4.3 Examining a path

Loading a file with path data is done in the same way as loading a map. The path data is however only displayed in the main window (Figure 4.8).

(27)

Figure 4.6: Main window showing the map menu.

Figure 4.7: Main window showing the rulers and the view menu.

(28)

Figure 4.8: Main and mini map window with path data loaded.

4.3.1 Selecting and building a path

Selecting a start point for the path is done by clicking on the circle of that point.

The point turns red and its id number is displayed (Figure 4.9). The path of interest is selected by pressing the shift key and clicking on additional points on the path. If there exists a path between the points, the lines representing segments also turns red. Every point along the path does not have to be selected, as the program can find the shortest path between between two points if there exists one. It is only if a path is wanted that is longer than the shortest one, that points other than the start and stop points need to be selected. In Figure 4.10 an additional point is selected and a path between them found. When using the program, the selected path is easy to see as it is red, the figure may however not be as informative if it is printed in grayscale. The selected path extends from point 1 to point 24. If the user by mistake selects the wrong point, it can be unselected by shift-clicking it again.

When the user has selected the path of interest, the path should be made active. This means its polynomials are evaluated and its properties calculated.

This is done by selecting the paths menu and entering the sub-menu with the name of the HDF file (at this point there is only one), as in Figure 4.11, and selecting the Build active path option. This option is only enabled once a path is selected from the path data. The path data (all the lines and circles) will now disappear from the main window, except those in the selected path, which are replaced by the evaluated path (Figure 4.12).

(29)

Figure 4.9: Start point selected from path data.

Figure 4.10: Main window with a path selected.

(30)

Figure 4.11: Showing the paths sub-menu.

Figure 4.12: Main window showing the active path.

(31)

4.3.2 Properties in the main panel

Once the active path is built, the user can click on the path and a cross-hair appears. The cross-hair comes with a box that shows the x and y coordinates of the cross-hair and the length along the path from the start point. If the mouse button is kept pressed, the cross-hair can be dragged to show the information along the path (Figure 4.13).

Figure 4.13: Showing location information of the path using the cross-hair.

The curvature of the path can be visualized in three ways, by selecting the options in the menu. Selecting Show curvature displays curvature vectors along the path (Figure 4.14). The length of the vectors can be adjusted using the slider named Curvature vector length in the view menu. One drawback of the curvature vectors is that they do not have a direct physical interpretation. That is why the curvature also can be visualized by the osculating circles. They give a direct indication of how much the vehicle must steer, as it is the circle the vehicle would follow if the steering angle from that point on would not change.

(Figure 4.15). Finally the curvature can be shown as the vectors of the curvature radius, which is the radius of the osculating circles (Figure 4.16). The radius vectors and osculating circles are only shown on points of the curve where the curvature radius is less than 50 meters. Larger circles and radius vectors would become too large to visualize properly.

The derivative of curvature can also be shown as vectors by selecting Show derivative of curvature (Figure 4.17). From studying the figure, it is apparent that even where the path appears straight, the derivative of curvature can be large, but in the middle of the corner it is actually zero. These conclusions would be hard to make from just looking at the path.

All properties that can be displayed can be selected to be shown simulta- neously, but it is recommended to only show one or two at the same time,

(32)

Figure 4.14: Showing the paths curvature using curvature vectors.

Figure 4.15: Showing the paths curvature using osculating circles.

(33)

Figure 4.16: Showing the paths curvature using curvature radius vectors.

Figure 4.17: Showing derivative of curvature vectors.

(34)

otherwise they may be difficult to see.

The Show points, Show point names and Show segment names check-boxes are also available now. Unselecting Show points causes the circles, that are shown in the main window to represent the points, to disappear. Selecting Show points names and Show segment names draws the id numbers of the points and segments respectively. This can clutter the display if it is not zoomed in. These last two are mainly useful when the HDF file needs to be edited manually.

4.3.3 Properties in the graph panel

In the view menu, selecting the Show graph panel button clears the main win- dow of the map and path and instead it shows graphs of the paths curvature and derivative of curvature. The graphs gives more precise information of the curvature and its variation, but then the location can not be visualized.

The cross-hair can be used also in this panel, but when tracing the graph it displays the arc length and depending on which graph is being traced, the curvature or derivative of curvature. If the cross-hair is in use when changing panels, it shows the same point on path in the new panel. This way, points that are of interest because of their properties in one panel, can be examined for other properties in the other panels. In Figure 4.18 the derivative of curvature is being traced. Using the view menu, the user can select if the curvature and/or its derivative should be shown. The ruler is on by default in this panel. The graphs are functions of the arc length s.

Figure 4.18: Showing the curvature and derivative of curvatures as graphs.

The user can also select to show the limits in curvature and/or derivative of curvature. As these limits are dependent on HUNS and the LHD, they are specific for the paths used by LKAB. Figure 4.19 shows the curvature and the curvature limit. From the figure you can tell that the curvature limit of 0.135

(35)

is exceeded. Figure 4.20 shows the derivative of curvature and its limits. There

Figure 4.19: The curvature graph and the curvature limit.

are four limits for the derivative of curvature as it is dependent on the speed of the vehicle, one for each gear. The limits are are drawn for both positive and negative values as it is the absolute value of the derivative that is limited. By looking at the figure it can be determined which gear is allowed on each part of the path. The fourth limit in derivative of curvature, as well as the curvature limit is drawn in red (not seen in the figures), as these are hard limits.

4.3.4 Properties in the speed panel

The last panel is the speed panel. Figure 4.21 is a diagram of the speed of the path as traveled by a vehicle with constant acceleration. Important to note here is that the speed diagram is not a function of arc length, but a function of time.

The cross-hair will give information about the speed, acceleration, the elapsed time, and the position along the path. The maximum speed on each segment is specified in the HDF file, but the acceleration and deceleration is dependent on the vehicle, as shown in Section 2.2.1 and they can be specified by the user via the Settings menu option.

4.4 Comparing two paths

Comparing two paths is done by first opening one more HDF file. If a path is selected that corresponds to the first, i.e. the path is intended for transportation to the same point (or points) as the first path. In Figure 4.22, a path is selected that corresponds to the existing active path. The program allows the user to

(36)

Figure 4.20: The derivative of curvature graph and the limits.

Figure 4.21: The speed diagram of the path.

(37)

Figure 4.22: Selecting a path to compare that corresponds to the already active path.

compare any two paths, but if the paths do not correlate well a comparison is pointless. This is left to the user to decide.

When the selected path is made active, the properties of both the paths can be visualized simultaneously and compared. Just by visualizing the paths and the environment, it is possible to tell which of the two paths is the safer one in terms of the distance to surrounding obstacles (Figure 4.23). When there are two active paths it could become difficult to tell them apart. By using the cross-hair, the paths properties are shown in the cross-hair box with the clicked path listed first. The other path’s properties is also listed in the box and it also has a cross-hair. The points on the paths where the cross-hairs appear are such that the percentage of traced length is the same for both paths.

4.4.1 Comparison in the main panel

Showing the curvature vectors for both paths simultaneously allows for compar- ison (Figure 4.24). The figure shows that path1 has greater maximum curvature, as its curvature vectors extend beyond those of path2. Using vectors to compare the paths curvatures gives an indication of the amount of curvature as well as the location of the curvature. This gives the user a direct indication of where on the path the curvatures differ. Osculating circles and curvature radius vectors can also be used for comparison (Figure 4.25 and 4.26). The innermost oscu- lating circles of the two paths as well as the focal points of the radius vectors tells which path has the most curvature. The derivative of curvature can be compared in the same way by using the vectors (Figure 4.27). The two paths and their properties are drawn in separate colors to make it easier to distinguish between the two.

(38)

Figure 4.23: Comparing the safety distance to surrounding obstacles.

Figure 4.24: Comparing the curvature vectors.

(39)

Figure 4.25: Comparing the osculating circles.

Figure 4.26: Comparing the curvature radius vectors.

(40)

Figure 4.27: Comparing the derivative of curvature vectors.

4.4.2 Comparison in the graph panel

Comparing the curvature of the two paths can also be done by displaying both their graphs (Figure 4.28). The derivative of curvature is also easily compared (Figure 4.29).

4.4.3 Comparison in the speed panel

As the speed diagram is drawn as a function of time, it is easy to see which path is faster. The difference in total time for the two paths is also easily examined, and the visualization makes it possible to see how big the difference is compared to the total time (Figure 4.29).

4.4.4 An example of comparing two paths

As an example of how the tool is intended to be used, I will now show how an actual path used by LKAB to transport the iron ore inside the Kirunavaara mine is compared to the corresponding path that is generated at LTU [3]. A cycle is defined as the loading of the vehicle with ore at the blast site, reversing the vehicle up to a point where it can stop, change direction and then go forward to the shaft where the ore is dumped and finally go back to the blast site.

Since the vehicle traverses the same path in both directions, only half a cycle is considered here. Figure 4.31 shows the paths. They start at bottom of the development drift (in the uppermost part of the figure) and end at the dump shaft. By just looking at the figure we can see that the LTU generated path is selected in a way that intuitively feels faster, since the straight stretches are used to ease the cornering to a greater degree.

(41)

Figure 4.28: Comparing the curvature graphs.

Figure 4.29: Comparing the derivative of curvature graphs.

(42)

Figure 4.30: Comparing the speeds.

(a) LKAB (b) LTU

Figure 4.31: The selected half-cycle

(43)

By examining the curvature graph (Figure 4.32) we can see that during the first two corners, the LTU generated path does have less curvature. However, during the last two corners the curvature is no less than for the LKAB generated one, because there is not enough room for the vehicle to make a wider turn.

Figure 4.32: The curvature graphs.

Comparing the derivative of curvature graph (Figure 4.32) of the two paths, shows that the wider turns in the first two corners gives a much improved derivative of curvature. As this is the property that limits the choice of gear, we could expect a path that is faster to traverse.

Figure 4.34 shows the speed diagram. Here we can see that the overall improved derivative of curvature has reduced the traversal time of the half- cycle by 26 seconds (or almost 30%). This is a somewhat coarse estimate when considering the complete cycle, as no regard is taken to the loading, dumping or other sources of delay. However, it does give some hint as to how much faster the path in itself could be. Finally, the comparing paths as described in this section is not limited to two paths. Several paths can be compared simultaneously if the user loads more HDF files.

4.5 Verification of the computations

Though the program can not be guaranteed to compute the properties correctly, it can be shown for selected input to give correct results. For a function of one variable, y = f (x), the curvature can be shown [1] to be

k(x) =

d2y dx2

(1 + (dxdy)2)32 (4.1)

(44)

Figure 4.33: The derivative of curvature graphs.

Figure 4.34: The speed graphs.

(45)

Differentiating this equation with respect to arc length s gives the derivative of curvature for the function.

dk(x) ds =

d3y

dx3(1 +dxdy2) − 3dydxddx2y22

(1 +dxdy2)3 (4.2)

The best way to test the correctness of the computations would be to use a path with known curvature and derivative of curvature. I have chosen to test the program with a quarter of a circle, since circles have constant curvature (re- member that the curvature is the reciprocal of the circles radius). The equation of a circle is R2 = x2+ y2, where R is is the circles radius. Choosing a unit radius gives the circle unit curvature. The quarter circles equation becomes y = sqrt1 + x2 for x = [0, 1]. The program only handles polynomials of the 7th order, so using Taylor approximation a suitable polynomial is produced to replace the function. Appendix B for the matlab code. Figure 4.35 shows the true quarter circle (dash-dotted) and its approximation (solid). The Taylor ap-

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

Figure 4.35: The quarter circle and its 7th order Taylor approximation.

proximation is calculated around the point where x = 0.5. The curvature and its derivative of the polynomial was computed using the previous equations (4.1 and 4.2). As seen in Figure 4.36 the curvature (dashed) is not constantly one and the derivative of curvature (solid) is not constantly zero. This is of course due to the approximation. But notice that they do approach the expected val- ues in the center of the plot (around the point were the approximation was made). Plotting the polynomial in the program yields the result seen in Figure 4.37. Comparing the two figures (4.36 and 4.37) the conclusion is that the tool produced the correct result for this input.

(46)

0 0.2 0.4 0.6 0.8 1 1.2

−15

−10

−5 0

Figure 4.36: The curvature and its derivative of the polynomial approximation of a unit circle computed by matlab.

Figure 4.37: The curvature and its derivative of the same polynomial as in Figure 4.36 computed by the tool.

(47)

Chapter 5

Discussion

The examples in Chapter 4 motivates that the program is useful for visualizing paths and their properties. The test of computing the properties of a known path motivates that the computations are correct. The program has been used with real data from LKAB as well as data generated at LTU. And it has been tested by Kent Mrozek, who has years of experience in working with autonomous vehicles. This in turn is reason to believe that the program works as intended.

5.1 Future work

As with any programming project, the work is never really done. There are still bugs in the program that are yet to be fixed. And there is always functionality that could be added. This includes visualization of the speed in the main panel.

One way of doing this could be by drawing vectors that are shorter than the curvature vectors, but closer together and in both the positive and negative direction of the paths normal vector. The length of these vectors would be scaled by the inverse of the speed of the vehicle. This way the slow parts of the curve would become more visible. Also, a better way of indicating the distance between two points than just using the rulers would be desirable. An easy way of doing this would be to allow the user to click on two points on the map and to display the distance between the points. Another feature that could be interesting, would be to implement a model of the vehicle and let it traverse the path in real-time. Finally, if the user was able to use the program generate paths from the environment data and then modify them (if they in some way don’t fit the users needs) using the information about their properties, then the program would be complete. Naturally, there is a lot of work left for all this to work.

A user study should be performed to properly evaluate the quality of the visualization and the user interface. And even though the program runs accept- ably on a normal computer, it should be profiled and optimized.

(48)

Bibliography

[1] Alexander Belyaev. Plane and space curves. curvature. curvature-based fea- tures. Retrieved 24 Sep. 2003 from the World Wide Web: http://www.mpi- sb.mpg.de/∼belyaev/Math4CG/Math4CG.html.

[2] T. Corman, C. Leiserson, and R. Rivest. Introduction to Algorithms. MIT Press and McGraw Hill, 2nd revision edition, 2001. ISBN 0-262-03293-7.

[3] H˚akan Jonsson. Algorithms for planning smooth and safe paths for transports. Retrieved 14 Jan. 2003 from the World Wide Web:

http://www.sm.luth.se/∼hj/proj/avt.

[4] LKAB. Retrieved 16 Dec. 2003 from the World Wide Web:

http://www.lkab.com.

[5] Maplesoft. Maple. Retrieved 3 Jan. 2003 from the World Wide Web:

http://www.maplesoft.com/products/maple/.

[6] MathWorks. Matlab. Retrieved 3 Jan. 2003 from the World Wide Web:

http://www.mathworks.com/products/matlab/description1.jsp.

[7] Sun Microsystems. Java technology. Retrieved 12 Jan. 2003 from the World Wide Web: http://java.sun.com/.

[8] Multimedia Innovation Telematics Observatory. Advanced driver assis- tance systems. Retrieved 10 Jan. 2003 from the World Wide Web:

http://www.elios.dibe.unige.it/mito/adas.htm.

[9] J. Preece, Y. Rogers, and H. Sharp. Interaction Design. Wiley, 1st edition, 2002. ISBN 0-471-49278-7.

[10] Scott Prentice. Autodesk autocad dxf reference version u15.0.02. Retrieved 1 Oct. 2003 from the World Wide Web:

http://www.autodesk.com/techpubs/autocad/acad2000/dxf/index.htm.

[11] Wolfram Research. Mathematica. Retrieved 3 Jan. 2003 from the World Wide Web: http://www.wolfram.com/products/mathematica/index.html.

[12] Sandvik Tamrock. Toro 2500 Electric Technical specification L002500E-1. Retrieved 16 Dec. 2003 from the World Wide Web:

http://www.toro.sandvik.com/.

(49)

[13] Shin Yoshizawa and Alexander G. Belyaev. Visualization and study of dynamic 2d shapes via curvature. In International Conference on Multi- media Modeling 2000, pages 469–489, Nagano, Japan, 13-15 Nov. 2000.

Retrieved 19 Aug. 2003 from the World Wide Web: http://www.mpi- sb.mpg.de/∼shin/mmm2000.ps.gz.

References

Related documents

46 Konkreta exempel skulle kunna vara främjandeinsatser för affärsänglar/affärsängelnätverk, skapa arenor där aktörer från utbuds- och efterfrågesidan kan mötas eller

Both Brazil and Sweden have made bilateral cooperation in areas of technology and innovation a top priority. It has been formalized in a series of agreements and made explicit

För att uppskatta den totala effekten av reformerna måste dock hänsyn tas till såväl samt- liga priseffekter som sammansättningseffekter, till följd av ökad försäljningsandel

The increasing availability of data and attention to services has increased the understanding of the contribution of services to innovation and productivity in

Generella styrmedel kan ha varit mindre verksamma än man har trott De generella styrmedlen, till skillnad från de specifika styrmedlen, har kommit att användas i större

I regleringsbrevet för 2014 uppdrog Regeringen åt Tillväxtanalys att ”föreslå mätmetoder och indikatorer som kan användas vid utvärdering av de samhällsekonomiska effekterna av

Parallellmarknader innebär dock inte en drivkraft för en grön omställning Ökad andel direktförsäljning räddar många lokala producenter och kan tyckas utgöra en drivkraft

Närmare 90 procent av de statliga medlen (intäkter och utgifter) för näringslivets klimatomställning går till generella styrmedel, det vill säga styrmedel som påverkar