I understand the functioning of Particle Filters from the book Probabilistic Robotics and the robotics course provided by Cyrill Stachniss.
I want to implement, from scratch, a particle filter to estimate the tilt angle $\theta$, angular velocity $\omega := \dot\theta$ and bias $b$ in one direction. I want to implement the most basic PF version as shown below. I have the mathematical model (that I can't post here for legal reasons) to do so when I was learning Kalman Filters in a University course. To explain in short, I have a process model, \begin{equation} x_k = A x_{t-1}, \end{equation} and a corresponding motion uncertainty matrix $Q$. Similarly, I have a measurement model, \begin{equation} z_t = C x_t, \end{equation} and the measurement covariance matrix $R$.
How do I go from this model to implementing the same in Particle Filters? PF requires to sample from the probabilistic state transition model: \begin{equation} x \sim p(x_t ~ | ~ x_{t-1}, u_t). \end{equation} Then, how do I assign a weight to each particle? That is, how do I evaluate this step of the algorithm \begin{equation} w = p(z_t ~ | ~ x_{t}), \end{equation} which requires evaluating the posterior for each particle $x_t$. I want to implement the most basic PF algorithm shown below, which I was able to do with Kalman Filters.