franky.JointImpedanceTrackingMotion

class franky.JointImpedanceTrackingMotion

Bases: JointImpedanceBase

Client-side joint impedance controller with a dynamic online reference.

This motion keeps the same controller alive while reading the latest valid joint reference from a handle or callback each control cycle.

__init__(self: franky._franky.JointImpedanceTrackingMotion, 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, gains_time_constant: SupportsFloat | SupportsIndex = 0.1) None

Construct a dynamic joint impedance controller.

Any constant_torque_offset configured here is added to the per-cycle torque_feedforward values.

The controller reads target gains each cycle and exponentially interpolates toward them with the given time constant, allowing smooth runtime stiffness/damping changes.

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.

get_reference(self: franky._franky.JointImpedanceTrackingMotion) franky._franky.JointReference | None

Get a copy of the last published joint reference, or None if no reference has been set yet. Mutating the returned object has no effect on the motion; pass it to set_reference 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.

set_reference(self: franky._franky.JointImpedanceTrackingMotion, reference: franky._franky.JointReference) None

Set the joint reference tracked by the controller. The reference is validated and picked up by the control loop in the next cycle.

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].