# Dynamic Proxemic Model for Human-Robot Interactions Using the Golden Ratio
## 4 System Architecture  
The described proxemic model was transformed into the working system for testing. The system architecture was designed with modularity, platform independence, and real-time processing in mind. It combines visual perception, spatial modelling, and control logic into a unified software pipeline deployable on different mobile robots. Person detection and spatial information are crucial parts for determining safety and comfort in a human-robot environment. For this task, the ZED 2i depth camera and the ZED SDK 4.2 developed by Stereolabs [34] were used for acquiring real-time information on the location and movement of people. This data serves as input for the calculation of safety and comfort zones and subsequent control of the robot's speed. To verify the functionality, a visualisation of the zones in the space was also created. Part of the ZED SDK is the Object Detection module, which is used to detect and track people (see Figure 4). This module can retrieve a 2D bounding box from an image, as well as a 3D bounding box from a point cloud. With the tracking feature enabled, the system can maintain each detected person's ID over time even while temporarily occluded. All detected person's information, such as ID, position, bounding box, etc, is stored in the _Objects_ list. After the successful detection and tracking of a person, the system can obtain all necessary information to calculate their safety and comfort zones. The structure for computing the zones and robot speed is provided by multiple functions, as shown in Figure 5. The calculations from the previous section had to be translated into code. Figure 4: Person detection using ZED camera. First, the basic parameters are initialised as Gaussian function parameters \(\sigma_{x}\), \(\sigma_{y}\) and \(A\) (_sigma_x_, _sigma_y_, _A_), the robot reaction time (\(t_{1}\) and \(t_{2}\)), the distance from the camera to the edge of the robot (_robot_size_), the robot max speed (\(v\_robot\_max\)), and the default maximal distance (_d_max_). With these parameters, a default safety distance is defined. Then the script loops through the _Objects_ list of all detected persons and skips all that are no longer tracked, whose status is terminated. For each valid person, their velocity and actual distance to the robot are calculated. Then, it checks whether a bounding box is known for the person. If yes, the default safety distance is then compared to the person's radius based on the distance from the person's centroid to one edge of the 3D bounding box to match the volume of the person's occupied space. Subsequently, a safety zone is determined either by using the default safety distance or a newly adjusted safety distance. Based on the safety zone, comfort zones are generated using the golden ratio (\(\varphi\)). To deform these zones according to the person's movement, the velocity factor \(f\_v\) is added to the safety zone calculation (see Algorithm 1). Figure 5: Flowchart of system core structure. ```
\(min\_safety\_dist=default\_safety\_dist+robot\_size\) if(person.bounding_box!= None):  person_radius = math.sqrt((person.bounding_box[0][0]-person.position[0]) ** 2+ (person.bounding_box[0][2]-person.position[2]) ** 2) if(person.radius > default_safety_dist:  min_safety_dist = person_radius + robot_size safety_zone = v*f_v*(t_1 + t_2) + min_safety_dist comfort_zones = [] fori inrange (5):  comfort_zone = safety_zone * golden_ratio ** i comfort_zones.Append(comfort_zone)
```  
**Algorithm 1** Safety and comfort zone calculation  
The heading factor _f_h and velocity factor _f_v influence the expansion parameters _sigma_x_ and _sigma_y_ of the 2D Gaussian function. To check the person's direction of movement, the angle _theta_ is calculated (see Algorithm 2). When the person is facing away from or sideways to the robot, _f_h is set to 0.2. As the person turns towards the robot, _f_h gradually increases, reaching a maximum of 1.0 when the person is directly facing the robot.