Problem 1:
Using the template Webots project included on Canvas. Write a robot controller (for the "mybot" differential drive robot used in the lectures) to move the robot from its initial position and orientation ($X_0$=-0.25 m, $Y_0$=0.25 m, $\theta_0$=1.3) to the final position and orientation ($X_f$=0.38 m, $Y_f$=-0.25 m, $\theta_f$=$\pi$/2). Both positions are measured with respect to the world's coordination. The controller should use the following forward kinematics equations, as derived in the lecture, to estimate the robot's current position:
$\begin{bmatrix} \dot{x} \\ \dot{y} \\ \dot{\theta} \end{bmatrix} = \begin{bmatrix} r/2 & r/2 \\ 0 & 0 \\ r/2b & r/2b \end{bmatrix} \begin{bmatrix} \phi_l \\ \phi_r \end{bmatrix}$
where $r$ is the radius of both wheels, $b$ is the distance from the center of the robot to the middle of the wheel.
For this controller, the value of the $\phi_l$ and $\phi_r$ should be extracted using the embedded wheel's encoder, and the robot orientation $\theta_R$ should be extracted from the robot's IMU sensor.
The new robot is equipped with LDS-01 Lidar which should be used to draw a map of the robot's environment. In this map, every captured point for the wall or the blocks should be considered as a landmark. After building a map of the environment, use the extracted map to calculate a path from the starting point to the endpoint using the A* algorithm as explained in the lecture and the provided example code.
Using the designed path with all intermediate points, your controller should use a Proportional Controller to move the robot to these intermediate target points, one after the other until it arrives at the final target point. The formulas of the proportional controller are:
$\rho = \sqrt{(X_{RI} - X_u)^2 + (Y_{RI} - Y_u)^2}$
$\alpha = -\theta_{RI} + tan^{-1}\frac{Y_u - Y_{RI}}{X_u - X_{RI}}$
$\phi_l = -P_1\alpha + P_2\rho$
$\phi_r = P_1\alpha + P_2\rho$
where ($X_{RI}$, $Y_{RI}$, $\theta_{RI}$) are the robot's state w.r.t. the world's frame, ($X_u$ and $Y_u$) are the intermediate target point coordination, $P_1, P_2$ are the proportional controller constants, $\rho$ is the distance error, $\alpha$ is the rotation error. You can adjust the final $\theta_{RI}$ of the robot after arriving at the final position. Your controller should also provide the updated position of the robot after each timestep on a figure or a Webots' screen monitor.