Our chain, which is after our encoder, sometimes slips which causes the encoder’s position to be misaligned with the arm’s actual position. I’m trying to write a command that will let the drivers tell the encoder where it should be (ie set its position, ie gaslight it into thinking it’s where it should be), but when I sim the code and use GaslightCrankEncoders, I see the simulated arm instantaneously snap to where I gaslighted it to be, then snap back after maybe 1/50 seconds(?) then motion profile to where I gaslighted it to be.
I suspect this probably related to the UseState method’s self.sim_encoder.setPosition(setpoint.position), but I’m not sure.
Honestly solving this in software isn’t a real solution. Fixing the slack in the mechanism to prevent chain slip is. There are many approaches to doing this that are viable.
A human can’t effectively predict how far off the encoder has slipped for the driver to input that.