By default, the driver starts an fts sensor controller that publishes /wrench. You can subscribe to that and abort the running trajectory based on a custom condition for the measured wrench. However, be aware, that this will happen outside of the actual control loop, so expect a delay between the force actually happening at the tcp and the robot actually stopping. If you want to do it more closely to the control cycle, you could use GitHub - fzi-forschungszentrum-informatik/cartesian_controllers: A set of Cartesian controllers for the ROS1 and ROS2-control framework..