Cartesian Velocity / Force Controller
Overview
This package contains a ROS 2 controller that can be used to control a robot's end-effector in 3D space using Cartesian velocity and force setpoints. The controller is designed to be used with a force-torque sensor, and it can be used to implement hybrid force/velocity control. The controller can also be used without a force-torque sensor, in which case it will be a Cartesian velocity controller.
See the main documentation for more information on the controller and how to use it.
Design
The VFC has been designed with the following ideas in mind:
- ROS-agnostic core library + ros2_control wrapper. This makes it easier to reuse the core in other control frameworks outside ROS if needed.
- Streaming interface. The controller is designed to be used with a streaming interface, where the user is expected to send velocity and force setpoints at some rate. This makes it specially suitable for as a teleoperation controller, or for use with other higher level closed loop controllers (e.g. visual servoing).
- Real-time safe: no allocations in real-time thread. Validated via memory allocation tests (see malloc_counter.hpp).
- Exit conditions (e.g. command timeout) trigger a full stop, satisfying user-defined Cartesian and joint-space velocities and decelerations.
- Robust to singularities via Jacobian damping.
- Support for user-defined nullspace tasks to be executed in the nullspace of the primary task.
- MISRA C++ 23 compliant.
Safety behavior
The controller runs the following checks every real-time cycle:
- Command timeout. If no new command arrives within command_timeout (default 0.2 s), the controller stops. For streamed control this means the robot stops on its own when commands stop arriving.
- Joint position-limit prediction. Each cycle the controller predicts whether a maximum-deceleration stop, started now, would carry a joint past its soft position limit (with a joint_limit_position_tolerance margin, default 0.02 rad), and stops before the limit is reached. The prediction uses the last commanded state, not the measured state.
- Velocity and acceleration clamping. The commanded Cartesian velocity (including the force-driven term) is scaled to max_cartesian_velocity / max_cartesian_acceleration, and the resulting joint velocities and accelerations are scaled to max_joint_velocity / max_joint_acceleration. All scaling is uniform, so the direction of motion is preserved.
- Singularity robustness. Differential inverse kinematics uses a damped least-squares inverse (jacobian_damping, default 0.001) to bound joint velocities near kinematic singularities.
- Non-finite value rejection. The controller rejects non-finite (NaN/Inf) values at every boundary: the commanded Cartesian velocity and wrench, the force/torque reading, the joint state from hardware, and the final hardware command. On detection it engages the stop trajectory, or refuses to start if idle, and logs the offending component, interface, and value. Available in MoveIt Pro 9.4 and later.
All stops brake along the configured joint acceleration limits; the controller never cuts the command to zero or releases the joints.
The commanded wrench is a control input, not a safety limit: unlike the Joint Trajectory Admittance Controller, VFC has no absolute force/torque abort threshold. The controller also has no measured-vs-commanded tracking guard; it enforces limits on the commands it generates, not on how well the hardware follows them. On deactivation it releases its hardware interfaces without commanding a hold or zero. Reaching a safe state is left to the robot driver and the physical safety chain.
ROS Interface
See the main documentation for information about the ROS2 interface.
Velocity and force references default to the configured ee_frame. To express them in a fixed frame instead (e.g. for world-relative motion), set the control_frame_id field of the command message to the name of a link in the robot model; an empty value keeps the end-effector-relative behavior.
Parameter reference
Here's the list of all the parameters that can be configured, with their descriptions and default values:
Relevant headers
- velocity_force_setpoint_generator.hpp: This header contains a ROS-agnostic velocity/force setpoint generator, used to generate velocity and force setpoints for the controller.
- cartesian_stop_trajectory.hpp: This header contains a Cartesian stop trajectory generator, used to generate a stop trajectory for the controller.
- velocity_force_controller.hpp: This header contains the main controller class, within the ros2_control framework.
Generated via doxygen2docusaurus 2.2.2 by Doxygen 1.9.8.