Solves \(M(q)\ddot q = \tau - C(q, \dot q)\dot q - g(q) + J^\top f_{ext}\) for the joint accelerations in \(O(n)\) operations. Every degree of freedom must move some mass or rotational inertia; otherwise the articulated inertia is singular and the function stops.
Usage
robot_forward_dynamics(
robot,
q,
qd = NULL,
tau = NULL,
gravity = c(0, 0, -9.81),
f_ext = NULL
)Examples
robot <- robot_example("planar2")
robot_forward_dynamics(robot, c(0, 0), gravity = c(0, -9.81, 0))
#> joint1 joint2
#> -12.61286 16.81714