# Impedance control algorithm in The Modern Robotics: Mechanisms, Planning, and Control

I am studying The Modern Robotics: Mechanisms, Planning, and Control (by Kevin Lynch, Frank Park and Evan Suma). I am trying to implement Chapter 11.7.1 Impedance-Control Algorithm of the book with ROS simulation, but I am confused and I am asking for help.

he impedance control algorithm in the book has a dynamics formula for task space, but I am confused as to whether the theta used here is the desired theta or the current theta. In addition, jacobian and twist are also used to create Lambda and Eta, and I am not sure whether they are also desired jacobian, desired twist, current jacobian, or desired twist. Could you please help? All of the $$\theta$$'s listed represent current joint angles, because we are considering what the robot's dynamics look like at this moment in time - i.e. at the given configuration. Since this is an end-effector force control law, I would imagine the only "desired" values could be those of $$x$$, $$\dot{x}$$, and $$\ddot{x}$$ in the $$f_{\text{ext}}$$ term.
As for $$\tilde{\Lambda}$$ and $$\tilde{\eta}$$ - because these are the approximated equations of motion for your robot arm in the task space, they use the actual twist $$\mathcal{V}$$ and actual Jacobian $$\mathbf{J}$$. As a general rule of thumb, if you are using a model to "compensate" for your system dynamics, you will be using the true system state. Otherwise, you would be tracking, minimizing, etc. some sort of error associated with a desired value.