Skip to content

Sampling C3 Double-Compensating End Effector Gravity #413

Description

@cuie23

Right now sampling c3 double compensates end effector gravity as follows. This would also apply to plate balancing if that ever gets moved into main

  1. The lcs urdf file does not have built-in gravity compensation. Thus when C3 solves, it must apply an input to compensate gravity
  2. The C3 u solution (including gravity compensation) gets directly passed to the osc via UpdateC3ExecutionTrajectory -> OutputC3TrajExecuteActor
  3. However, with cancel_gravity_compensation: false as in sim and with_gravity_compensation_ = true, which is the osc default, the osc already compensates gravity for the franka plant, which notably includes the end-effector
  4. Thus when the C3 u solution gets passed to the osc as an external force, the part of C3's u that compensates the gravity of the end effector gets added on top of the existing gravity compensation in the osc. The manipulator equation becomes
$$M(q)\dot{v} + C(q, v)v = B u + J^T(q)\lambda_{\text{ee}} + \tau_g = B u + J^T(q) (\lambda_{\text{g},\text{ee}} + \lambda_{\text{ext},\text{ee}}) + \tau_{\text{g},\text{ee}} + \tau_{\text{g},\text{franka}}$$

where $J^T(q)\lambda_{\text{g},\text{ee}}$ and $\tau_{\text{g},\text{ee}}$ are both trying to compensate the end effector gravity

I believe the reason this wasn't a huge problem for this example is because the lcs model only contains the end effector ball, which has a mass of 0.057, whereas the osc uses the full end effector model with mass 0.269, so the double-compensation only results in an additional upwards force of 0.057g rather than 0.269g.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions