Fast Kinodynamic Planning on the Constraint Manifold With Deep Neural Networks

Motion planning is a mature area of research in robotics with many well-established methods based on optimization or sampling the state space, suitable for solving kinematic motion planning. However, when dynamic motions under constraints are needed and computation time is limited, fast kinodynamic planning on the constraint manifold is indispensable. In recent years, learning-based solutions have become alternatives to classical approaches, but they still lack comprehensive handling of complex constraints, such as planning on a lower dimensional manifold of the task space while considering the robot's dynamics. This article introduces a novel learning-to-plan framework that exploits the concept of constraint manifold, including dynamics, and neural planning methods. Our approach generates plans satisfying an arbitrary set of constraints and computes them in a short constant time, namely the inference time of a neural network. This allows the robot to plan and replan reactively, making our approach suitable for dynamic environments. We validate our approach on two simulated tasks and in a demanding real-world scenario, where we use a Kuka LBR Iiwa 14 robotic arm to perform the hitting movement in robotic air hockey.


I. INTRODUCTION
R OBOTIC manipulators tackle a wide variety of complex tasks in dynamic environments such as ball-in-a-cup [1], [2], table tennis [3], [4], juggling [5], diabolo [6], and air hockey [7], [8].These tasks require quick computation of a feasible trajectory, i.e. a trajectory solving the task while respecting all kinematic and dynamic constraints such as joint position, velocity, acceleration, and torque limits.On top of that, many tasks define a set of safety or task-specific constraints that must be enforced on the planned solutions.
Although there have been attempts to solve these problems using optimization and sampling-based motion planning algorithms, they all have significant limitations, such as long planning time, computing hard-to-follow plans, or inability to satisfy boundary conditions.One of the approaches to the Fig. 1.Proposed learning-based motion planning approach enables rapid planning and replanning of smooth trajectories under complex kinodynamic constraints in dynamic scenarios, e.g. the robotic Air Hockey hitting.planning on the constraint manifold is to represent it as a collision-free space, which makes sampling valid states highly improbable [9], [10], resulting in considerably increased planning time.To address this issue, Berenson et al. [11] introduced the concept of projecting the states onto the constraint manifold.However, this approach is restricted to plan paths, which can be hard to follow, as they disregard the system's dynamics.Recent work of Bordalba et al. [12] proposes to solve constrained kinodynamic motion planning problems by building a topological atlas of the constraint manifold and then using Linear Quadratic Regulator (LQR) to control the system locally.Even though this approach allows for solving complex problems, the motion planning times are prohibitively long for dynamic tasks like the game of air hockey or table tennis.Lengthy planning is also noticeable for optimizationbased motion planners, which slow down significantly when subjected to highly non-linear constraints [13] and are prone to get stuck in local minima.An efficient alternative to the abovementioned methods can be to build a reduced actuator space that keeps the system on states satisfying the constraints [14].However, this approach may have problems with the satisfaction of boundary constraints.
We propose a novel learning-based approach for constrained kinodynamic planning that efficiently solves all the abovementioned problems, called Constrained Neural motion Planning with B-splines (CNP-B).Similarly to [11], we frame the problem as planning on a constraint manifold M. Using a similar derivation to [14], we define all the kinematics, dynamics, and safety/task constraints as a single constraint manifold, defined as the zero level set of an arbitrary constraint function c(q, q, q).Our approach does not use an online projection [11] nor continuation [12], instead, it exploits the representation power of Deep Neural Networks to learn a planning function [15], indirectly encoding the manifold structure.Implicitly learning the manifold enables us to rapidly plan smooth, dynamically feasible trajectories under arbitrary constraints and highly dynamic motions (see Fig. 1).Differently from [14], our approach does not require building an abstract action space, making it easy to exploit standard planning heuristics and improving the interpretability of the plan.In our work, we frame constraint satisfaction as a manifold learning problem, where the planning function is encouraged to generate trajectories that minimize not only some arbitrary task cost but also the distance from the constraint manifold.Furthermore, violating particular constraints to a certain degree can have only a minor negative impact, while violating other constraints can be unacceptable or dangerous.Hence, we recover the metric of the constraints manifold, which allows us to attribute different priorities to different constraints.

A. Contributions
We propose a novel learning-to-plan method for fast constrained kinodynamic planning, which is based on a deep neural network generating trajectories represented using two Bspline curves.This paper presents the following contributions: i.A new approach to robotic arm motion planning that enables planning dynamic trajectories under constraints.This approach is inspired by two ideas from our recent works on car maneuver planning: learning from experience with a deep neural network [16] and using B-splines for efficient representation of the learned path [15].This work applies these concepts to planning a trajectory on a lowerdimensional manifold of the task space while considering the robot's dynamics.To this end, we extend the learning system architecture to learn Lagrangian multipliers in the optimization problem, learning simultaneously a metric of our constraint manifold.This novel approach allows us to weigh each constraint by how much it is important to find a feasible solution to the planning problem.We demonstrate in simulations and experiments that this new approach is not only much faster than all state-of-the-art methods we were able to compare as baselines, but generates also trajectories that allow faster and more accurate robot motion while being executed 1 ii.A new technique to enforce satisfaction of the boundary constraints, such that the trajectory inferred by the neural network connects precisely two arbitrary robot configurations (positions, velocities, and higher order derivatives when necessary) is proposed and is demonstrated to be effective in both simulations and experiments for two different tasks.iii.Finally, we demonstrate the practical feasibility of our novel planning technique in the Air Hockey hitting task 1 Code and data can be found at https://github.com/pkicki/cnp-b.
on a real-world Kuka LBR Iiwa 14 robot.This experimental benchmark was previously solved successfully by specialized motion planning algorithms [8], while we show the effectiveness of our general planning method under a strict time budget, and we demonstrate its ability to replan motion on-the-fly.These properties allow for precise dynamic hitting motion, outperforming [8].

B. Problem Statement
Let q(t) ∈ R n be a vector of n generalized coordinates describing a mechanical system at time t.Let q(t) and q(t) be the first and second derivative, i.e. velocity and acceleration of the coordinate vector q.Let the tuple ζ = q, q, q, T be a trajectory of the system for t ∈ [0, T ], with T the duration of the given trajectory.In the following, we assume that ζ(t) = q(t), q(t), q(t) is a tuple containing the information of the trajectory ζ at timestep t.We define the constrained planning problem as: where N is the number of equality constraints c i , M is the number of inequality constraints g j , and L is an arbitrary loss function describing the task.Typically, to solve a motion planning task, it is enough to generate a trajectory that satisfies some locally defined properties, like limited joint velocity, torque, or ensuring manipulation in free space, at every time step t, and minimize locally defined objectives due to composability.We can exploit this by transforming the problem into an integral, and describe it by where L t is a locally defined loss function.
Instead of specifying the trajectory ζ at every point, it is helpful to use parametric representations, such that the generalized coordinates and their derivatives can be written as q(t) = f θ (t).Therefore, we can formalize the problem as minimization on the parameters θ instead of searching for q in the functional space C 2 .

II. RELATED WORK
Motion planning is one of the core components of a robot, and it is necessary to achieve the desired degree of autonomy.This importance explains why motion planning is one of the most active research areas in robotics.Despite these efforts, for many robotic tasks known planning algorithms are inadequate as they cannot handle the task-specific constraints or yield the plan within the specified amount of time.Researchers made great progress in fast motion planning in the last two decades, through the development of sampling-based motion planners such as Probabilistic Roadmaps [17] and Rapidly Exploring Random Trees (RRT) [18], and their more recent successors like RRT* [19], Bidirectional Fast Marching Trees* [20], or Batch Informed Trees* [21].These methods are not only characterized by probabilistic completeness but also enable planning paths for challenging problems like maneuvering with a car-like vehicle [22] or reaching given poses with two robotic manipulators in a cluttered household environment [23].
In parallel with the sampling-based approaches, optimization-based motion planning methods were developed.Instead of building a search tree and constructing the solution, these methods start with an initial solution and modify it to minimize cost function subject to constraints.Methods like CHOMP [24], TrajOpt [25] or GPMP2 [26] showed an ability to solve tasks like avoiding obstacles with PR2 robot [25], [26] or planning the walking movements of a quadruped [24].
Proposing a feasible trajectory for the considered class of planning problems does not mean that a practical solution is reached, as planning in real-world scenarios often involves additional constraints related to time (e.g.limited time for computing the plan or limited time to complete the motion), or related to the physics of the task (e.g.limited effort of the robot motors or constrained movement of the robot endeffector).From these constraints, the areas of constrained and kinodynamic motion planning emerged.

A. Constrained motion planning
Some of the tasks we outsource to robots require constraining the robot's motion to some manifold embedded in the task space, e.g.keeping the cup held by the robot in an upright position or ensuring that the end-effector of a window cleaning robot remains at some constant distance from the window plane.In recent years, two main approaches to this class of problems were developed: (i) adding task constraints to the motion optimization problem [27], (ii) sampling constraintsatisfying configurations and generating constraint-satisfying motions in the sample-based motion planners [9], [10].
While including additional task constraints in motion optimization is conceptually simple, it usually results in a much harder optimization problem to solve, as the kinematics of the robot are usually nonlinear.To overcome the computational burden stemming from these nonlinearities, authors of [25] proposed to employ the sequential quadratic programming approach that transforms the nonlinear programming problem into a sequence of its convex approximations around the current solution.In [27], this idea was extended to a non-Euclidean setting, by transforming the manifold-constrained trajectory optimization problem into an equivalent problem defined over a space with Euclidean structure.Another general approach to solve manifold-constrained problems was proposed in [28], where authors modified the update rule of CHOMP by projecting it on the tangent space of the constraint manifold and adding an offset correction term to move the solution towards the manifold.In turn, a recent approach to constrained optimization-based motion planning [29] tries to achieve faster convergence and numerical robustness by utilizing the augmented Lagrangian optimization using an iterative Linear Quadratic Regulator (iLQR), introduced in [30], and systematically updating the Lagrangian multipliers, which is conceptually similar to our approach to neural network training.However, in practice, when we need a solution for a particular problem, exploiting the structure of the constraints may be beneficial.In [8], the problem of fast planning for the dynamic motion of a robotic arm with the end-effector constrained to move on a plane was decoupled into two more straightforward optimization problems: planning the Cartesian trajectory on a 2D plane and then planning the trajectory in the joint space.However, this may result in a suboptimal performance due to the predefined Cartesian trajectory.In contrast, in our work, we plan directly in the robot's configuration space, and we show that it is possible to use a general solution to learn how to plan better than using handcrafted optimization.
The adaptation of sampling-based motion planners to solve constrained motion planning problems is not so straightforward.Simply rejecting the samples which lie outside of the manifold usually results in a drastically reduced probability of drawing an acceptable sample, also connecting two samples in a manifold-constrained way is non-trivial [9], [10].Therefore a number of approaches to this class of problems were proposed, like relaxation, projection, using tangent space or topological atlas.The relaxation emerged from the assumption that there is some acceptable level of violation of the constraints, and we can relax the surface of the constraint-manifold and give it some non-zero volume to enable sampling [31], [32].However, this approach bypasses the problem by creating a new oneplanning in narrow passages [33].To mitigate this, Constrained Bi-directional RRT (CBiRRT) was proposed [11].This method exploits projections onto the constraint manifold to make sampled and interpolated points satisfy the constraint.In [34], authors modified CBiRRT to avoid the search getting stuck in local minima by exploiting the geometric structure of the constraint manifold.A significant speed-up over projection-based methods was achieved by Tangent bundle RRT [35], which, instead of sampling in the configuration space, proposes to sample in the tangent space of the constraint manifold.Instead of sampling on the tangent space, it is possible to define charts that locally parameterize the manifold and coordinate them by creating a topological atlas [36].In this approach, RRT search for the direction of the atlas expansion, and then sampling is performed only in the space defined by the atlas.
Nonetheless, sampling-based constrained motion planning methods usually produce only paths, disregarding the dynamics of the movement that is crucial for planning for dynamic robot movements.Therefore, in the following subsection, we will discuss the approaches to kinodynamic motion planning.

B. Kinodynamic motion planning
Transforming motion optimization problems to the kinodynamic setting can be easily done by including the robot dynamics in the constraints.However, this introduces more nonlinearities to the problems, slows down the solvers, and makes optimization prone to converge to a local minimum unless properly initialized [13].
In turn, to adopt sampling-based motion planners to the kinodynamic setting, a significant effort has to be made in terms of both the tree Extend procedure and state cost-togo assessment.One of the first attempts to solve these issues was linearizing the system and using the LQR for connecting the states and calculating the cost of this connection [37].To avoid problems stemming from linearization, authors of [38] proposed to use a gradient-based method to solve the Nonlinear Programming (NLP) problem of connecting any two configurations.A similar idea was recently presented in [39], where Model Predictive Control (MPC) was used to perform a tree extension.One of the issues of sampling-based kinodynamic planning is the necessity of sampling highdimensional state space (due to the inclusion of the velocities in the state).To mitigate this, in [40], a partial-final-statefree optimal controller was used for connecting the states, such that the dimensionality of the sampling space is divided by two.A different approach to RRT-based planning is to sample controls instead of states [41], [42].This significantly simplifies keeping the constraints satisfied, however, it usually results in relatively slow planning.Unfortunately, most of the aforementioned sampling-based kinodynamic motion planning algorithms struggle when they are subjected to kinodynamic and holonomic constraints at the same time [12] To address this issue, the adoption of the atlas method [36] with the RRT's Extend procedure using LQR was proposed in [12].Unfortunately, this algorithm relies strongly on the linearization of the system and requires a significant amount of time to prepare the plan.

C. Learning-based motion planning
For many real-world robotic applications, conventional planning methods are not fast enough or produce solutions far from optimal.Moreover, tasks performed by the robots, even though they may require solving different planning problems, seem to reveal some similarities.Therefore, to obtain plans of better quality within tighter time bounds, learning-based approaches to improve robot motion planning were proposed.These types of methods originated from [43], in which, the conventional planner was used to solve the problems, however, generated plans were not only executed but also saved in the library of solved problems.After gathering plans, they can be reused to solve new but similar problems in a shorter time.
Most of the learning-based motion planning methods build upon the algorithms from RRT family to use their guaranties of probabilistic completeness.Some of these methods try to modify the sampling distribution based on the experience and the representation of the task.In [44] neural network decides whether the sampled state should be rejected or not, whereas in [45] neural network is used to predict the state-action value function to choose the best nodes to expand.Authors of [46] used a Convolutional Neural Network (CNN) to predict some crucial regions of the environment to increase the sampling in them.At the same time, in [47], a probability distribution is directly inferred by the neural network in the form of a heatmap.In [48], the sampling distribution is encoded in a stochastic neural network (due to dropout used during inference), which is trained to predict the next state towards the goal.
An adaptation of biasing the sampling distribution to comply with a manifold of constraints was presented in [49], where adversarial training was used to learn how to generate data on the constraint manifold.An architecture consisting of a generator and discriminator trained jointly was also used in [50].This work builds upon [48] and uses a generator to predict the next state, but extends it with a discriminator, which is used to predict deviation from the constraint manifold and to project the predictions on it.
Learning-based approaches are also used to improve the feasibility of solving kinodynamic motion planning problems.Authors of [51] emphasized that solving a two-point boundary value problem for a nonlinear dynamical system is NP-hard and proposed to learn a distance metric and steering function to connect two nodes of RRT, based on the examples generated using indirect optimal control.In turn, in [52] the learning of control policy is done indirectly by learning the state trajectory of some optimal motion planner and then using inverse dynamics of the system to determine controls.A lazy approach to limit the number of computationally expensive NLP solver calls was presented in [53], where neural network, instead of replacing the solver, is trained to predict which nodes of a RRT are steerable to, and what will be the cost of steering.Contrary to these methods, authors of [54] propose to use a MPC extensively to solve local NLP problems and learn only how to determine the next state in a way towards the goal using the experience gained by mimicking demonstration trajectories.
In contrast to these methods, our proposed approach offers an extremely fast way of finding a near-optimal trajectory that is able to solve constrained kinodynamic motion planning problems.Moreover, CNP-B does not require the demonstration trajectories, as it learns from its own experience similarly to [16].Thus, its performance is not upper-bounded by the quality of the demonstrations.Furthermore, our proposed approach is able to smoothly replan the motion on-the-fly, which is not possible with the use of state-of-the-art constrained kinodynamic motion planning algorithms.

III. PROPOSED SOLUTION
In this section, we will first describe the general framework of our proposed solution to the problem defined in (1).Then we will show how to use the structure of the proposed approach to solve the problem of planning a trajectory where the objective is to reach a specific end configuration in the shortest possible amount of time.Finally, we will show some extensions to CNP-B to solve a real planning problem.Namely, we will focus on moving a heavy object and hitting a puck with a mallet using a 7dof manipulator robot.

A. Constrained planning
The original problem formulation, shown in (1), is a complex constrained optimization problem: directly using this formulation makes finding a solution hard and time-consuming, particularly in the presence of complex equality constraints.Indeed, while an exact solution may exist, it may be hard to perfectly match the constraints, due to the use of parametrized trajectory and numerical errors.To efficiently solve the constrained planning problem, we reformulate the original optimization, introducing the notion of constraint manifold.This reformulation transforms the constrained optimization problem into an unconstrained one by modifying the original loss such that the solutions lie close to the constraint manifold.In our approach, we learn the loss during the optimization process by considering the manifold metric and a violation budget for each constraint.
We base our reformulation on the following steps: i. defining the constrained manifold as the zero-level curve of an implicit function, unifying equality and inequality constraints, ii.relaxing the original problem by imposing that all solutions should lie in the vicinity of the constraint manifold, iii.transforming this problem into an unconstrained optimization problem by learning the metric of the constraint manifold.1) Defining the constraint manifold: Our first step towards the definition of the constraint manifold is to eliminate inequality constraints from (1), by introducing slack variables µ j and M new equality constraints c N +j (q, q, q, t, µ j ) = g j (q, q, q, t) + µ 2 j .Thus, we obtain the following formulation To drop the dependency of the manifold M µ from the vector of slack variables µ ∈ R M , we first introduce the manifold loss function where • denotes a L2 norm, such that the constraint manifold M will be defined by its 0-level set.For i-th relaxed inequality constraint the manifold loss function is defined by therefore, to drop the dependency of µ i , we redefine our loss for inequality constraint as follows We can find a value that minimizes L i M (ζ(t), µ i ) by taking the derivative w.r.t. the slack variable and setting it to zero thus, we obtain , where the second solution exists only for c i (ζ(t), t) < 0. Plugging back the obtained stationary points in the solution, by basic reasoning of the obtained values and conditions, we obtain our inequality loss This loss can be computed compactly, in an equivalent form, as which is continuous and differentiable everywhere: notice that in 0, the derivative is 0. As a result, we obtain a new definition of the constraint manifold 2) Approximated optimization problem: Our newly defined manifold loss expresses the distance of a given trajectory ζ from the manifold M. Ideally, we could use the L M (ζ, t) = 0 as a single constraint of our optimization problem.However, numerical issues and trajectory parametrization may cause small unavoidable errors.Furthermore, often the task loss L and manifold constraints L i M will counteract each other, making this optimization particularly difficult and prone to constraint violations unbalances.Indeed, the optimization may favor reducing some constraints violation at the expense of others.When considering real-world tasks, it is often not crucial to have zero constraint violation as long as it is below an acceptable threshold.Thus, we simplify the problem by introducing an acceptable level of constraint violation.For simplicity, we bound the elements of the non-negative valued manifold loss function (see ( 4) and ( 9)) i.e.L i M ≤ Ci , where Ci = c2 i is a square of the desired acceptable constraint violation level ci .Thus, we can write the following optimization problem Now, we can transform (11) into the canonical form One possible way to solve ( 12) is by applying a Lagrange relaxation technique [55], framing it as an unconstrained optimization of the following function where L(ζ(t), λ) is the Lagrangian and λ is a vector of nonnegative Lagrange multipliers.
3) Loss function learning: Unfortunately, ( 13) is not a practical optimization problem, leading to ineffective learning and convergence to local optima.We propose instead an approximate solution, inspired by [56], that learns the Lagrangian multipliers.In our approach, we decouple the minmax problem into interleaving minimization of (13) w.r.t ζ and updating the values of the multipliers λ.We frame the update of the multipliers as the process of learning a metric of our constraint manifold, weighting each constraint by how much it is important to solve the final task in a way that is feasible in practice.
First, we remove the maximization w.r.t λ from ( 13) and write the following minimization problem argmin where matrix Λ is a metric of the manifold M defined by Note that we drop the constant 1 from the constraints, as we are not solving a min-max optimization problem, and this term has no effect on the minimization part.Second, to simplify this metric and to maintain the positiveness of all elements of λ we propose the following substitution Ci .Thus, we write Λ as where α is a vector of real-valued parameters defining the manifold metric.We introduce now a new loss, the manifold loss under the metric Λ As a result we can rewrite (14) into Third, we introduce the metric learning approach.While we can straightforwardly optimize (18) w.r.t.ζ using any gradient optimizer, we need to derive a learning rule for the vector α.Let L ¬i M,Λ c T ¬i Λ ¬i c ¬i be the complement of the i-th manifold loss element, where index ¬i means all elements except i-th element.Using this notation, we analyze how the α i should change between k-th and k + 1-th iterations so as not to surpass the desired level of constraint violation Ci , i.e.
Assuming that the changes of L ¬i M,Λ and L are small, e.g. by choosing a small learning rate, we obtain Finally, we can define our update rule for α i as a small step towards the desired value ᾱi i.e.
with the learning rate γ ∈ R + .

B. Trajectory Parameterization
To represent the solution trajectory ζ we use a decoupled representation made up of time t = ψ(s) and path p(s) = q(ψ(s)), both defined as functions of the phase variable s ∈ [0; 1], where ψ(s) is monotonically increasing, ψ(0) = 0, and ψ(1) = T , where T is duration of the trajectory.Therefore, q(t) can be defined by q(t) q(ψ(s)) = p(s). ( The first derivative of q w.r.t.time can be defined by where r(s) dt ds −1 (s) represents the inverse rate of change of the time t w.r.t.phase variable s.Thus, the second derivative of q w.r.t.time can be defined by Therefore, to fully represent trajectory ζ, we need to know path p(s) and the inverse rate of change of time r(s), and their derivatives w.r.t.phase variable s.In this paper, we represent p(s) and r(s) as B-splines, as this parametrization is rich enough to generate complex trajectories and allow us to easily compute their derivatives, which is crucial to ensure the satisfaction of the q(t) and q(t) limits.

C. Trajectory definition
To define the trajectory, we must determine the control points C p , C r of both p(s) and r(s) B-splines.Most of these control points are predicted using the neural network, however, part of them can be directly computed based on the task definition.
1) Boundary conditions: The majority of the practical motion planning problems impose some boundary constraints on their solutions.Typically, at least the initial configuration is defined.However, for practical problems, it is beneficial to consider also initial velocity and accelerations, to ensure smooth movement from the given initial state.Similarly, some tasks require accurate reaching of some desired state and velocity.These constraints can be summarized as q(0) = q 0 , q(0) = q0 , q(0) = q0 , q(1) = q d , q(1) = qd (25) where q 0 , q0 , q0 , q d , qd are the initial and desired configurations and their derivatives given by the task definition.By using B-spline representations of p(s) and r(s), we can impose these boundary conditions directly onto the solution of the considered planning problem.Technical details of this procedure are described in Appendix A. As a result, the first three and last two robot's configuration control points C p may be determined based on the boundary constraints of the problem (25) instead of using the neural network outputs.
2) Neural network: While boundary control points can be computed analytically, the rest of the control points must be determined using the learning system based on previous experience.Our proposed neural network (Fig. 2) takes as input the normalized initial and desired configurations q 0 , q d , velocities q0 , qd and initial joint accelerations q0 , and outputs the control points C r of the r(s) B-spline, and some parameters φ p , which can be used to compute the control points of the configuration B-spline C p .Activation functions for all layers are tanh, except the layer in the Time head, which is an exponential function (to ensure the positiveness for all control points of the r(s) B-spline).
To compute control points of the configuration B-spline, we utilize the outputs φ p of the Configuration head oriented with the boundary control points of the p(s) B-spline.For the case for which the initial state is defined with the configuration and its derivatives up to N i -th (exclusively), and the desired state with the configuration and its derivatives up to N d -th (exclusively), we can define inner configuration control points by where C p is the total number of configuration control points C p , B = N i + N d + 1, and φ p i is the i-th output from the configuration head.

D. Loss functions
The loss function is one of the most crucial parts of every learning system.In the proposed solution, we consider two types of losses i.e. task loss L and manifold loss L M , however, we include both of them into the integral formulation (2), such that the resultant loss function L can be defined by where L t (ζ(t), t) and L Mt (ζ(t), t) are locally defined task and manifold losses at time t.To simplify the optimization process, we drop the explicit dependency of the loss L on the time t and trajectory duration T , by the following change of variables (28) Therefore, to define the resultant loss function L, we must provide the formulas for the step losses L t (ζ(s), s) and L Mt (ζ(s), s).In our experiments, to encourage the neural network to generate minimal-time (i.e.fast) trajectories, we define the basic task step loss as L t (ζ(s)) = 1.However, we can optimize any other quantity, like effort, jerk, end-effector position tracking error, centrifugal forces, or a weighted sum of these.
To define step manifold loss L Mt (ζ(s), s) we need to define its components L i Mt (ζ(s), s), which corresponds to all constraints imposed in the given problem.In our experiments, we consider constraints stemming from velocity q, acceleration q, which associated losses can be defined by Similarly, we can define loss for torque limits τ where τ (s) = ID(q(s), q(s), q(s)) can be easily computed using inverse dynamics algorithm [57], [58].Moreover, in a similar manner, we can define losses that utilize other functions of the robot configurations, like the forward kinematics.Therefore, it is easy to define some sample geometrical constraints where d(FK(q(s)), T ) is a distance between the robot's links configurations and some manifold T in the task space.
Obviously, the aforementioned losses are only examples.Using this framework, we can come up with much more complicated and sophisticated loss functions, however, the presented loss functions are enough to learn how to perform challenging practical tasks considered in this paper.Note, that all of these losses are differentiable functions of the trajectory ζ, which enables us to optimize the neural network weights directly.

IV. EXPERIMENTAL EVALUATION
To evaluate the proposed constrained neural motion planning framework, we introduce two challenging motion planning tasks, both considering planning for the Kuka LBR Iiwa 14 robotic manipulator: moving a heavy (of a weight close to the robot's payload limit) vertically oriented object between two tables and high-speed hitting in the game of robotic Air Hockey (see Fig. 3).The baseline, to which we compare the performance of CNP-B in both tasks is constituted by four algorithms that span the space of different solutions to the considered problem: • TrajOpt [25] -a motion optimization algorithm that utilizes Sequential Least Squares Programming (SLSQP), • CBiRRT -a sampling-based path planning algorithm that uses RRTConnect with the projection of sampled points onto the constraint manifold, • Stable Sparse RRT (SST) -a sampling-based motion planning algorithm which builds a sparse tree of robot configurations and extends them using random controls, Fig. 3. Two tasks considered in this paper: moving a heavy vertically oriented object between two tables (left) and high-speed Air Hockey hitting (right).
• Model-Predictive Motion Planning Network (MPC-MPNet) -a sampling-based motion planning algorithm, which uses a neural network to determine the next node in a search tree and Cross Entropy Method (CEM) to steer towards this configuration.In the Air Hockey hitting task we extend the baseline by the Anchored Quadratic Programming (AQP) method, which is the current state-of-the-art in this area -an algorithm developed specifically to solve the problem of planning on the constraint manifold of the Air Hockey game.
Both the baselines and our method were evaluated in a simulation environment developed using ROS1 and Gazebo.The experiments in Air Hockey hitting were possible thanks to the in-house constructed physical setup with a Kuka LBR Iiwa 14 robot [8].For the experiments in simulation, we used an Intel Core i7-9750H CPU, while the real robot experiment uses AMD Ryzen 9 3900x CPU.
A. Moving a heavy vertically-oriented object 1) Task description: In this task, the goal is to quickly move a heavy cuboid (12 kg) between random positions on the left and right blue boxes using Kuka LBR Iiwa 14.The task requires planning a joint trajectory between two random configurations, minimizing movement time, and satisfying joints' velocity, acceleration, and torque constraints.Moreover, the robot's trajectory has to ensure that both the robot and the handled object will not collide with the environment and that the object will be oriented vertically throughout the whole movement.
2) Dataset and method adjustments: To learn how to solve the task, we generated a dataset of 26400 planning problems of this kind, split into training (24000) and validation (2400) subsets.In the dataset, we randomize both the initial and desired position of the object and the initial and desired robot's configuration.Both initial and desired velocities are set to 0. Moreover, we add three additional loss terms stemming from the constraints imposed by the task definition i.e. vertical orientation loss, robot collision loss, and object collision loss.The mathematical definitions of these losses, together with all the parameters of this experiment, can be found in Appendix B1.
3) Quantitative comparison with state-of-the-art: To evaluate the proposed method, we compared it with several stateof-the-art motion planners.All planners were asked to plan the motions that solve 100 randomly generated tasks, and we executed these plans in simulation.The results of this experiment are presented in Fig. 4. The first two plots show that our planner reaches the goal in all scenarios, and in 95% does not violate any of the constraints.In contrast, comparable results are obtained only by CBiRRT [11], which reaches the goal in 88% of cases, and only 74 plans out of 100 are valid.However, this method plans motions that are on average two times longer, and it takes over 250 times longer to compute this solution.The result of the MPC-MPNet [54] deserves special attention, as it is the state-of-the-art learning-based solution for kinodynamic motion planning.We trained it using the plans generated by our planner, however, it was unable even to come close to the results achieved by the TrajOpt [25]
and CBiRRT [11], not to mention our proposed planner.Surprisingly, it outperforms all solutions in terms of the mean motion time, however, it is the result of generating plans that are too short to reach the goal.The last plot shows the error of maintaining the object in an upward position, which we computed as an integral along the trajectory of the sum of the absolute values of roll and pitch angles.The smallest deviation from the orientation constraint is achieved by our proposed solution, while the highest violations are generated by executing the trajectories planned using SST [41].
B. Planning high-speed hitting in simulated Air Hockey game 1) Task description: In this task, the goal is to score a goal in the game of robotic Air Hockey from a steady-still puck i.e. to move the Kuka LBR Iiwa 14 robot handling the mallet from some predefined initial configuration, such that it will reach the puck position with the velocity vector pointing towards the middle of the goal.Robot desired configurations and joint velocities are determined using the optimization algorithm proposed in [8] for a given puck position and velocity direction.Moreover, the planner should generate a joint trajectory minimizing movement time and satisfying joints' velocity, acceleration, and torque constraints.
2) Dataset and method adjustments: To learn the task, we generated a dataset of 19800 planning problems of this kind, split into 2 subsets: training (18000) and validation (1800), while the test set is defined separately.The robot's initial configuration is randomly drawn in a neighborhood of a base configuration, such that the mallet is located in a 10×10 cm box, and its initial velocity and acceleration are set to 0. The puck position is also random, and the hitting direction is computed to approximately point towards the goal.Moreover, we add an additional constraint manifold loss term that penalizes the displacement of the robot end-effector from the table surface, and a task loss term that penalizes the high centrifugal forces at the end-effector, to reduce the trajectory tracking errors.The mathematical definition of these losses, together with all parameters of this experiment, can be found in Appendix B2.
3) Quantitative comparison with state-of-the-art: We compared our approach with state-of-the-art motion planning algorithms on the set of 81 hitting scenarios of a puck being located on a 9×9 grid, which were not present in the training and validation sets.One of the key challenges of this task is that the goal configuration has to be reached with a given high velocity in order to score the goal.It is hard to plan the trajectory that satisfies this kind of constraint, especially using sampling-based motion planners.Therefore for CBiRRT, MPC-MPNet and SST algorithms, we simplified the task, such that the goal was to at least reach the puck position i.e. we computed the distance function only for positional coordinates.
The results of this comparison are presented in Fig. 5.Even though the task for MPC-MPNet and SST planners is simplified, they cannot plan trajectories within a reasonable time.The only sampling-based algorithm which is able to reach the target is CBiRRT, which produces plans very hard to follow (see z-axis error chart in Fig. 5).Far better performance is achieved by optimization-based planners (TrajOpt and AQP), which almost always hit the puck and score, respectively in 91.35% and 92.59% of scenarios.The limitation of TrajOpt is that it needs nearly 10s on average to compute the plan, whereas the AQP mean planning time is 42ms.A similar planning time scale is achieved only by our proposed algorithm, which plans within 33ms.Moreover, our solution achieves a 100% of scoring ratio, plans the fastest trajectories (over 60% faster than AQP), obtains the highest hitting velocities, and despite this, it generates the trajectories that are possible to follow with the accumulated z-axis deviation smaller than 5mm•s.Interestingly, AQP is a state-of-the-art solution tailored specifically to planning for robotic Air Hockey, and yet its performance is dominated in terms of all considered criteria by the solution trained on automatically generated data using our proposed general framework.

4)
Qualitative results for replanning: So far, we have quantified how the proposed solution compares to state-ofthe-art solutions.However, due to the short and deterministic planning time, and the ability to satisfy boundary conditions, our proposed approach allows for solving tasks, that are impossible to solve using state-of-the-art planners i.e. replanning on the fly.We now consider a situation when the robot is performing some plan, and in the meantime, the goal changes e.g.puck's expected position or desired hitting direction has changed.For this type of task, the planning time of almost all state-of-the-art methods is too long to react.Moreover, typical motion planning methods do not give any guarantee about the maximal planning time.Unlike these classical approaches, our solution needs a small constant amount of computation to plan the motion.Therefore, we can predict a robot configuration Fig. 6.Sequence of frames form the replanning scenario.The robot starts the hitting motion with the puck located in the upper part of the table, but after 300ms puck is moved to the lower part.In response to this, CNP-B immediately replans the trajectory and scores the goal.located forward in time along the current trajectory, and plan from this configuration, taking into account the smoothness of the motion and continuity of actuation, by imposing the boundary conditions on the planned motion.
To learn how to plan for a moving robot, we prepared a more general (compared to the one introduced in Section IV-B2) dataset of hitting scenarios, which includes hitting from many different robot configurations in the accessible space, with random initial velocities and accelerations, and random desired hitting directions and velocities.A more detailed description of the used datasets can be found in Appendix B3.
In Fig. 6 we show a sequence of frames from the scenario where the robot tries to hit the puck, but after about 300ms from the beginning of the motion, the puck position changes suddenly.In response to this, the robot replans the trajectory from the point on the actually performed trajectory located a few tens of milliseconds in the future (to compensate for the nondeterministic communication times and the fact that the used operating system is not real-time) and then waits until the vicinity of this point is reached and switches to the new plan.As it is shown in Fig 6, the robot smoothly changes between plans and is able to score the goal with the replanned trajectory.

C. Planning high-speed Air Hockey hitting on real robot
The most important test of the quality of the proposed solution in robotics is the experimental evaluation on a real robot.This is especially important, because of the well-known problem of the reality gap, which is common in systems that use machine learning in simulation or learn from a dataset of simulated examples [59].To evaluate if this gap exists in our solution, we used exactly the same neural network for the experiments on the real robot as in the simulation, without any additional learning.
1) Quantitative comparison with state-of-the-art: Similarly, like in simulation, we perform the test of hitting the puck towards the goal, starting from a steady-still manipulator in a base configuration.For each scenario, the puck is placed on 1 of the 110 predefined puck positions (10×11 grid).Experiments in simulation showed us clearly that AQP was the only baseline able to compute safe to follow plans and to compete with the CNP-B.Therefore, in experiments on the real robot, we compared our proposed solution only to the AQP.Statistical comparison is presented in Fig. 7.The mean values of the planning time (time needed to plan both hitting and return movements) and hitting movement time correspond with the one obtained in the simulation.However, in this plot, we can see that CNP-B is characterized by a much smaller variance.Moreover, the planned hitting velocity magnitude is higher for the proposed solution, due to the fact that AQP method scales down the hitting velocity if it cannot find a feasible plan.The biggest advantage of the proposed planner is visible in terms of the z-axis error, as the generated plans are much closer to the table surface.Also, the trajectory tracking errors are smaller for CNP-B, despite faster trajectories.Nevertheless, from the task point of view, the most important metric (besides safety) is the ratio of scored goals to all attempts.In this category, CNP-B outperforms AQP, by reaching the ratio of 78.2% compared to 52.7%.In Fig. 8 we present the grid of puck positions and indicate the scored goal from this position with green and miss with red.It is visible that AQP has problems with executing plans for the puck close to the corners of the table, while CNP-B errors seem not to show any particular correlation with the geometry of the playing field.We hypothesize that the few unsuccessful hits by CNP-B are related to the mechanical setup of the physical system (particularly the mallet and its attachment to the robot), thus illustrating rather the reality gap problem.
2) Trick shots: The ability of the proposed solution to rapidly plan and replan robot motions, which we have shown in simulation, is also easily transferable to the real robot without any further learning.In Fig. 9 we present a sequence of frames from the scenario where the robot starts making feinting movements to confuse the opponent, and after some time, computes the new hitting trajectory, starting from nonzero velocity and acceleration, and scores a goal.This kind of dynamic replanning behavior is possible only because our proposed solution plans within a very short and almost constant time, and is able to plan from non-zero boundary conditions imposed on velocity and acceleration.

D. Discussion
In this section, we want to analyze the strengths and weaknesses of our approach w.r.t. the state-of-the-art planners.Our experiments have shown that our methodology outperforms every state-of-the-art method under all metrics.We believe this performance increase is due to three crucial aspects of our approach: (i) the handling of constraints, (ii) the use of flexible trajectory parameterization, (iii) the learning setup.
First, we treat the constraints satisfaction problem as loss minimization, instead of a hard constraint that should be satisfied any time.This treatment allows us to accept small violations both during training and deployment.While in some scenarios, small trajectory violations are a major problem, these violations are acceptable for most practical setups.Unfortunately, our handling of the constraints does not guarantee the path planned will satisfy all the constraints.However, it is fairly easy to verify that a planned trajectory complies with the requirements and abort the plan if necessary.State-of-the-art planners handle constraints in various ways, which we described in Section II, however, none of them is perfect.The SST and MPC-MPNet algorithms satisfy the robot kinodynamic constraints by relying on the control space sampling.However, for systems with many degrees of freedom, it leads to slow planning.Moreover, samplingbased planners have innate problems when other task-related constraints are present, as they are represented as obstacles that form narrow passages, which results in a further slowdown.In response to this problem, the CBiRRT algorithm was introduced, ensuring geometrical constraint satisfaction using projection on the constraint manifold.Unfortunately, this planner cannot properly handle the kinodynamic constraints in dynamic motion because it only generates paths.In turn, optimization-based methods can handle constraints very well, but if antagonistic constraints are present, they may cause the optimization to stuck at a local minimum.
Second, thanks to our B-spline parameterization, we can easily ensure that the plans will always start from the current state and reach the planned one in every trajectory computed by the network.While this property could cause issues in the learning process and plan generation, our B-spline parametrization decouples the geometrical path and the speed of execution by learning a spline for the time coordinate.This decoupling gives us great flexibility and simplifies the learning process.Using parametrized trajectories simplifies the structure of the neural network, avoiding complex learning procedures required for recurrent networks.Also, it is easy to tune the number of control points of the spline to control the maximum allowed complexity of the path.Finally, our learning setup is simple, as it does not require any expert dataset besides the models of the robot and environment.Furthermore, it is easy to generalize to different tasks and settings.In principle, if we provide a sufficiently large training set, this approach could process any relevant information to solve the task, allowing for advanced obstacle avoidance and maneuvering e.g., as done in [15].However, there is no practical way to guarantee that the generated plans will not violate any of the constraints.This lack of guarantees can be potentially seen as a drawback w.r.t.other methods, as they can adapt on the fly and optimize the trajectory, ensuring that the solution found is feasible.However, it is always possible to improve the trajectory generated by our method with further optimization e.g., using the TrajOpt framework.Further optimization of the generated trajectory is feasible because the planning time of the proposed method is negligible compared to basic trajectory optimization.Another important gain from the short planning time, combined with a constant amount of computation and boundary conditions satisfaction thanks to B-spline trajectory representation, is the ability to feasible and smooth replanning on the fly.To the best of our knowledge, it is the first time this kind of dynamic smooth replanning is presented for problems of this complexity, along with a demonstration on a real robot.

V. CONCLUSIONS
In this paper, we presented a complete learning solution to kinodynamic planning under arbitrary constraints.Exploiting Deep Neural Networks, we are able to learn a planning function generating plans lying in close vicinity of the constraint manifold.Our approach is easy to implement, computes plans with minimal computational requirements, and can replan from arbitrary configurations.Our method is flexible and can adapt to many different tasks, and it does not require any reference trajectories for training.While we cannot ensure the safety of all the plans generated by the neural network, it is always possible to perform post-processing steps and discard the plans that do not satisfy the constraints.Our real robot experiment shows that the proposed method can be successfully used in real-world tasks, outperforming existing ad-hoc solutions.CNP-B can be seen as a solution bridging the gap between a reactive neural controller and a classic motion planning algorithm.It is fast as the reactive neural controller but computes the whole plan at once, like a planning method, which is important from the safety point of view.
In future work, we would like to include some representation of the constraint manifold in the input of the neural network to be able to plan on multiple manifolds without retraining.It would also be interesting to check whether CNP-B can be applied as a motion generator, plugged into a higherlevel reinforcement learning setup as a parametrizable action, e.g. to learn how to play the whole game of Air Hockey.

A. Satisfying B-spline boundary constraints
To satisfy the boundary constraints of the problem using our B-spline trajectory, we define the vector of knots k by where D is the degree of the B-spline and C is the number of the B-spline control points.This design of the knots vector ensures that the resultant B-spline value on the boundaries will be defined directly by the first and last control points.Thus, we can introduce formulas to calculate the first three and last two control points C p based on the r(s) control points and reaching task constraints where η p , β p and η r are defined by where D p and D r are the degrees of the p(s) and r(s) Bsplines respectively, and C p and C r are the numbers of their control points.

B. Experimental evaluation details
1) Heavy object manipulation: a) Data preparation: The data generation process for this experiment was done in the following way: i. draw random initial and desired position of the heavy object, ii.assume that the pedestal boxes have fixed dimensions and are located just beneath the objects, iii.draw initial guess configuration of the robot, iv.starting from this configuration, optimize the robot's initial configuration, such that its end-effector position matches the initial position of the heavy object, and the orientation is vertical, v. validate if the robot in the initial configuration does not collide with the environment and if it does not violate the torque constraints, vi.starting from the initial configuration, optimize the robot desired configuration, such that its end-effector position matches the desired position of the heavy object, vii.validate if the robot in the desired configuration does not collide with the environment and if it does not violate the torque constraints.The specific parameters values and ranges are shown in Table I, where o z0 , o zd represents the object's initial and desired position along z-axis, whereas o h = 0.15 m is the fixed height of the object.
b) Additional loss functions: As we already mentioned in the main text, in this task, to meet the constraints imposed on this task, we introduced 3 additional loss terms i.e. vertical orientation loss defined by , where R 2,2 is the element of the end-effector rotation matrix with an index of (2, 2), robot collision loss defined by where E represents the set of the collision objects in the environment (pedestals), FK kc is a set of points in the workspace located along the kinematic chain (representation of the robot geometry), and d(X, Y ) is a Euclidean distance between X and Y , and finally, object collision loss where FK o represents the set of points that belong to the handled object and I(X, Y ) is an indicator function, which is equal to 1 if X ∈ Y and 0 otherwise.In our experiments, we defined environment E as two cuboids defined in Tab.I.The heavy object handled by the robot is a cuboid with dimensions 0.2 × 0.2 × 0.3 m, which for collision-checking purposes is represented by its corners.The robot itself is represented by the positions of the joints in the workspace and points linearly interpolated between them, such that no point lies further than 10 cm from its neighbors.
2) Simulated Air Hockey hitting: a) Data preparation: The data generation process for this experiment was done in the following i.draw random initial and desired position of the mallet, such that they are at least 10 cm apart, ii.starting from the base configuration, optimize the robot's initial configuration, such that its end-effector position matches the initial position of the mallet, iii.using the desired mallet position and goal position, define the desired hitting angle, and add noise to it, iv.compute the desired joint velocity of the robot that maximizes the manipulability along the hitting direction [8] b) Additional loss functions: As we already mentioned in the main text, in this task, to meet the constraints imposed on this task, we introduced an additional constraint manifold loss term, which is responsible to maintain the mallet position on the table surface.We define this loss function as the sum of the losses in x, y, z directions where specific losses are defined by where T x , T x , T y , T y are the lower and upper boundaries of the table in the x and y directions, while T z is the table surface height.Moreover, we observed that the robot controller has problems with tracking very fast trajectories, especially when trajectory curvature in the workspace is high.Therefore, we introduced an additional regularization term to the typical time-minimization task loss and defined the task loss function by L t (s) = 1 + ηκ ee (s)v 2 ee (s), where η = 0.01 is an experimentally chosen regularization factor, while κ ee and v ee are respectively the curvature and velocity of the end-effector trajectory.
3) Dataset for Air Hockey hitting replanning: The dataset for learning how to hit and be able to replan is similar to the one created just for the hitting task, however, it is far more diversified.To be able to replan, we need to know how to plan between any two configurations in the workspace.Moreover, to be able to perform different trick shots we randomized also the desired hitting direction, initial velocity, and acceleration.The data generation procedure scheme is similar to the one shown in Appendix B2 and differs only in the following steps i.Initial and desired mallet positions range defined by (x, y, z) ∈ [0.6; 1.3] × [−0.45; 0.45] × {0.16} iii.draw a hitting angle which differs from the direction of the line connecting initial and desired positions no more than 2π 3 , v. in 80% of the cases randomly scale the magnitude of the desired joint velocity, and set to maximal in the rest, vii.compute random initial joint velocity constrained to the table manifold, or set it to 0 in 20% of cases, viii.compute random initial joint acceleration constrained to the table manifold.The created dataset consists of 120 000 samples, from which 112 000 belong to the training set and the rest to the validation set.

4) Parameters of the algorithms used for evaluation:
We compared our proposed approach with several state-ofthe-art motion planning algorithms i.e.TrajOpt [25], MPC-MPNet [54], CBiRRT [11], and SST [41].As we aim at increasing the reproducibility of our research, none of these methods was implemented by ourselves, instead, we relied on the following implementations: • for TrajOpt we employed the SLSQP minimization implemented in SciPy, with constraints and cost function implemented by us using pinochchio [57] library, • for MPC-MPNet and SST we used the implementation provided by the authors of [54] with some necessary modifications required to compile and run their code, and our C++ implementation of the heavy object manipulation and robotic Air Hockey systems which also utilizes the Pinocchio library [57], • for CBiRRT we used the OMPL [60] implementation and our own constraint and distance definitions.
To make our comparison fair we tried to adjust the parameters of these motion planning algorithms, to maximize their performance.Appropriate parameter tuning is especially important for the sampling-based motion planning algorithms, therefore we performed a random search of the parameters to find the regions of the parameter space, which give the highest success ratios and shortest planning times.In the case of the SST MPC-MPNet, some of their parameters are common because they use the same algorithm under the hood, the difference is in the way of selecting the node to expand and in the Expand procedure itself.Therefore, we set for both algorithms the same parameters for node search radius δ BN = 0.2 m, witness radius δ s = 0.1 m and goal radius r g = 0.2 m, for the task of heavy object manipulation, and δ BN = 0.05 m, witness radius δ s = 0.02 m and goal radius r g = 0.02 m for robotic Air Hockey hitting.Regarding the "extend" procedure, for both tasks, we set the minimum and the maximum number of steps to 1 and 20 respectively, with an integration step equal 5 ms for SST, whereas for MPC-MPNet we set the parameters of the CEM MPC solver to 64 samples, 4 elite samples, the maximal number of iterations equal 30 and convergence radius equal 0.02, as they resulted in fast convergence.We have also set the values of the integration step to 10 ms, motion time gaussian (µ t , σ t ) = (0.05, 0.1), with maximal time t max = 0.1 s, control gaussian (µ c , σ c ) = (0, 0.8τ ), for the heavy object manipulation task, for MPC-MPNet, while for Air Hockey (µ t , σ t ) = (0.1, 0.4), t max = 0.5 s, µ c , σ c ) = (0, 0.5τ ).
Nevertheless, despite the tuning of the parameters, obtained motion planning times were relatively long, which may be caused by the innate difficulty of the considered problem and very tight constraints, which can be viewed as narrow passages in the configuration space.For both SST and MPC-MPNet, we used the Euclidean distance function in the task space.This simplifies the motion planning problem a lot, as it requires the planners to plan only for the position, disregarding the task of reaching the desired velocity.It is also possible to define a distance function that takes into account the distance in the space of the velocities weighted with the distance in the task space, however, this makes the exploration of the states-space inefficient, slowing down further the planning process.For CBiRRT, for both tasks, we set the goal radius to 1 cm, and the allowed tolerance of the constraint to 0.01, while for the range parameter we used an automatically determined value by OMPL.In the case of the TrajOpt implementation in Scipy, there are no parameters that affect the performance of the method, so we only limited the maximum number of iterations to 100, to avoid prolonged optimization.
Our proposed method also has some important parameters that have to be chosen, however, all of them are parameters of the learning process, as the inference does not depend on anything but data and model.For our experiments, we set the number of control points of the p(s) and r(s) B-splines to 15 and 20 respectively, as it gives enough freedom to plan accurate trajectories that satisfy constraints.To ensure a high level of trajectory smoothness we set the degree of both Bsplines to 7. Another group of parameters is the one related to the manifold metric optimization i.e. α (0) .For the heavy object manipulation α (0) was set to the zero vector, while for the Air Hockey task we proposed a different initialization, which was meant to equalize the initial gradients of loss functions and was equal to α (0) = α (0) T α (0) q α (0) q α (0) τ = 1 1 10 −2 10 −4 .For the heavy object manipulation task, we defined the following levels of the allowed constraints violations CE = 10 −6 , CO = 10 −5 , C q = 6 • 10 −3 , C q = Cτ = 6 • 10 −2 , while for the hittng task CT = 2 • 10 −6 , C q = 6 • 10 −3 , C q = 6 • 10 −2 , Cτ = 6 • 10 −1 .The update step for the α parameters was set to 10 −2 for both motion planning problems.The learning step for neural network parameters was set to 5 • 10 −5 , while the batch size was set to 128.

Fig. 2 .
Fig. 2. Architecture of the neural network used to determine p(s) and r(s) B-spline control points.The Ω Block computes the control points of the configuration B-spline C p using (33) and (26).

Fig. 7 .
Fig. 7. Planners statistics on the task of hitting in the real robotic Air Hockey.

Fig. 8 .
Fig. 8. Visualization of the puck positions in the scenarios on which CNP-B and AQP palnenrs were evaluated.The green dots represent scored goals (success), while the red ones missed shots (failure).

Fig. 9 .
Fig. 9. Fast on-the-fly motion replanning can be used to smoothly change the robot's behavior from feinting to striking almost instantaneously.

Piotr
Kicki received his B.Eng. and M.Sc.degrees in automatic control and robotics from Poznan University of Technology, Poland in 2018 and 2019, respectively.He is currently a Ph.D. student in Robotics, at the Institute of Robotics and Machine Intelligence at Poznan University of Technology, Poland.His main research interests include robot motion planning and applications of machine learning in robotics.Puze Liu is pursuing his Ph.D. degree at Intelligent Autonomous Systems Group, Technical University Darmstadt since 2019.Prior to this, Puze received his M. Sc. in Computational Engineering from Technical University Berlin and B. Sc from Tongji University, China.Puze's research interest lies in the interdisciplinary field of robot learning that tries to integrate machine learning techniques into robotics.His prior work focuses on optimization, control, reinforcement learning, and safety in robotics.
, v. in half of the cases randomly scale the magnitude of the desired joint velocity, and set it to maximal in the other half, vi.validate the possibility of performing the hit, by analyzing if it is possible to avoid a collision after the hit, i.e. if the point defined by p h = p d + v h • 50 ms lies on the table surface, where p d is desired hitting point, and v h is the hitting velocity in the workspace.The specific parameter values and ranges are shown in Table II.