franky.JointImpedanceMotion

class franky.JointImpedanceMotion

Bases: JointImpedanceBase

Client-side joint impedance controller.

This motion uses Franka’s torque interface and regulates toward a constant joint target (and optional target velocity). It does not terminate on its own; it runs until it is preempted or stopped.

__init__(self: franky._franky.JointImpedanceMotion, target: Annotated[numpy.typing.ArrayLike, numpy.float64, '[7, 1]'], target_velocity: Annotated[numpy.typing.ArrayLike, numpy.float64, '[7, 1]'] | None = None, stiffness: Annotated[numpy.typing.ArrayLike, numpy.float64, '[7, 1]'] | None = None, damping: Annotated[numpy.typing.ArrayLike, numpy.float64, '[7, 1]'] | None = None, cartesian_stiffness: Annotated[numpy.typing.ArrayLike, numpy.float64, '[6, 1]'] | None = None, cartesian_damping: Annotated[numpy.typing.ArrayLike, numpy.float64, '[6, 1]'] | None = None, constant_torque_offset: Annotated[numpy.typing.ArrayLike, numpy.float64, '[7, 1]'] | None = None, lower_joint_limits: Annotated[numpy.typing.ArrayLike, numpy.float64, '[7, 1]'] | None = None, upper_joint_limits: Annotated[numpy.typing.ArrayLike, numpy.float64, '[7, 1]'] | None = None, compensate_coriolis: bool = True, max_delta_tau: SupportsFloat | SupportsIndex = 1.0, joint_limit_activation_distance: SupportsFloat | SupportsIndex = 0.1, joint_limit_stiffness: SupportsFloat | SupportsIndex = 4.0, joint_limit_damping: SupportsFloat | SupportsIndex = 1.0, joint_limit_max_torque: SupportsFloat | SupportsIndex = 5.0, friction: franky._franky.FrictionCompensationParams | None = None) None

Construct a joint impedance controller regulating toward a fixed joint target.

This motion does not finish on its own; it keeps regulating toward the target until it is preempted or stopped.

If damping is not set, critical damping is chosen with respect to the given stiffness. The optional cartesian_stiffness/cartesian_damping parameters add a Cartesian-space spring-damper term that is projected through the current Jacobian. The joint-limit parameters configure a soft repulsion torque that activates near the joint limits (only if both lower_joint_limits and upper_joint_limits are set).

add_reaction(self: franky._franky.BaseTorqueMotion, reaction: franky._franky.TorqueReaction) None

Add a reaction to the motion.

Reactions are evaluated in every step of the motion and can replace the current motion with a new motion.

Parameters:

reaction – The reaction to add.

Warning

Do not call this function synchronously from a condition, motion function, or reaction callback while this motion’s reactions are being evaluated. Reaction evaluation holds the reaction-list mutex, so doing so would deadlock.

get_cartesian_gains(self: franky._franky.JointImpedanceBase) franky._franky.CartesianImpedanceGains

Get a copy of the current target Cartesian shaping gains.

Mutating the returned object has no effect on the motion; pass it to setCartesianGains to apply changes.

get_gains(self: franky._franky.JointImpedanceBase) franky._franky.JointImpedanceGains

Get a copy of the current target impedance gains.

Mutating the returned object has no effect on the motion; pass it to setGains to apply changes.

register_callback(self: franky._franky.BaseTorqueMotion, callback: collections.abc.Callable[[franky._franky.RobotState, franky._franky.Duration, franky._franky.Duration, franky._franky.Duration, franky._franky.Torques], None]) None

Register a callback that is called in every step of the motion.

Parameters:

callback – The callback to register. Callbacks are called with the robot state, the time step [s], the relative time [s], the absolute time [s] and the control signal computed in this step.

set_cartesian_gains(self: franky._franky.JointImpedanceBase, gains: franky._franky.CartesianImpedanceGains) None

Set the target Cartesian shaping gains.

The gains are validated and then smoothed in the control loop via exponential interpolation.

Parameters:

gains – The new target Cartesian gains.

set_gains(self: franky._franky.JointImpedanceBase, gains: franky._franky.JointImpedanceGains) None

Set the target impedance gains.

The gains are validated and then smoothed in the control loop via exponential interpolation.

Parameters:

gains – The new target gains.

property params

The parameters of the motion.

property reactions

Currently registered reactions of the motion.

property target

The target joint positions of the motion [rad].

property target_velocity

The target joint velocities of the motion [rad/s].