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

PwmControl.isPwmEnabled crashes #233

Closed
shelbyRobots opened this issue Nov 12, 2021 · 3 comments
Closed

PwmControl.isPwmEnabled crashes #233

shelbyRobots opened this issue Nov 12, 2021 · 3 comments

Comments

@shelbyRobots
Copy link

I am able to use a CRServoImplEx instance to use setPwmEnable/Disable.
However, isPwmEnabled crashes the app with the following:
E EventLoopManager: com.qualcomm.robotcore.exception.RobotCoreException: EventLoop Exception in loop(): IllegalArgumentException - invalid pwm channel: 4

Steps:
crsix.setPwmDisable();
...do other stuff...
if(crsix.setPwmDisable) crsix.setPwmDisable();

I was able to do a work around by keeping a local variable of pwm energize state when I call disable - to avoid calling enable on an already pwm energized port.

ServoControllerEx with port number parameter seemed to give same results.

@Windwoes
Copy link
Member

Looks to be a bug in the LynxGetServoEnableCommand constructor...

It reads

    public LynxGetServoEnableCommand(LynxModuleIntf module, int channelZ)
        {
        this(module);
        LynxConstants.validatePwmChannelZ(channelZ);
        this.channel = (byte)channelZ;
        }

But it should be

    public LynxGetServoEnableCommand(LynxModuleIntf module, int channelZ)
        {
        this(module);
        LynxConstants.validateServoChannelZ(channelZ);
        this.channel = (byte)channelZ;
        }

@Windwoes
Copy link
Member

This will be fixed in the next release of the SDK.

@Windwoes
Copy link
Member

Fixed in 7.1

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