1. If the function
$$
f(x)=3 \cos \left(\omega x+\frac{\pi}{6}\right)-\sin \left(\omega x-\frac{\pi}{3}\right)(\omega>0)
$$

has the smallest positive period of $\pi$, then the maximum value of $f(x)$ in the interval $\left[0, \frac{\pi}{2}\right]$ is $\qquad$
$-1.2 \sqrt{3}$.
Notice,
$$
\begin{array}{l}
f(x)=3 \cos \left(\omega x+\frac{\pi}{6}\right)-\sin \left(\omega x-\frac{\pi}{3}\right) \\
=3 \cos \left(\omega x+\frac{\pi}{6}\right)-\sin \left(\omega x+\frac{\pi}{6}-\frac{\pi}{2}\right) \\
=3 \cos \left(\omega x+\frac{\pi}{6}\right)+\cos \left(\omega x+\frac{\pi}{6}\right) \\
=4 \cos \left(\omega x+\frac{\pi}{6}\right),
\end{array}
$$

and the smallest positive period of $f(x)$ is $\pi$.
Thus, $\omega=2, f(x)=4 \cos \left(2 x+\frac{\pi}{6}\right)$.
When $x \in\left[0, \frac{\pi}{2}\right]$, $\frac{\pi}{6} \leqslant 2 x+\frac{\pi}{6} \leqslant \frac{7 \pi}{6}$.
Therefore, when $2 x+\frac{\pi}{6}=\frac{\pi}{6}$, i.e., $x=0$, $f(x)$ reaches its maximum value $2 \sqrt{3}$ in the interval $\left[0, \frac{\pi}{2}\right]$.