The SepImage separator
Main author: Maël Godard
Definition
Consider a set \(\mathbb{X}\subset\mathbb{R}^n\) and a function \(\mathbf{f}:\mathbb{R}^n\to\mathbb{R}^p\).
The initial set \(\mathbb{X}\) is provided through a contractor, while its boundary is described by a gnomonic atlas.
The function \(\mathbf{f}\) is provided as an AnalyticFunction, allowing interval evaluations of its image.
The SepImage separator handles the image set \(\mathbf{f}(\mathbb{X})\) by separating boxes
\([\mathbf{y}]\in\mathbb{IR}^p\) with respect to the constraint \(\mathbf{y}\in\mathbf{f}(\mathbb{X})\).
Construction and basic usage
The SepImage relies on a boundary approach to compute the image set. The boundary of the initial set needs to be
covered by a gnomonic atlas. To compute the image of the boundary,
the parameter box \(\left[-1,1\right]^m\) can be subdivided up to a size \(\epsilon\) and the image of each resulting box
is computed. Note that if one chooses to take \(\epsilon=2\), only one computation will be done per chart of the atlas.
Once this image of the boundary has been computed, the SepImage needs a way to characterize if a point is inside or
outside of the image set. To do so, it looks for an antecedent of the point in the initial set. An additional contractor on
the initial set is then required.
The typical workflow is:
Define analytic variables (scalar, vector, matrix) associated with the domain of the function.
Build an
AnalyticFunction.Define a gnomonic atlas on the boundary of the initial set.
Define a contractor for this same initial set.
Instantiate
SepImagewith the atlas, the function, the resolution \(\epsilon\) and the contractor.Contract an input box \([\mathbf{y}]\) or pave the separator in the image space.
Example
Consider that we want to construct a separator on the image of the unit disk by the function
This function can be constructed in codac as follows
y = VectorVar(2)
f = AnalyticFunction([y], [3.*(y[0]+1),y[1]+0.5*sin(3.*y[0])])
VectorVar y (2);
AnalyticFunction f ({y},{3.*(y[0]+1),y[1]+0.5*sin(3.*y[0])});
We then need a contractor for the unit disk, and a gnomonic atlas for its boundary (the unit circle). For the atlas, the image of \(\left[-1,1\right]\) by the function
is half of the unit circle. The other half can be obtained with a rotation of \(\pi\) rad. Such atlas is constructed in Codac as follows:
# {psi0,Sigma} is a gnomonic atlas of the box [-1,1]^2
X = VectorVar(1)
psi0 = AnalyticFunction([X],[cos(X[0]*PI/2.),sin(X[0]*PI/2.)])
id = OctaSym([1,2])
s = OctaSym([-1,-2])
Sigma = [id,s]
// {psi0,Sigma} is a gnomonic atlas of the unit circle
VectorVar X(1);
AnalyticFunction psi0 ({X},{cos(X[0]*PI/2.),sin(X[0]*PI/2.)});
OctaSym id ({1, 2});
OctaSym s ({-1, -2});
vector<OctaSym> Sigma ({id,s});
In this example, the constraint on the initial set can be seen as a distance constraint. It can be treated as an inversion as follows :
h = AnalyticFunction([y],sqrt(sqr(y[0])+sqr(y[1])))
ctc_in = CtcInverse(h,Interval(0,1))
AnalyticFunction h ({y},sqrt(sqr(y[0])+sqr(y[1])));
CtcInverse ctc_in (h,Interval(0,1));
The separator can then be constructed and used, for example with a paver to get both an inner and an outer approximation of the image set. The resulting paving is shown in the next figure.
sep = SepImage(f,psi0,Sigma,0.125,ctc_in)
DefaultFigure.pave([[-0.5,6.5],[-1.5,1.5]],sep,0.05)
SepImage sep1 (f,psi0,Sigma,0.125,ctc_in);
DefaultFigure::pave({{-0.5,6.5},{-1.5,1.5}},sep1,0.05);
With a finer resolution (i.e., a smaller \(\epsilon\)), the approximation provided by the separator improves, as shown in the following figure.
sep = SepImage(f,psi0,Sigma,0.0625,ctc_in)
DefaultFigure.pave([[-0.5,6.5],[-1.5,1.5]],sep,0.05)
SepImage sep2 (f,psi0,Sigma,0.0625,ctc_in);
DefaultFigure::pave({{-0.5,6.5},{-1.5,1.5}},sep2,0.05);
A more complex example is available on the public GitHub repository. It treats the topic of the explored area, which is a classical problem in robotics.