Use Velocity / Force Control
Many applications require applying a controlled force on the environment along some axes, while moving at a velocity along other axes. For instance, a cutting task may require application of a constant force on the material being cut while moving at a constant velocity along a cutting direction. Similarly, inserting an object into a container may require moving along an insertion direction while simultaneously complying with sensed forces and torques to align the object and the container.
These applications are naturally described as the combination of force-controlled motions and velocity-controlled motions where force control is applied in some directions and velocity control is applied along other tangential directions in the 3D space. This is in contrast to the more classical “trajectory tracking” approach (covered here) where a controller just tracks a given trajectory, with very limited sensor feedback.
We have developed a Hybrid Cartesian Velocity / Force Controller (VFC) that is capable of executing such motions. The controller generates joint-space setpoints based on Cartesian velocity and force references provided by the user. The velocity and force control components are applied along orthogonal axes so that they don’t interfere with each other:
- The Cartesian velocity component regulates motion to track the desired Cartesian velocity. The 'commanded' Cartesian velocity along the velocity-controlled axes is generated by applying Cartesian acceleration and Cartesian velocity limits to the desired Cartesian velocity.
- The force control component implements a simple proportional control law to produce a second subset of commanded Cartesian velocities along force-controlled axes.
- The two disjoint subsets of Cartesian velocities are then combined into a unique commanded Cartesian velocity vector, which is then mapped into joint-space via the robot inverse differential kinematics.
In contrast to joint-space trajectory tracking controllers, the VFC doesn’t require pre-planning and timing a trajectory, which makes it lower latency and therefore more suitable for tasks that require regulating forces. In addition, it can explicitly regulate forces/torques to a desired reference.
The controller has been developed as a ros2_control
plugin, with special emphasis on real-time safety and MISRA compliance.
Adding a Velocity / Force Controller to your site config
To use the VFC, your robot needs a force/torque sensor installed at the wrist. As with any other ros2_control
controller, it can be configured in your MoveIt Pro configuration package, as described here.
An example ros2_control.yaml
that configures the required force_torque_sensor_broadcaster
and velocity_force_controller
can be found in the moveit_pro_example_ws
repo here.
Using the Velocity / Force Controller
The controller exposes three ROS 2 interfaces:
~/zero_fts
: A service to set (tare) the force/torque zero value. Often done before sending commands, to 'reset' the sensor zero reference value. This service can be called with theCallTriggerService
Behavior.~/configure
: A service to configure runtime parameters of the VFC, e.g. Cartesian-space velocities, accelerations. etc. These override the values set in the config file.~/command
: A topic command interface where Behaviors can stream commands.
This controller expects a stream of commands as input.
Once the first command is received, the controller expects the next command within command_timeout
seconds.
If no new command is received within the timeout, the controller executes an emergency stop in joint-space (using maximum joint velocities and accelerations).
Otherwise, the controller just updates motion towards the new commanded values while obeying motion limits.
To send commands to the VFC, use the CreateStampedWrench
, CreateStampedTwist
and PublishVelocityForceCommand
Behaviors.
CreateStampedWrench
and CreateStampedTwist
let you define the force/torque and velocity references and put them into blackboard variables.
PublishVelocityForceCommand
takes those references and sends them to the Velocity / Force Controller.
Please refer to the Behavior documentation in MoveIt Pro for details.
For a practical example, please refer to the Push Button
Objective in moveit_pro_example_ws
.