  For a class of spatio-temporal tasks defined by a fragment of Signal Temporal
Logic (STL), we construct a nonsmooth time-varying control barrier function
(CBF) and develop a controller based on a set of simple optimization problems.
Each of the optimization problems invokes constraints that allow to exploit the
piece-wise smoothness of the CBF for optimization additionally to the common
gradient constraint in the context of CBFs. In this way, the conservativeness
of the control approach is reduced in those points where the CBF is nonsmooth.
Thereby, nonsmooth CBFs become applicable to time-varying control tasks.
Moreover, we overcome the problem of vanishing gradients for the considered
class of constraints which allows us to consider more complex tasks including
disjunctions compared to approaches based on smooth CBFs. As a well-established
and systematic method to encode spatiotemporal constraints, we define the class
of tasks under consideration as an STL-fragment. The results are demonstrated
in a relevant simulation example.
