Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions extensions/rcs_fr3/src/hw/Franka.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.;
Expand Down Expand Up @@ -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<double, 7> coriolis_array = model.coriolis(robot_state);
Eigen::Map<const Eigen::Matrix<double, 7, 1>> coriolis(
coriolis_array.data());
tau_d << tau_d + coriolis;

Eigen::Matrix<double, 7, 1> dist2joint_max;
Eigen::Matrix<double, 7, 1> dist2joint_min;

Expand Down
4 changes: 3 additions & 1 deletion extensions/rcs_fr3/src/hw/Franka.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion python/rcs/camera/hw.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions python/rcs/camera/sim.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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")
Expand Down
Loading