ROS 2 package for using C++ robot dynamics in control applications
This package is based on the ros-controls/kinematics_interface package and add the following features useful for force or impedance control:
- compute the joint inertia matrix
$H(q)$ usingcalculate_inertia
; - compute the vector containing the Coriolis and centrifugal terms
$C(q, \dot{q})$ usingcalculate_coriolis
. Note that the so-called Coriolis matrix is NOT returned, but instead its dot product with$\dot{q}$ ; - compute the gravity terms
$G(q)$ usingcalculate_gravity
; - compute the time derivative of the Jacobian matrix
$\dot{J}(q, \dot{q}) = \cfrac{d}{dt}J(q)$ usingcalculate_derivative_jacobian
.
Given a robot with
where
The package dynamics_interface_kdl is a specialization of the kinematics_interface_kdl package on which it is based.
Typical .yaml
configuration:
dynamics_interface_fd:
plugin_name: dynamics_interface_kdl/DynamicsInterfaceKdl
plugin_package: dynamics_interface
base: base_frame
tip: tool_frame
alpha: 0.0005
gravity: [0., 0., -9.81] # in base frame
The package dynamics_interface_fd is intended to be used in conjunction with the stack ICube-Robotics/forcedimension_ros2.
Since the inertia cannot be computed from the URDF, a asynchronous node is instantiated to subscribe to the fd_inertia
topic published by a fd_inertia_broadcaster.
Note that both the coriolis and gravity vector are zero, because they are negligible on most devices (i.e., gravity compensated, no heavy part in rotation).
Typical .yaml
configuration:
dynamics_interface_fd:
plugin_name: dynamics_interface_fd/DynamicsInterfaceFd
plugin_package: dynamics_interface
base: fd_base
tip: fd_ee
alpha: 0.0005
fd_inertia_topic_name: fd_inertia
TODO:
- compute Coriolis matrix? Does not seem trivial with KDL, but should be easy with Pinocchio.
- manage redundancy here? For instance, with some function like
convert_cartesian_wrench_to_joint_torque
that implement null-space objectives under the hood.