|
MoveIt Pro API
Core Behaviors for MoveIt Pro
|
This package contains a Joint Trajectory with Admittance Controller (JTAC), implemented within the ros2_control framework. The JTAC is similar to the ros2_control Joint Trajectory Controller (JTC), with the addition of an optional 'admittance' component that enables executing joint-space trajectories with compliance in Cartesian space. For this, a force/torque sensor (FTS) is needed at the end of the kinematic chain being controlled. Otherwise the controller can still be used, but as a standard joint-trajectory controller without compliance.
The controller also features a time-scaling capability that allows dynamically adjusting the speed of trajectory execution during runtime.
This same behavior could potentially be achieved with ros2_control JTC and a layered Admittance controller. That approach, however, has a few issues that prevent using it outside of prototype-grade implementations:
ros2_control allocates memory in the control loop, which makes it unsuitable for real-time systems.ros2_control also allocates memory in functions used in real-time loops.ros2_control are implemented in a way they depend on other ROS 2 types and messages, which makes them difficult to use outside the ROS ecosystem.Our approach is to implement a new JTC with an embedded admittance component, which we call a Joint Trajectory with Admittance Controller (JTAC). This offers several advantages:
The JTAC has been designed with the following ideas in mind:
ros2_control wrapper. This makes it easier to reuse the core in other control frameworks outside ROS if needed.There are four frames involved in the JTAC computations:
The controller has a joint-space trajectory tracking component, and an admittance component. In the absence of any force/torque at the end-effector, or if there isn't a force/torque sensor, the controller behaves as a joint trajectory controller, i.e. it tracks a given joint-space trajectory. In the presence of a sensed wrench, the controller deviates from the nominal trajectory according to a spring-mass-damper model, i.e. it deviates as needed to accommodate the force, then converges back to the nominal trajectory when the force/torque disappears:
The spring-mass-damper behavior is applied in Cartesian space, and mapped into joint-space via the robot kinematic model. The following image shows the spring-mass-damper model applied in Cartesian coordinates at the robot tip.
The arm is following a trajectory and needs to reach a joint-space reference (semi-transparent UR5). The robot is currently at a different joint-space configuration because a sensed wrench F made it deviate. The controller computes the displacement from the current configuration, in Cartesian space, to the desired one, x. It then applies the spring-mass-damper model with user given mass (M), stiffness (K) and damping (D) parameters, and the sensed wrench F. The output of the model is a Cartesian-space acceleration at which the arm end-effector needs to move. That Cartesian-space acceleration is then transformed into joint-space via inverse differential kinematics, and integrated into new joint-space velocities and accelerations.
Here's a more detailed control diagram:
The sensed wrench goes through a sequence of steps before it gets used by the controller:
The behavior of these filters can be configured via the runtime parameters ft_cutoff_frequency_ratio, ft_force_deadband, ft_torque_deadband and gravity_vector (see the Parameter interface section below).
The Joint Trajectory Admittance Controller includes a time scaling feature that allows dynamic adjustment of trajectory execution speed during runtime. This feature enables operators to slow down trajectory execution (up to 100% of the original speed) based on real-time conditions, safety requirements, or operational needs.
What it does: Time scaling modifies the rate at which the controller progresses through a trajectory. When enabled, the controller can execute trajectories slower (e.g., 50% speed) up to the original full speed (100%), providing fine-grained control over motion execution while maintaining safety limits.
Parameters:
time_scale_filter_constant**: Time constant for the first-order lag filter that smooths time scaling changes. This parameter controls how quickly the controller responds to speed scaling commands. Lower values provide faster response but may cause jerky motion, while higher values create smoother transitions but slower response to speed changes. When the time scale input changes from 0 to 100, it takes 4x time_scale_filter_constant seconds to reach 98% of that change.The JTAC is exposed to the ROS 2 ecosystem as a ros2_control plugin with name moveit_pro_controllers/JointTrajectoryAdmittanceController. It exposes four ROS 2 interfaces:
The controller command interface is exposed as a ROS 2 Action. The action message and its documentation is included in moveit_pro_controllers/FollowJointTrajectoryWithAdmittance.action.
Unlike the JTC in ros2_control, the JTAC won't report the command as finished until the robot is fully stopped. If, for instance, an error happens during trajectory execution (e.g. excessive force), the controller will plan and execute a minimum-time stop trajectory before returning control to the caller.
The controller state is published as a control_msgs/JointTrajectoryControllerState message, and includes the reference state, the actual state and the current error.
The controller listens to a parameter named time_scale_percentage of type double. The parameter expects values between 0 and 100, where 100 means full speed (no time scaling), and 0 means stop. Values in between will slow down the trajectory execution proportionally.
The time scaling feature integrates seamlessly with the admittance control system, ensuring that force-based interactions remain stable regardless of the selected execution speed.
To make the JTAC available in your configs, add and adapt the following snippet to your ros2_control.yaml config file:
Here's the list of all the parameters that can be configured, with their descriptions and default values:
interpolation.hpp: ROS-agnostic trajectory interpolation functions.admittance.hpp: ROS-agnostic admittance setpoint generation functions.stop_trajectory.hpp: ROS-agnostic functions to compute minumum-time stop trajectories.signal_processing.hpp: ROS-agnostic force-torque signal processing functions (e.g. filtering, deadband)joint_trajectory_admittance_controller.hpp: The main controller implementation within the ros2_control framework.