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$ .
Solve
$f(x)=3 \cos \left(\omega x+\frac{\pi}{6}\right)-\sin \left(\omega x+\frac{\pi}{6}-\frac{\pi}{2}\right)=4 \cos \left(\omega x+\frac{\pi}{6}\right)$, then $T=\pi \Rightarrow \omega=2$, and $2 x+\frac{\pi}{6} \in\left[\frac{\pi}{6}, \frac{7 \pi}{6}\right] \Rightarrow f(x)_{\max }=f(0)=2 \sqrt{3}$.