{'fraction_non_alphanumeric': 0.03336858612012691, 'fraction_numerical': 0.009518252434265708, 'mean_word_length': 4.649361351462711, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 1, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Mapless Humanoid Navigation Using Learned Latent Dynamics

In this paper, we propose a novel Deep Reinforcement Learning approach to address the mapless navigation problem, in which the locomotion actions of a humanoid robot are taken online based on the knowledge encoded in learned models. Planning happens by generating open-loop trajectories in a learned latent space that captures the dynamics of the environment. Our planner considers visual (RGB images) and non-visual observations (e.g., attitude estimations). This confers the agent upon awareness not only of the scenario, but also of its own state. In addition, we incorporate a termination likelihood predictor model as an auxiliary loss function of the control policy, which enables the agent to anticipate terminal states of success and failure. In this manner, the sample efficiency of the approach for episodic tasks is increased. Our model is evaluated on the NimbRo-OP2X humanoid robot that navigates in scenes avoiding collisions efficiently in simulation and with the real hardware.


I. INTRODUCTION
Mobile robot navigation typically requires a robot to traverse a series of static and dynamic obstacles in the environment to reach desired target poses, e.g., by walking with pedestrians on sidewalks. Traditional methods tackle this problem by processing raw sensor information (e.g., RGB images or laser scans) in order to construct local maps for path planners [1][2][3]. Traditional approaches, however, lose expressivity with the increment of uncertainty and complexity of the environments mainly because of computational limitations associated with high-dimensional systems and real-time constraints. In the last decade, the rapid advances of learning methods have paved the path for an increasing development of robot learning approaches, which are a promising alternative to solve these issues by leveraging data [4][5][6][7][8].
In this paper, we address the problem of mapless navigation, in which the robot needs to reach a known relative target pose without constructing a map of the environment. The target pose is assumed to be given by higher-level modules (e.g., object detection, semantic segmentation or Wi-Fi signal localization). Several Deep Reinforcement Learning (DRL) approaches have been proposed to solve this problem based on 3D data (e.g., laser scans) [9][10][11]. In our approach, however, the environment is perceived by RGB-only images which, in contrast to depth data, render a harder problem for planning, since no direct measurements to object distances are provided. Our learned path planner considers additionally non-visual observations such as IMU measurements. In this manner, the planner can act upon large instabilities of the robot posture in order to avoid falls. * Authors with equal contribution. All authors are with the Autonomous Intelligent Systems (AIS) Group, Computer Science Institute VI, University of Bonn, Germany rodriguez@ais.uni-bonn.de Our approach is able to plan collision-free paths without local maps by learning a latent world model and by imagining possible future outcomes based on learned models. These open-loop (imagined) trajectories address the problem of lack of memory of Markov Decision Processes which are typically used to formulate Reinforcement Learning (RL) tasks. Re-planning happens implicitly with each new inference step. This allows our approach to handle uncertainty present in scenarios with dynamic obstacles.
In order to handle episodic tasks, as the one discussed here, we incorporate a predictor model that infers a termination likelihood and provides this information to the control policy as an auxiliary loss. We explicitly differentiate between successful and failed terminal states; the former encourages the agent to finish the episode collecting a high reward, while the latter contributes to the sample efficiency and training time reduction by neglecting experiences collected during failed terminal states, e.g., when the robot is lying on the floor after falling.
We evaluate our approach on a real autonomous humanoid robot (Fig. 1). To handle the sim-to-real transfer, segmented images are employed for training the learned models, which in conjunction with noise injection and system identification allows to transfer the control policy to the real robot without retraining.
In summary, the main contributions of this paper are: • the introduction of a termination likelihood predictor to handle multiple terminal states specially relevant for episodic tasks; • and the demonstration on a real humanoid robot of the learned policy for mapless navigation.

II. RELATED WORK
Previous research on visual control problems, in which an agent takes actions based on image observations, has led to multiple analytical open-loop approaches [12][13][14]. To address the typical shortcomings of analytical solutions, especially related to the curse of dimensionality, novel learningbased methods have called the attention of the community due to their generalization capabilities to uncertainty and due to the inference time that enables their usage in real-world tasks [15][16][17].
Particularly, RL approaches have gained increased popularity in robotics, where policies are learned by interaction with the environment. Popular model-free RL methods, such as DQN [18], aim to construct a state-action value function (Q-value) that quantifies the quality of state-action pairs to maximize an accumulative reward in the long term [4][5][6]. Other model-free RL approaches, called policy gradient methods, construct a policy by optimizing a cost function directly, such as D4PG [7] and PPO [19]. Although these RL methods have been successfully implemented in robotics applications [11,20] including visual control tasks [15,21], the training with raw images requires a large amount of data-due to the absence of a learned dynamics model, which could encode the state evolution effectively.
While model-free RL approaches are often straightforward to employ, model-based methods can be more sampleefficient by exploiting a learned dynamics model. One of the first attempts to learn a control policy in conjunction with a dynamics model is Dyna-Q [22]. Recent approaches such as [8], [23] and [24] are able to process raw image observations directly by using self-supervised representation techniques, i.e., autoencoders. Inspired by these works, in this paper, we present a novel model-based RL approach for mapless navigation.
Mapless navigation using RL have been previously addressed [9][10][11]. Khan et al. [11] proposed a two-stage architecture consisting of local planners defined by value iteration networks and differentiable memory networks that provide past information. Zhelo et al. [9] do not define any memory component but encourage curiosity-based exploration formulated in a secondary reward function, and consequently the agent is able to navigate in long corridors and dead corners. None of these approaches, however, are able to handle dynamic obstacles and require depth data as input. Moreover, these approaches were evaluated in known scenarios only, thus their generalization capabilities are questionable.
Few RL approaches for robot navigation based on RGB images have been demonstrated in real robots [15,21]. Xie et al. [15] propose a depth prediction network based on monocular RGB images that infers a depth field and a Q-value function for controlling a mobile robot. Lobos-Tsunekawa et al. [21] investigate visual navigation on a bipedal platform and learned a control policy by using DDPG. None of these approaches, however, incorporate latent dynamics models and terminal states for episodic tasks are not explicitly handled.

III. BACKGROUND
As common in RL, we model the environment as a Markov Decision Process (MDP) described by a tuple (S, A, P, R, γ) of environment states S, action space A, state transition probabilities P : S × A × S → [0, 1], reward function R : S × A → R, and discounted factor γ ∈ [0, 1]. The goal of the agent is to take actions a t ∈ A that maximize the expected reward. Often, the agent only has access to partial observations o t ∈ O of the environment, which are provided according to state observation In domains where the observations are defined as images, policies are often expensive to train due to the high dimensionality of the observation space O. Thus, representation techniques such as autoencoders (E : O → W ) are frequently incorporated to reduce the dimensionality of the image input and to define a latent state W of the environment model [8,23,24]. The latent state dynamics D : W × A → W can be learned effectively to resemble the unknown true state transition P of the environment. Both, the autoencoder and the latent state dynamics can be combined to form a nonlinear Kalman Filter, in which the state predictionw is given by D, and the filtering is done by the encoder E [23].
Hafner et al. [24] recently proposed a model-based RL approach that builds a latent space W and dynamics model D which are ultimately employed in an open-loop fashion to plan latent trajectoriesw t0 . . .w t N . For each of the latent states w ti , a state value is calculated by use of the Bellman return: given predicted rewardsr t inferred by a predictor R : W → R. Additionally, a value predictor model V : W → R is incorporated to optimize the Bellman consistency. The predicted rewardsr t , valuesṽ t and actions a t are modeled stochastically. More precisely, the means of Gaussian distributions are dictated by the prediction models R, V, π. The standard deviations of the action distributions are also inferred by the actor π, while a unit standard deviation is chosen for the other predictors. In contrast to the fully stochastic prediction models, the latent state is constructed using the Recurrent State Space Model (RSSM), which represents the latent space by a mixture of deterministic and stochastic states [23,25].
The autoencoder E as well as the prediction model R are trained using the negative log likelihood of the true data from an experience replay buffer. In addition, the latent state Approach overview. Visual ot and non-visual zt observations are fused into a latent vector wt which is used by the policy π to infer actions at. The dimensionality of the images is reduced by employing an autoencoder Eo. The dynamics model D predicts the next latent statew t+1 which is later filtered by sensor data observed in t + 1, namely by z t+1 and by Eo(o t+1 ). During training, a decoder is also learned which aims to reconstruct an observed image ot from wt. Additionally, the state value V, the reward R, and the termination likelihood F predictors are learned, which are used in the loss function of the policy π (Eq. (6)). dynamics loss is based on the Kullback-Leibler divergence between the open-loop 1-step prediction and the closedloop 1-step prediction. The loss is based on the Information Bottleneck objective [26], defined as: In contrast to the E, R and D networks, the value model V and the actor π are not trained on the recorded episodes, but on state trajectories that are generated through consecutive inference of the learned latent state dynamics D in conjunction with the actor π on a single filtered state posterior. This results in a tuple (w ti , . . . , w t i+H ) of unfiltered states that are used to train the value and actor models over a horizon of length H. The loss of the value prediction network minimizes the regression error of the state value that is calculated via reward predictions: while the loss of the actor π maximizes the value of the generated state tuples: IV. METHOD Our approach aims to solve the mapless navigation problem. We fuse visual o t and non-visual observations z t into a latent state w t . Actions a t are taken by a learned policy π that is trained by open-loop (imagined) latent trajectories inferred by an environment dynamics model D. State value V, reward R, and termination likelihood F predictors are also learned during training. The latter is employed to increase the sample efficiency of this episodic task. The high dimensionality of images is reduced by the incorporation of a variational autoencoder E o . Fig. 2 shows an overview of our approach; the algorithm is summarized in Algorithm. 1.

A. Observation Model
We enrich the observation space by considering both, image inputs and non-visual sensory data. Consequently, we propose two separate autoencoders, E o and E z , where E o represents the convolutional autoencoder for image inputs and E z processes non-visual sensor information. Since z t is low dimensional, we forego the encoder part of E z and only utilize the decoder to predict the measurements from the latent state. The autoencoders E o and E z are trained by optimizing the negative log likelihood of the true observations under the observation models:

B. Termination Likelihood Predictor
A terminal state can represent either success or failure in episodic tasks. Typical such tasks define a successful terminal state that indicates the achievement of the task's goal. Moreover, early termination is an established strategy for improving sample efficiency, so that an episode is terminated when certain states are reached whose contribution is considered negligible, e.g., states that represent a biped robot lying on the floor in a navigation task. In this manner, the sample acquisition time and the corresponding gradient propagation are avoided for these terminal states that do not contribute to reaching the task's goal. Fit E, D, R, F onÊ (similar to Eq. (2)) 8:Ê + ← Extrapolate each state inÊ using π and D 9:r + ← Predict rewards inÊ + using R 10: v + ← Calculate returns fromr + (see Eq. (1)) 11:ṽ + ← Predict value using V 12: Fit V on v + (see loss in Eq. (3)) 13: Maximize π w.t.ṽ + (see loss in Eq. (6)) 14: e ← Generate episodes from policy 15: E ← E ∪ e 16: end while Having multiple terminal states f i poses a challenge to the design of the reward function, as it is no longer possible to reward or to penalize termination per se. Due to the different nature of each terminal state, success and failure need to be addressed separately. In episodic tasks, one issue with successful termination emerges when the agent prefers to collect rewards instead of terminating because it continues accumulating reward. While termination rewards at the end of an episode promise a fast and straightforward solution to this issue, their inherent discontinuity makes them hard to predict. Thus, we introduce a termination likelihood model, which predicts a continuous indicator f i,t for reaching a terminal state. In contrast to R, V and π, the termination likelihood is modeled as beta distributed. The inferred termination likelihood is weighed and passed as a smooth learning signal to the actor model, enabling the agent to anticipate success and failure states. The actor loss is reformulated as: While the Dreamer [24] also computes an approximation of the termination probability, it is aimed to weigh down the return, as the agent cannot collect rewards after termination. However, this reward weighing reduces the effect of constant termination rewards when reaching the goal. In contrast, we let the termination likelihood influence the actor loss directly, without influencing the per-step-reward. Furthermore, we consider the semantically different failure and success termination states separately.

C. Task Definition
The goal of the agent is to reach a desired 2D pose on a flat ground plane without collisions with obstacles in the environment. The agent perceives the environment through RGB images and additional non-visual sensors. The images are taken from an ego perspective of a walking humanoid robot and, hence, contain much walking-induced motion. Similar to [21], they are passed through a semantic segmentation module that classifies obstacles pixelwise. Unnecessary textural information and background pixels are therefore removed. This image segmentation facilitates the image prediction and the real-world transfer. The resulting segmented image (resolution 64 × 64 in our experiments) defines the visual observations o t of our approach.
In addition, the non-visual observation is defined as where V t is the current gait velocity, h t is the yaw joint position of the head, [d t , θ t ] T is the relative target position expressed in polar coordinates, and R t contains the pitch and roll rotation of the robot base link. Note that in real world applications, the relative target position is often determined by high level-task planners or perception modules.
In each time step, the agent selects an action a t = [∆V t , ∆h t ] T , where ∆V t is an increment of the gait velocity, i.e., V t+1 = V t + ∆V t , and ∆h t represents an increment of the yaw head position. Note that the incremental action representation is introduced to guide the agent learning process, especially at the beginning of training where exploration of the action space might lead to oscillating motions that saturate the low-level joint controllers. The velocity vector V t = [v x , v y , ω z ] T consists of the translational xand y-velocities, as well as a rotational velocity around the z-axis of the robot. Overall, a 4D action space is defined.

D. Terminal States
We propose two different termination criteria. The robot arrives into a successful terminal state when the distance d t to the target is below a certain threshold, whereas the failure terminal state is reached when the sum of the absolute roll and pitch rotations |R 0,t | + |R 1,t | of the robot surpasses limit values that indicate an imminent robot fall. Both error values, i.e., the distance and orientation errors, are passed through an exponential decay to yield a continuous signal f i,t that indicates termination whenever f i,t = 1. Note that the causality f i,t = 1 =⇒ ∀∆t > 0 : f i,t+∆t = 1 holds, which can be incorporated into the latent world model.

E. Reward Function
We define the task reward at time t, r t = N i=0 η i r i,t as the weighted sum of N sub-reward terms. For brevity, the dependence of time will be dropped in the equations.
The main sub-rewards encourage the agent to reach the target pose and are formulated as: where d is the distance to the target position, d 0 is the distance from the initial pose to the target, and θ ∈ (−π, π] is the relative orientation of the robot to the target position, for example, θ = 0 means the robot is directly facing the target position. The former sub-reward encourages the agent to walk towards the target by reducing the distance d, while the latter penalizes the robot when it is not facing the target. In addition, we define a sub-reward based on the location of the target inside the robot's camera image. This target attention reward is generated by the multiplication of an importance map L ∈ [0, 1] 64×64 with a binary segmented image I ∈ {0, 1} 64×64 showing only the target: We set r a = 0 if the target is not visible in the image, i.e., i,j I i,j = 0. To ensure that the agent prefers to keep the target in the center of the observed egocentric images, we set L i,j = 1 for pixels at the center while we quadratically discount the values towards L i,j = 0 at the borders of the image. Consequently, the agent will try to keep the target in the center of its field of view mainly by controlling the head yaw joint, whose motion relates directly with the relative movement of the target in the observed images. Note that this target relative position is also affected by the gait.
In order to avoid oscillating motions of the head, we penalize the normalized head position h and the normalized head control action ∆h quadratically: In addition, we encourage the agent to maintain a safe distance to obstacles by penalizing its distance towards the closest obstacle ρ: Finally, we penalize the current gait velocity using a sigmoid kernel k(x) = 1/[1 + exp(−αx − c)] to limit the maximum gait velocity of the agent due to difference between the simulated and the real gait. This penalization is formulated as:

V. EVALUATION
We evaluate our approach on the NimbRo-OP2X humanoid robot [27]. All training is done using experience collected only in simulation employing MuJoCo as multibody simulator. Eight environments are executed in parallel to speed up the data acquisition. The policy frequency is 10 Hz, while the simulation runs at 1 kHz. The robot incorporates a bipedal gait engine, which generates leg motions based on a target gait velocity V t [27,28]. The gait runs at 100 Hz. For collision checking operations, the robot links are approximated by geometrical primitives.
Each episode starts with the humanoid robot standing without any obstacle in its direct vicinity. The target position, the number of obstacles, their poses and geometries are drawn uniformly at random. To encourage the development of robot skills to circumvent obstacles, each episode places an obstacle between the initial position of the robot and the target pose with probability p block = 0.5. The feasibility of reaching the target is checked by an A* planner; if no path is found, a new environment is generated. The agent has a maximum time of 60 s to complete the task before the episode ends.
In simulation, the renderer provides the segmented image (64 × 64), while a threshold in the HSV space is used for the real world experiments. For applications with nondistinctive object colors, segmentation approaches, such as [29], could be applied. The inferred actions are bounded to ∆V ∈ [−0.06, 0.06] 3 and ∆h ∈ [−0.012, 0.012]. The weights of the reward functions are: η d = 1.0, η θ = 0.2, η a = 0.2, η h = 0.08, η H = 0.08, η ρ = 0.2, and η v = 0.35, and the weights of the terminal states are: λ s = −1150 and λ f = 3250. The models are trained every 4,000 recorded steps. Other hyperparameters match the Dreamer model [24]. The policy is trained for 2 million simulation steps, resulting in a total training time of around 2 days on a computer with an Intel i9-9990K CPU, 64GB of RAM and an nVidia GeForce 2080 Ti with 12GB of VRAM. This model is able to solve simple scenes after 200.000 steps, i.e., less than five hours of training.
After training, the control policy is able to command the robot to reach target poses avoiding obstacles. Figure 3 shows sample scenarios where the robot navigates collisionfree with our learned control policy. The robot circumvents obstacles and goes through narrow passages without falling. All the environments are presented to the robot for the first time. A model-free DDPG [30] agent trained for the same amount of steps was not able to solve the environment.
We compare our approach against two ablated versions of our method. The first ablation (M f ) does not include the termination likelihood predictor and the second one (M nv ) does not consider non-visual observations. The return and success rate are presented in Fig. 4. Note that although the M nv model accumulates more reward compared to our model, it is not able to reach the target indicated by its low success  rate. The larger reward is attributed to longer sequences that do not reach the goal (e.g. the robot might stand in front of the target). The main contribution in the performance increment is clearly attributed to the introduction of nonvisual information, because the agent is not forced to obtain information from the images but it is given directly. Thus, the incorporation of non-visual information improves the data-efficiency of the overall approach. However, in complex scenarios where the robot has to back up, the agent often only reaches local minima. We evaluate the performance of each of the learned models compared above. We generate a set of 100 random scenes sampled as during training. The results are presented in Table I. After 2 million steps, the M nv model is not able to successfully complete the task. The accumulated reward and the long episodes indicate that the agent does not fall but does not find the target in the given time per episode (60 s). The higher success rate and reward of our approach compared against the model without termination predictor F demonstrates the improvement in the sample efficiency by incorporating a predictor for f i .
Since the performance of the agent depends on the ability of the model to reproduce the actual observations and reward values from the latent state, we evaluate the quality of their reconstruction. Figure 5 shows the reconstructed non-visual observations and reward for a random sequence. For clarity in the figure, only one sequence is shown, but other sequences present a similar behavior. Note how well the model tracks the ground truth signals, which is to be expected once the models have converged. The accuracy of the reconstruction is an indicator of the quality of the inferred open-loop trajectories used for training the value and actor networks.

A. Real-World Transfer
The simulated robot is equipped with the same sensors as the real robot. This allows, in conjunction with the semantic segmentation, a real-world transfer with low additional effort and no retraining. Due to sim-to-real dissimilarities in the robot model, joint controllers and contact properties, the simulated gait does not behave as the one on the real robot.
To facilitate the sim-to-real transfer, we inject Gaussian noise, N (0, 0.3), on the inferred actions during training. In addition, the gaits are tuned by introducing scaling factors to the inferred actions in order to obtain a similar response in simulation and with the real hardware. Figure 6 shows a real and a simulated robot performing the same scenario consisting of traversing a narrow passage. The row in the middle presents the segmented images captured with the real robot, whereas the bottom row shows the task performed in simulation. This is a challenging scenario that requires precise actions from the agent to avoid collisions. The temporal differences between the real and the simulated trajectories are attributed mainly to contact parameters such as frictions. Finally, the control policy is tested with dynamic obstacles  with the real robot. Figure 7 shows snapshots of the robot avoiding a moving obstacle which is blocking the direct path to the target pose. Note that the policy has not been trained on dynamic obstacles, and it has not seen such object shapes.
VI. CONCLUSION In this paper, we have proposed a novel approach for learning mapless navigation around obstacles based on visual and non-visual observations. We have demonstrated that the incorporation of a termination likelihood predictor increases the data-efficiency of the approach. In addition, we have shown that our model produces a robust policy that can be successfully transferred to a real humanoid robot.
In the future, we would like to extend our approach to incorporate hierarchies. Multiple consistent policies are envisioned to solve more complex tasks that require longterm planning. Additionally, learning local and global maps seems to be a promising alternative to provide the agent with more sophisticated navigation skills, such as remembering dead ends. More dynamic scenarios where multiple objects move simultaneously require the agent to track and estimate the velocities of the moving bodies, which also states an interesting problem to enrich our approach.