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; 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(); 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() 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")