Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SRX Mag Encoder Absolute position under SIM #57

Open
Crossle86 opened this issue Apr 25, 2022 · 1 comment
Open

SRX Mag Encoder Absolute position under SIM #57

Crossle86 opened this issue Apr 25, 2022 · 1 comment

Comments

@Crossle86
Copy link

I am setting the value of the pwm measured absolute position during sim with:
simCollection.setPulseWidthPosition()
and then reading with:
talon.getSensorCollection().getPulseWidthPosition()
This seems to work fine accepting that the absolute position is a virtual concept without the hardware.
However, in the log I am seeing this during sim runs:
CTR: CAN frame not received/too-stale.
Talon SRX 2 GetPulseWidthPosition

Is this expected? Anything to worry about?

@JCaporuscio
Copy link
Member

JCaporuscio commented Apr 26, 2022

So the CAN data that has sensor collection's absolute position is sent slowly by default.
Simulation timings in Windows aren't absolute - they can fluctuate. So what's likely happening is the already slow frame is exceeding the timeout for the too-stale error code.

Use talon.setStatusFramePeriod to speed up the appropriate frame (in this case Status 8). I would choose something around 100ms or faster depending on how quickly you want the data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants