BB.Igniter.Transmission (bb v0.19.0)

Copy Markdown View Source

Shared Igniter upgrade logic for lifting actuator-driver reverse? options into per-attachment transmission blocks.

Used by the upgrade tasks in each driver package (Feetech, Robotis, PCA9685, Pigpio). The transformation is:

Before:

joint :shoulder do
  type :revolute
  limit do
    lower(~u(-10 degree))
    upper(~u(190 degree))
    effort(~u(10 newton_meter))
    velocity(~u(180 degree_per_second))
  end
  actuator :motor, {BB.Servo.Feetech.Actuator,
    servo_id: 1, controller: :feetech, reverse?: true
  }
  link :arm
end

After (with lift_offset?: true):

joint :shoulder do
  type :revolute
  limit do
    lower(~u(-10 degree))
    upper(~u(190 degree))
    effort(~u(10 newton_meter))
    velocity(~u(180 degree_per_second))
  end
  actuator :motor, {BB.Servo.Feetech.Actuator,
    servo_id: 1, controller: :feetech
  } do
    transmission do
      offset(~u(90.0 degree))
      reversed? true
    end
  end
  link :arm
end

The offset is computed as (lower + upper) / 2, preserving the auto-centering behaviour the Feetech/Robotis drivers used to derive internally. lift_offset?: false skips the offset computation — used by the PCA9685 and Pigpio upgraders, which never auto-centered.

Also handles re-running on code that was previously upgraded to put the transmission block at the joint level: such blocks are removed and merged into the actuator's own block.

Summary

Functions

Lift reverse? opts on the given driver's actuator child-specs into per-attachment transmission blocks across the project.

Functions

lift_reverse_question(igniter, driver_module, opts \\ [])

@spec lift_reverse_question(Igniter.t(), module(), keyword()) :: Igniter.t()

Lift reverse? opts on the given driver's actuator child-specs into per-attachment transmission blocks across the project.

Options:

  • :lift_offset? (default false) — when true, also compute and emit an offset(...) value derived from the enclosing joint's lower and upper limits, preserving the implicit centering that Feetech and Robotis drivers used to do internally.