|
227 | 227 | \end{bmatrix}. |
228 | 228 | $$ {#eq-angular-vel} |
229 | 229 |
|
| 230 | +In practice, we can compute the angular velocity vector of a unit QTS using the `squat::qts2avts()` function as follows: |
| 231 | +
|
| 232 | +```{r} |
| 233 | +avts <- squat::qts2avts(smoothed_qts) |
| 234 | +avts |> |
| 235 | + dplyr::rename(`v[x]` = x, `v[y]` = y, `v[z]` = z) |> |
| 236 | + tidyr::pivot_longer( |
| 237 | + cols = c(`v[x]`, `v[y]`, `v[z]`), |
| 238 | + names_to = "component", |
| 239 | + values_to = "angular_velocity" |
| 240 | + ) |> |
| 241 | + ggplot(aes(x = time, y = angular_velocity)) + |
| 242 | + geom_line() + |
| 243 | + facet_wrap(~component, ncol = 1, scales = "free_y", labeller = label_parsed) + |
| 244 | + theme_bw() + |
| 245 | + labs(title = "", x = "Time (seconds)", y = "Angular velocity (rad/s)") |
| 246 | +``` |
| 247 | +
|
230 | 248 | The angular acceleration vector $\dot{\pmb{\Omega}}$ is then computed as the derivative of the angular velocity vector: |
231 | 249 |
|
232 | 250 | $$ |
|
243 | 261 | \end{bmatrix} \right) |
244 | 262 | $$ {#eq-angular-acc} |
245 | 263 |
|
| 264 | +Again, we can compute the angular acceleration vector of a unit QTS using the `squat::qts2aats()` function as follows: |
| 265 | +
|
| 266 | +```{r} |
| 267 | +# aats <- squat::qts2aats(smoothed_qts) |
| 268 | +# aats |> |
| 269 | +# dplyr::rename(`a[x]` = x, `a[y]` = y, `a[z]` = z) |> |
| 270 | +# tidyr::pivot_longer( |
| 271 | +# cols = c(`a[x]`, `a[y]`, `a[z]`), |
| 272 | +# names_to = "component", |
| 273 | +# values_to = "angular_acceleration" |
| 274 | +# ) |> |
| 275 | +# ggplot(aes(x = time, y = angular_acceleration)) + |
| 276 | +# geom_line() + |
| 277 | +# facet_wrap(~component, ncol = 1, scales = "free_y", labeller = label_parsed) + |
| 278 | +# theme_bw() + |
| 279 | +# labs(title = "", x = "Time (seconds)", y = "Angular acceleration (rad/s²)") |
| 280 | +``` |
| 281 | +
|
246 | 282 | Euler angles |
247 | 283 |
|
248 | 284 | : The angles named *Roll*, *Pitch* and *Yaw* represent rotations around the three principal axes. They are computed from a unit quaternion $\mathbf{q} = (q_w, q_x, q_y, q_z)$ using the following formulas: |
|
0 commit comments