• No results found

Scenario 1: Navigation Simulation with Static Objects (Room)

CHAPTER 8: NAVIGATION MODELLING BASED-ON VISION RAYS

8.4 Scenario 1: Navigation Simulation with Static Objects (Room)

A room scene as a flat-surface platform was designed using Unity. Room assets were imported and included (such as a bed, chest drawers, a wardrobe, a file cabinet and chairs) to simulate a living environment that a CVI patient might live in, see Figure 8.6 below.

The purpose of designing such room is the common environment and every day place for the patient to live; and it is designed to use different obstacles in terms of

Figure 8.6: Room scene with static furniture and objects

Navigation Scenarios Static Objects Moving Objects

Stair Room

Upstairs Downstairs Room

84

height and size. Some of them are low obstacles such as tables and chairs, others are tall like walls and wardrobe and the hanging ones like chandeliers.

Since the avatar has a 15 by 15 2-D array of rays, the computations and

comparisons to check the whole visual field at each frame for hit events, distances, best angle for the best route and a proper decision to take an action will be long and complicated. Therefore, the algorithm divided the whole VF into three fields to ease the process of these computations and comparisons. Besides, as it mentioned, vision relies on the central VF during the navigation then onto the lateral VF, therefore, instead of checking the central columns which consist of 15-row elements each, it’s enough to check few central elements in the Column Hit Map vector. If any of these columns hit and the hit object is static (will be explained in detail in the moving object scenario) and the distance between the avatar and the obstacle is less or equal to the allowanced distance then according to the

computations for decision-making, the avatar will turn away from the obstacle. Since the height of the avatar is variant by the assigned height value in the Awake function, the avatar height might represent the height of a child. So, the distance between the avatar rays’ object and the ground will be smaller than the allowanced distance. Therefore, the avatar will keep turning round and round as the condition of the distance will be fulfilled. Therefore, the perpendicular distance between the rays’ object and the main ground will be calculated to represent the inferior

allowanced distance.

The same processing will be done with the central inferior VF to detect and avoid the low objects, such as coffee tables, balls, boxes, etc. The comparisons of the inferior VF will be overlapped with the rest of the central VF; because in some cases the central VF rays would be free with no hit events, while the inferior rays would hit small and low obstacles. Taking into consideration the navigation

85

decisions; the avatar will check the left and the right existence of the side obstacles too. This lateral VF check is similar to the process of central VF except the

minimum distance allowance will be the lateral allowable distances.

If the condition of the ray hit does not exist, this means the obstacle had not been seen. As a result, the avatar will keep stepping forward until it hits this obstacle. Then it will escape away using its clearest half of vision and by a small amount of turning angle. This simulates the impaired and blind people when they bump into something, they use their hands to touch the obstacle and turn away from it using small steps and a small amount of turning away angles.

Bumping event caused by the collider physics for both the obstacle and the avatar. When the avatar capsule collider touches (Unity enter event) other obstacles’ colliders, then the decision of turning away will be made. This turning away will continue until the avatar collider doesn’t touch any other colliders (Unity exit event). An audio source is attached to the avatar, so, whenever the colliding event takes place this audio will be played. The following Figure 8.7 shows the algorithm for navigating environments with static objects.

The processes for navigating the CENTRAL visual field:

Check the central elements of the column hit vector; if any hit then Check the hit object is static then

Check the minimum distance vector

If the distances in the central vision are less/equal to the allowanced distances of the central VF or the central inferior VF then

Turn away.

If these distances still greater than the allowanced distances then Move ahead.

If there no hit and the avatar hit the obstacle then the avatar will Bump and escape away.

The processes for navigating the RIGHT lateral visual field:

Check the right elements of the column hit vector; if any of the last elements hit then Check the hit object is static then

86

Check the minimum distance vector

If the distances in the right vision are less/equal to the lateral allowanced distances of the right VF or the right inferior VF then

Turn away.

Else if the avatar hit the obstacle then Bump and escape away.

The processes for navigating the LEFT lateral visual field:

Check the left elements of the column hit vector; if any of the first elements hit then Check the hit object is static then

Check the minimum distance vector

If the distances in the left vision are less/equal to the lateral allowanced distances of the left VF or the left inferior VF then

Turn away.

Else if the avatar hit the obstacle then Bump and escape away.

Figure 8.7: Navigation algorithm according to the central and lateral visual field