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
steve532 commentedJan 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.
The text was updated successfully, but these errors were encountered: