# Defining Feasible Joint and Geometric Workspaces Through Boundary Functions
## 3 Theoretical Framework and Methodology
The first step in ensuring that the manipulator operates safely and within a feasible workspace is to define the mathematical conditions under which collisions between links occur. These conditions are crucial for analyzing and understanding the interactions between the kinematic elements of the manipulator. The subsequent collision model generalizes these conditions, providing a foundational framework for identifying all potential collision scenarios. Finally, these generalized insights are used to construct boundary functions,which incorporate kinematic, collision avoidance, and geometric constraints to define the feasible workspace free of collisions. To formalize the analysis, the following theorem generalizes the collision model for points within a kinematic chain. Theorem 1: _Let the kinematic chain \(0\prec a\prec a+n\prec b\prec b+m\) be defined, where \(0\) represents the base system, \(a\) and \(b\) are systems with variable position and orientation relative to each other, and \(a+n\) and \(b+m\) denote points with constant position and orientation within their respective local systems \(a\) and \(b\)._  
_A collision between the points \(a+n\) and \(b+m\) is said to occur if and only if the relative vector between these points equals a null vector:_  
\[\mathbf{r}_{a+n,b+m}=\mathbf{0}, \tag{13}\]  
_wherein this condition is equivalent to the norm of the relative vector being null:_  
\[\|\mathbf{r}_{a+n,b+m}\|=0, \tag{14}\]  
_and under this condition, the relative position between the points is expressed as_  
\[\mathbf{r}_{a+n,b+m}=\mathbf{r}_{a,b}+R_{a,b}\cdot\mathbf{r}_{b,b+m}-\mathbf{ r}_{a,a+n}, \tag{15}\]  
_where \(R_{a,b}\in\mathbb{R}^{3\times 3}\) is the rotation matrix that transforms the coordinates from \(b\) to \(a\), \(\mathbf{r}_{a,b}\in\mathbb{R}^{3}\) represents the relative position vector between \(a\) and \(b\), \(\mathbf{r}_{a,a+n}\in\mathbb{R}^{3}\) denotes the local position of \(a+n\) relative to \(a\), and \(\mathbf{r}_{b,b+m}\in\mathbb{R}^{3}\) refers to the local position of \(b+m\) relative to \(b\). The condition for collision can also be expressed in terms of the boundary function \(B(\mathbf{q})\in\mathbb{R}^{3}\), which depends on the joint variables \(\mathbf{q}\). This boundary function is defined as_  
\[B(\mathbf{q})=\mathbf{r}_{a,b}+R_{a,b}\cdot\mathbf{r}_{b,b+m}-\mathbf{r}_{a,a +n}. \tag{16}\]  
_A collision occurs if and only if_  
\[B(\mathbf{q})=\mathbf{0}. \tag{17}\]  
Figure 2: Illustration of a kinematic chain is presented as a simplified example of a planar robot. The nodes \(a\) and \(b\) indicate the joint positions connecting consecutive links, while the points \(a+n\) and \(b+m\) are identified as collision points between adjacent links. _The collision condition implies that all components of the vector \(\mathbf{r}_{a+n,b+m}\) are null, ensuring the positional coincidence of the points involved._  
Proof of Theorem 1.: To derive the condition for a collision, we begin with the general formula for relative positions in a kinematic chain:  
\[\mathbf{r}_{a,b}=\mathbf{r}_{a,b-1}+R_{a,b-1}\cdot\mathbf{r}_{b-1,b}, \tag{18}\]  
where \(\mathbf{r}_{a,b}\) is the relative vector between systems \(a\) and \(b\), \(\mathbf{r}_{a,b-1}\) is the vector between \(a\) and \(b-1\), \(\mathbf{r}_{b-1,b}\) is the vector between \(b-1\) and \(b\), and \(R_{a,b-1}\) is the rotation matrix that transforms coordinates from \(b-1\) to \(a\). While this relationship can be recursively extended for longer chains, we focus here on the consecutive points \(a+n\) and \(b+m\) for simplicity.