Only able to set a conversion factor for absolute encoder in YAGSL

My team is using NEOs, CTRE Mag SRXs for absolute encoders, CANSparkMax motor controllers and YAGSL. I’m only able to set a single conversion factor (which I’ve set to 360), and the code seems to only use the absolute encoder readings. While this is fine, will this pose any future problems, not using relative encoders due to the absolute encoders being slower or anything? And if so, is there a way to have YAGSL use the absolute encoder at startup and relative encoders while the robot is running?

here’s what our physicalproperties.json looks like:

{
    "conversionFactor": {
      "drive": 0.047286787200699704,
      "angle": 360
    },
    "currentLimit": {
      "drive": 40,
      "angle": 20
    },
    "rampRate": {
      "drive": 0.25,
      "angle": 0.25
    },
    "wheelGripCoefficientOfFriction": 1.19,
    "optimalVoltage": 12
  }

And here’s what one of our module configurations look like:

{
    "location": {
      "front": 11.75,
      "left": -11.75
    },
    "absoluteEncoderOffset": 3,
    "drive": {
      "type": "sparkmax",
      "id": 6,
      "canbus": null
    },
    "angle": {
      "type": "sparkmax",
      "id": 5,
      "canbus": null
    },
    "conversionFactor": {
      "angle": null,
      "drive": null
    },
    "encoder": {
      "type": "attached",
      "id": 0,
      "canbus": null
    },
    "inverted": {
      "drive": true,
      "angle": false
    },
    "absoluteEncoderInverted": false
  }

Thanks in advance :smile_cat:

1 Like

Not while it’s attached to the SparkMAX. While attached to the SparkMAX we live in a world where we hope everything is not going to break and enjoy the fastest results we have available to us :slight_smile:

Also the feedback device for the SparkMAX PID on the motor controller itself is set to the absolute encoder you plugged in, so the relative encoder is completely ignored.

Gotcha, thank you

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.