3D Limb Bones Intersection Problem
My previous trajectory plotter checked for intersections linearly between the Bézier curve resolution points to determine whether the was an obstacle, and whether the respective obstruction was ‘walkable’.This approach was suitable for the 2D biped walker, as the model only had to account for the travel space of a point (the centre of the end effector).
Using a 3D model, the foot object (from ankle joint to toe-end joint) must be considered as it moves through space.
To obtain a trajectory that guarantees not to pass through another object, Zhao (2015, pp. 52-58) proposes creating a path of connected ‘bubbles’ as shown in figure 1.
"the concept of bubbles of free configuration space ... is an exact collision checking by attempting to cover the path with collision-free neighborhoods"(Zhao, 2015, p. 54)
Figure 1: Overlapping bubbles of free space to create a clear path (Zhao, 2015, p. 55) |
A tunnel is created by placing part of the following bubble (sphere) within the previous bubble. Each bubble is then checked for intersecting objects – and if all bubbles along the path return no intersecting objects they “guarantee the collision-free status of a trajectory segment by overlapping these bubbles along each segment" (Zhao, 2015, p. 54)
The creation of this pathway of free space will allow me to ensure that the foot and leg limb do not meet any obstacle during swing phase.
Implementation
To create this behaviour, I modified the existing intersection check used in the generation of end-effector trajectory for my 2D walking biped.Instead of linecasting between the curve resolution points, sphere casting between all successive resolution points will produce a continuous 3D tunnel which can check for any colliding objects.
Figure 2: My free-space bubble trajectory |
For debugging purposes, bubbles are drawn to scene view using Unity’s gizmos.
The float ‘Bubble Radius’ has been created to allow the radius of each bubble to be appropriately scaled for the size of the model feet from the Unity inspector. This same value is passed to the drawn spheres in scene view to exactly represent the free space path created, for debugging purposes.
While at larger extensions the resolution points may cause the drawn gizmos to separate, the sphere cast will remain continuous between each sequential pair of resolution points.
References
Zhao, R. (2015). Trajectory planning and control for robot manipulation. Doctorate. L’UNIVERSIT ́E DE TOULOUSE. pp. 52-58. Available at: https://tel.archives-ouvertes.fr/tel-01285383v2/document#%5B%7B%22num"%3A161%2C"gen"%3A0}%2C{"name"%3A"XYZ"}%2C102.047%2C492.743%2Cnull%5D [Accessed 8 Jun. 2019].
Bibliography
Unity Technologies (2018). Unity - Scripting API: Physics.SphereCast. [online] Docs.unity3d.com. Available at: https://docs.unity3d.com/ScriptReference/Physics.SphereCast.html [Accessed 10 Jun. 2019].