public <T extends Enum<T>> EnumGlobalParameter(String name, String description, Class<T> enumType, GlobalParameter[] parents, GlobalParameterChangedListener listener) { super(parents, listener); yoVariable = YoEnum.create(name, description, enumType, registry, false); if (changedListener != null) changedListener.globalParameterCreated(this); }
private void addGoalMarkerRobot() { goalMarkerRobot.setGravity(0.0); environmentRobots.add(goalMarkerRobot); YoVariableRegistry robotsYoVariableRegistry = goalMarkerRobot.getRobotsYoVariableRegistry(); YoEnum<GoalMarkerLocation> goalMarkerLocationYoEnum = YoEnum.create("DesiredGoalMarkerLocation", GoalMarkerLocation.class, robotsYoVariableRegistry); goalMarkerLocationYoEnum.addVariableChangedListener(new GoalMarkerLocationUpdater()); goalMarkerLocationYoEnum.set(GoalMarkerLocation.TOP_OF_STAIRS); }
public FilteredDiscreteVelocityYoVariable(String name, String description, double alpha, YoDouble time, YoVariableRegistry registry) { super(name, description, registry); this.alpha = alpha; this.alphaVariable = null; this.position = null; this.time = time; lastPosition = new YoDouble(name + "_lastPosition", registry); lastUpdateTime = new YoDouble(name + "_lastUpdateTime", registry); lastUpdateDirection = YoEnum.create(name + "_lastUpdateDirection", Direction.class, registry); unfilteredVelocity = new YoDouble(name + "_unfilteredVelocity", registry); reset(); }
public FilteredDiscreteVelocityYoVariable(String name, String description, double alpha, YoDouble positionVariable, YoDouble time, YoVariableRegistry registry) { super(name, description, registry); this.alpha = alpha; this.position = positionVariable; this.alphaVariable = null; this.time = time; lastPosition = new YoDouble(name + "_lastPosition", registry); lastUpdateTime = new YoDouble(name + "_lastUpdateTime", registry); lastUpdateDirection = YoEnum.create(name + "_lastUpdateDirection", Direction.class, registry); unfilteredVelocity = new YoDouble(name + "_unfilteredVelocity", registry); reset(); }
public FilteredDiscreteVelocityYoVariable(String name, String description, YoDouble alphaVariable, YoDouble positionVariable, YoDouble time, YoVariableRegistry registry) { super(name, description, registry); position = positionVariable; this.alphaVariable = alphaVariable; this.alpha = 0.0; this.time = time; lastPosition = new YoDouble(name + "_lastPosition", registry); lastUpdateTime = new YoDouble(name + "_lastUpdateTime", registry); lastUpdateDirection = YoEnum.create(name + "_lastUpdateDirection", Direction.class, registry); unfilteredVelocity = new YoDouble(name + "_unfilteredVelocity", registry); reset(); }
public YoFunctionGeneratorVisualizer(YoFunctionGenerator yoFunctionGenerator) { this.yoFunctionGenerator = yoFunctionGenerator; mode = YoEnum.create("Mode", YoFunctionGeneratorMode.class, registry); resetTime = new YoDouble("resetTime", registry); resetTime.set(20.0); maxSweepFreq = new YoDouble("maxSweepFreq", registry); maxSweepFreq.set(60.0); amplitude = new YoDouble("amplitude", registry); amplitude.set(1.0); valueCheck = new YoDouble("valueCheck", registry); hasBeenReset = new YoBoolean("hasBeenReset", registry); hasBeenReset.set(true); }
public FilteredDiscreteVelocityYoVariable2(String name, String description, double alpha, YoDouble time, YoVariableRegistry registry) { super(name, description, registry); this.alpha = alpha; this.alphaVariable = null; this.position = null; this.time = time; lastPosChangeTimeInterval = new YoDouble(name + "_lastUpdateTimeInterval", registry); lastPosChangeDirection = YoEnum.create(name + "_lastUpdateDirection", Direction.class, registry); finiteDifferenceVelocity = new TimestampedVelocityYoVariable(name + "_finiteDiff", "", position, time, registry, 1e-20); unfilteredVelocity = new YoDouble(name + "_unfiltered", registry); finiteDifferenceAccel = new TimestampedVelocityYoVariable(name + "_finiteDiffAccel", "", finiteDifferenceVelocity, time, registry, 1e-20); timeSinceLastPosChange = new YoDouble(name + "_timeSinceLastTick", registry); lastPositionIncrement = new YoDouble(name + "_lastPositionIncrement", registry); positionPredicted = new YoDouble(name + "_positionPredicted", registry); velocityIfEncoderTicksNow = new YoDouble(name + "_velocityIfEncoderTicksNow", registry); velocityIfEncoderTicksNowConstantAccel = new YoDouble(name + "_velocityIfEncoderTicksNowConstantAccel", registry); useDecay = new YoBoolean(name + "_useDecay", registry); reset(); }
public FilteredDiscreteVelocityYoVariable2(String name, String description, double alpha, YoDouble positionVariable, YoDouble time, YoVariableRegistry registry) { super(name, description, registry); this.alpha = alpha; this.position = positionVariable; this.alphaVariable = null; this.time = time; lastPosChangeTimeInterval = new YoDouble(name + "_lastUpdateTimeInterval", registry); lastPosChangeDirection = YoEnum.create(name + "_lastUpdateDirection", Direction.class, registry); finiteDifferenceVelocity = new TimestampedVelocityYoVariable(name + "_finiteDiff", "", position, time, registry, 1e-20); unfilteredVelocity = new YoDouble(name + "_unfiltered", registry); finiteDifferenceAccel = new TimestampedVelocityYoVariable(name + "_finiteDiffAccel", "", finiteDifferenceVelocity, time, registry, 1e-20); timeSinceLastPosChange = new YoDouble(name + "_timeSinceLastTick", registry); lastPositionIncrement = new YoDouble(name + "_lastPositionIncrement", registry); positionPredicted = new YoDouble(name + "_positionPredicted", registry); velocityIfEncoderTicksNow = new YoDouble(name + "_velocityIfEncoderTicksNow", registry); velocityIfEncoderTicksNowConstantAccel = new YoDouble(name + "_velocityIfEncoderTicksNowConstantAccel", registry); useDecay = new YoBoolean(name + "_useDecay", registry); reset(); }
public FilteredDiscreteVelocityYoVariable2(String name, String description, YoDouble alphaVariable, YoDouble positionVariable, YoDouble time, YoVariableRegistry registry) { super(name, description, registry); position = positionVariable; this.alphaVariable = alphaVariable; this.alpha = 0.0; this.time = time; lastPosChangeTimeInterval = new YoDouble(name + "_lastUpdateTimeInterval", registry); lastPosChangeDirection = YoEnum.create(name + "_lastUpdateDirection", Direction.class, registry); finiteDifferenceVelocity = new TimestampedVelocityYoVariable(name + "_finiteDiff", "", position, time, registry, 1e-20); unfilteredVelocity = new YoDouble(name + "_unfiltered", registry); finiteDifferenceAccel = new TimestampedVelocityYoVariable(name + "_finiteDiffAccel", "", unfilteredVelocity, time, registry, 1e-20); timeSinceLastPosChange = new YoDouble(name + "_timeSinceLastTick", registry); lastPositionIncrement = new YoDouble(name + "_lastPositionIncrement", registry); positionPredicted = new YoDouble(name + "_positionPredicted", registry); velocityIfEncoderTicksNow = new YoDouble(name + "_velocityIfEncoderTicksNow", registry); velocityIfEncoderTicksNowConstantAccel = new YoDouble(name + "_velocityIfEncoderTicksNowConstantAccel", registry); useDecay = new YoBoolean(name + "_useDecay", registry); reset(); }