  Control barrier functions (CBFs) have recently been introduced as a
systematic tool to ensure safety by establishing set invariance. When combined
with a control Lyapunov function (CLF), they form a safety-critical control
mechanism. However, the effectiveness of CBFs and CLFs is closely tied to the
system model. In practice, model uncertainty can jeopardize safety and
stability guarantees and may lead to undesirable performance. In this paper, we
develop a safe learning-based control strategy for switching systems in the
face of uncertainty. We focus on the case that a nominal model is available for
a true underlying switching system. This uncertainty results in piecewise
residuals for each switching surface, impacting the CLF and CBF constraints. We
introduce a batch multi-output Gaussian process (MOGP) framework to approximate
these piecewise residuals, thereby mitigating the adverse effects of
uncertainty. A particular structure of the covariance function enables us to
convert the MOGP-based chance constraints CLF and CBF into second-order cone
constraints, which leads to a convex optimization. We analyze the feasibility
of the resulting optimization and provide the necessary and sufficient
conditions for feasibility. The effectiveness of the proposed strategy is
validated through a simulation of a switching adaptive cruise control system.
