Skip to content
This repository has been archived by the owner before Nov 9, 2022. It is now read-only.

Visibility of ColorSensorv3 enums #3

Closed
steve532 opened this issue Jan 13, 2020 · 1 comment
Closed

Visibility of ColorSensorv3 enums #3

steve532 opened this issue Jan 13, 2020 · 1 comment

Comments

@steve532
Copy link

steve532 commented Jan 13, 2020

For the file ColorSensorV3.java there is an issue with the enum declarations.
The enums which are used by the public configure methods (e.g. configureColorSensor(ColorSensorResolution res, ColorSensorMeasurementRate rate, GainFactor gain) are declared with default visibility but should be public. Default visibility restricts them to use within the same package (com.revrobotics).

The following code fails to compile because the package is not part of com.revrobotics

package frc.robot;

import edu.wpi.first.wpilibj.TimedRobot;
import edu.wpi.first.wpilibj.I2C;
import com.revrobotics.ColorSensorV3;

public class Robot extends TimedRobot {
ColorSensorV3 m_sensor;

public Robot() {
m_sensor = new ColorSensorV3(I2C.Port.kOnboard);
m_sensor.configureColorSensor(ColorSensorV3.ColorSensorResolution.kColorSensorRes16bit,
ColorSensorV3.ColorSensorMeasurementRate.kColorRate50ms,
ColorSensorV3.GainFactor.kGain1x);
}
}

If the delcarations in ColorSensorV3.java are changed from

enum ColorSensorResolution { ...
to
public enum ColorSensorResolution { ...

the code will compile.

@DinoHunter696
Copy link

DinoHunter696 commented Feb 3, 2020

We ran into this issue as well, just wondering when an official release will be pushed.

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

No branches or pull requests

2 participants