From ef536379007647a03826b2e26d55b1ce03bb2e11 Mon Sep 17 00:00:00 2001 From: Tobias Juelg Date: Fri, 20 Nov 2026 11:00:21 -0800 Subject: [PATCH 1/4] fix(fr3): add Coriolis feed-forward to the joint and OSC torque controllers libfranka compensates gravity in torque control but not Coriolis / centrifugal torques; its impedance examples add model.coriolis() to the commanded torque. Neither RCS controller did: joint_controller() sent only Kp*e - Kd*dq, and osc() computed the Coriolis vector but never used it. Without it, fast motions are tracked worse (the error is proportional to dq^2) and part of the PD effort is spent fighting velocity-dependent torques. Both controllers now add the Coriolis vector before the joint-limit guard (so that guard still blocks torque towards a limit) and before rate limiting and the torque limit clamp. --- extensions/rcs_fr3/src/hw/Franka.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/extensions/rcs_fr3/src/hw/Franka.cpp b/extensions/rcs_fr3/src/hw/Franka.cpp index ca34468d..d9425371 100644 --- a/extensions/rcs_fr3/src/hw/Franka.cpp +++ b/extensions/rcs_fr3/src/hw/Franka.cpp @@ -596,6 +596,11 @@ void Franka::osc() { avoidance_force[i] += avoidance_weights_[i] * dist2joint_min[i]; } tau_d << tau_d + Nullspace * avoidance_force; + + // Coriolis feed-forward: libfranka compensates gravity, not Coriolis / + // centrifugal torques (see the impedance examples of libfranka) + tau_d << tau_d + coriolis; + for (int i = 0; i < 7; i++) { if (dist2joint_max[i] < 0.1 && tau_d[i] > 0.) tau_d[i] = 0.; if (dist2joint_min[i] < 0.1 && tau_d[i] < 0.) tau_d[i] = 0.; @@ -686,6 +691,13 @@ void Franka::joint_controller() { tau_d << Kp.cwiseProduct(joint_pos_error) - Kd.cwiseProduct(dq); + // Coriolis feed-forward: libfranka compensates gravity, not Coriolis / + // centrifugal torques (see the impedance examples of libfranka) + std::array coriolis_array = model.coriolis(robot_state); + Eigen::Map> coriolis( + coriolis_array.data()); + tau_d << tau_d + coriolis; + Eigen::Matrix dist2joint_max; Eigen::Matrix dist2joint_min; From bc18215bd7596c63788a888d02f236e362f6aa9c Mon Sep 17 00:00:00 2001 From: Tobias Juelg Date: Fri, 20 Nov 2026 11:01:24 -0800 Subject: [PATCH 2/4] fix(fr3): default torque limits to the franka joint torque limits The torque limit clamp of the joint and OSC controllers defaulted to 5 Nm for every joint, which is far below what the controllers need for stiff tracking and saturates the PD terms. Use the joint torque limits of the Franka specification instead: 87 Nm for joints 1-4 and 12 Nm for joints 5-7. --- extensions/rcs_fr3/src/hw/Franka.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/extensions/rcs_fr3/src/hw/Franka.h b/extensions/rcs_fr3/src/hw/Franka.h index 7d875f9a..5834ae95 100644 --- a/extensions/rcs_fr3/src/hw/Franka.h +++ b/extensions/rcs_fr3/src/hw/Franka.h @@ -46,7 +46,9 @@ struct FrankaConfig : common::RobotConfig { (common::Vector7d() << 100., 100., 100., 100., 75., 150., 50.).finished(); common::Vector7d kd = (common::Vector7d() << 20., 20., 20., 20., 7.5, 15.0, 5.0).finished(); - common::Vector7d torque_limit = common::Vector7d::Constant(5.0); + // FR3/Panda joint torque limits (Nm) from the Franka robot specification + common::Vector7d torque_limit = + (common::Vector7d() << 87., 87., 87., 87., 12., 12., 12.).finished(); bool allow_high_collision = false; // values from deoxys/config/osc-position-controller.yml Eigen::Vector3d kp_p = (Eigen::Vector3d() << 150., 150., 150.).finished(); From c16e2f6697e7812e609838784e890cc9aa1644bc Mon Sep 17 00:00:00 2001 From: Tobias Juelg Date: Fri, 20 Nov 2026 13:49:57 -0800 Subject: [PATCH 3/4] perf(camera): keep 30 instead of 1000 framesets of hardware cameras The ring buffer of HardwareCameraSet kept 1000 framesets by default, about 1.5 GB per RGB-D camera at 640x480, although only the latest frameset is read. 30 framesets are about one second at 30 fps. --- python/rcs/camera/hw.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/rcs/camera/hw.py b/python/rcs/camera/hw.py index 799e5dac..390e3e49 100644 --- a/python/rcs/camera/hw.py +++ b/python/rcs/camera/hw.py @@ -93,7 +93,7 @@ class HardwareCameraSet(BaseCameraSet): """ def __init__( - self, cameras: Sequence[HardwareCamera], warm_up_disposal_frames: int = 30, max_buffer_frames: int = 1000 + self, cameras: Sequence[HardwareCamera], warm_up_disposal_frames: int = 30, max_buffer_frames: int = 30 ): self.cameras = cameras self.camera_dict, self._camera_names = self._cameras_util() From 359894f75ad6e8bc6ff85226ec61af6f06be3083 Mon Sep 17 00:00:00 2001 From: Tobias Juelg Date: Fri, 20 Nov 2026 13:50:41 -0800 Subject: [PATCH 4/4] perf(camera): keep 30 instead of 100 framesets of simulated cameras Matches the default ring buffer length of the hardware cameras, about one second at 30 fps. --- python/rcs/camera/sim.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/rcs/camera/sim.py b/python/rcs/camera/sim.py index 39a2e206..47ed7929 100644 --- a/python/rcs/camera/sim.py +++ b/python/rcs/camera/sim.py @@ -198,7 +198,7 @@ def __init__( cameras: dict[str, SimCameraConfig], physical_units: bool = False, render_on_demand: bool = True, - max_buffer_frames: int = 100, + max_buffer_frames: int = 30, render_depth: bool = True, ): if max_buffer_frames <= 0: @@ -369,7 +369,7 @@ def __init__( cameras: dict[str, SimCameraConfig], physical_units: bool = True, render_on_demand: bool = True, - max_buffer_frames: int = 100, + max_buffer_frames: int = 30, render_depth: bool = True, ): filament.require("FilamentSimCameraSet")