public AbstractWaypointsForFootstepsPlanner(String prefix, FootstepPlannerParameters parameters, YoVariableRegistry registry) { this.parameters = parameters; yoResult = new YoEnum<>(prefix + "PathPlanningResult", registry, FootstepPlanningResult.class); }
/** * Create a new YoEnum. This will call {@link YoEnum(String, YoVariableRegistry, Class)} with the given values. * * @param name String uniquely identifying this YoEnum * @param registry YoVariableRegistry for this YoEnum to register itself to after initialization * @param enumType the class representing the type of the enum */ public static <T extends Enum<T>> YoEnum<T> create(String name, Class<T> enumType, YoVariableRegistry registry) { return new YoEnum<>(name, registry, enumType); }
/** * Create a new YoEnum. This will call {@link YoEnum(String, String, YoVariableRegistry, Class, Boolean)} with the given values. * * @param name String uniquely identifying this YoEnum * @param description String describing this YoEnum's purpose * @param registry YoVariableRegistry for this YoEnum to register itself to after initialization * @param enumType the class representing the type of the enum * @param allowNullValue boolean determining if null enum values are permitted */ public static <T extends Enum<T>> YoEnum<T> create(String name, String description, Class<T> enumType, YoVariableRegistry registry, boolean allowNullValue) { return new YoEnum<>(name, description, registry, enumType, allowNullValue); }
public YoVariableComparer(YoDouble variableA, YoDouble variableB, String name, ThresholdType thresholdType, double threshold, YoVariableRegistry registry) { this.yoVariableA = variableA; this.yoVariableB = variableB; this.compareType = thresholdType; this.threshold = null; this.nonChangingThreshold = threshold; this.difference = new YoDouble(name, registry); this.status = new YoEnum<CompareStatus>(name + "_status", registry, CompareStatus.class); }
public YoVariableTogglerOutlet(String name, YoVariableRegistry parent) { toggleMode = new YoEnum<ToggleMode>(name, parent, ToggleMode.class); toggleMode.set(ToggleMode.NO_CHANGE); }
public ControlMode(String name, YoVariableRegistry registry) { controlMode = new YoEnum<>(name + "ControlMode", registry, ControlModeEnum.class, true); thermalShutdown = new YoBoolean(name + "ThermalShutdown", registry); }
public YoVariableComparer(YoDouble variableA, YoDouble variableB, String name, ThresholdType thresholdType, YoDouble threshold, YoVariableRegistry registry) { this.yoVariableA = variableA; this.yoVariableB = variableB; this.compareType = thresholdType; this.threshold = threshold; this.nonChangingThreshold = Double.NaN; this.status = new YoEnum<CompareStatus>(name + "_status", registry, CompareStatus.class); this.difference = new YoDouble(name, registry); }
public <T extends Enum<T>> EnumGlobalParameter(String name, String description, T value, GlobalParameterChangedListener listener) { super(null, listener); YoEnum<T> yoEnum = new YoEnum<T>(name, description, registry, value.getDeclaringClass(), false); yoEnum.set(value); this.yoVariable = yoEnum; if (changedListener != null) changedListener.globalParameterCreated(this); }
public YoVariableLimitChecker(YoDouble variableToCheck, String prefix, double lowerLimit, double upperLimit, YoVariableRegistry registry) { status = new YoEnum<Status>(prefix + variableToCheck.getName() + "_Status", registry, Status.class); if (upperLimit < lowerLimit) { System.out.println("YoVariableLimitChecker: Disabling limits. Upper limit needs to be greater than lower limit for variable: " + variableToCheck.getName()); this.lowerLimit = Double.NEGATIVE_INFINITY; this.upperLimit = Double.POSITIVE_INFINITY; } else { this.lowerLimit = lowerLimit; this.upperLimit = upperLimit; } this.variableToCheck = variableToCheck; }
public GenericStateMachine(String stateYoVariableName, String switchTimeName, Class<E> enumType, E initialState, DoubleProvider timeProvider, YoVariableRegistry registry) { stateYoVariable = new YoEnum<E>(stateYoVariableName, "State machine variable to keep track of the state.", registry, enumType, false); previousStateYoVariable = new YoEnum<E>(stateYoVariableName + "PreviousState", "State machine variable to keep track of the previous state.", registry, enumType, true); enumsToStates = new EnumMap<>(enumType); if (initialState != null) { stateYoVariable.set(initialState); } previousStateYoVariable.set(null); switchTimeYoVariable = new YoDouble(switchTimeName, registry); this.time = timeProvider; switchTimeYoVariable.set(time.getValue()); }
private void createVariables() { for (int i = 0; i < variablesPerType; i++) { new YoBoolean("Boolean" + i, registry); new YoDouble("Double" + i, registry); new YoInteger("Integer" + i, registry); new YoLong("Long" + i, registry); new YoEnum<>("Enum" + i, registry, SomeEnum.class, random.nextBoolean()); } }
private YoMicroStrainIMUHandleHolder(MicroStrainIMUHandle handle, IMUDefinition imuDefinition, YoVariableRegistry parentRegistry) { super(handle, imuDefinition, parentRegistry); this.microStrainIMUHandle = handle; filterTypeToUse = new YoEnum<>(handle.getName() + "_filterTypeToUse", parentRegistry, MicrostrainFilterType.class); filterTypeToUse.addVariableChangedListener(new VariableChangedListener() { @Override public void notifyOfVariableChange(YoVariable<?> v) { microStrainIMUHandle.setFilterTypeToReturn(filterTypeToUse.getEnumValue()); } }); filterTypeToUse.set(MicrostrainFilterType.COMPLIMENTARY_FILTER); }
public BacklashProcessingYoVariable(String name, String description, YoDouble velocityVariable, double dt, DoubleProvider slopTime, YoVariableRegistry registry) { super(name, description, registry); this.hasBeenCalled = new YoBoolean(name + "HasBeenCalled", registry); backlashState = new YoEnum<BacklashState>(name + "BacklashState", registry, BacklashState.class, true); backlashState.set(null); timeSinceSloppy = new YoDouble(name + "TimeSinceSloppy", registry); velocity = velocityVariable; this.slopTime = slopTime; this.dt = dt; reset(); }
public BacklashCompensatingVelocityYoVariable(String name, String description, YoDouble alphaVariable, double dt, YoDouble slopTime, YoVariableRegistry registry) { super(name, description, registry); this.hasBeenCalled = new YoBoolean(name + "HasBeenCalled", registry); backlashState = new YoEnum<BacklashState>(name + "BacklashState", registry, BacklashState.class, true); backlashState.set(null); timeInState = new YoDouble(name + "timeInState", registry); this.position = null; this.alphaVariable = alphaVariable; this.slopTime = slopTime; this.dt = dt; lastPosition = new YoDouble(name + "_lastPosition", registry); reset(); }
public BacklashCompensatingVelocityYoVariable(String name, String description, YoDouble alphaVariable, YoDouble positionVariable, double dt, YoDouble slopTime, YoVariableRegistry registry) { super(name, description, registry); this.hasBeenCalled = new YoBoolean(name + "HasBeenCalled", registry); backlashState = new YoEnum<BacklashState>(name + "BacklashState", registry, BacklashState.class, true); backlashState.set(null); timeInState = new YoDouble(name + "TimeInState", registry); position = positionVariable; this.alphaVariable = alphaVariable; this.slopTime = slopTime; this.dt = dt; lastPosition = new YoDouble(name + "_lastPosition", registry); reset(); }
/** * Creates a new YoEnum with the same parameters as this one, and registers it to the passed {@link YoVariableRegistry}. * * @param newRegistry YoVariableRegistry to duplicate this YoEnum to * @return the newly created and registered YoEnum */ @Override public YoEnum<T> duplicate(YoVariableRegistry newRegistry) { YoEnum<T> retVar = new YoEnum<>(getName(), getDescription(), newRegistry, getEnumType(), getAllowNullValue()); retVar.set(getEnumValue()); return retVar; }
public RevisedBacklashCompensatingVelocityYoVariable(String name, String description, DoubleProvider alphaVariable, YoDouble positionVariable, double dt, DoubleProvider slopTime, YoVariableRegistry registry) { super(name, description, registry); finiteDifferenceVelocity = new FilteredVelocityYoVariable(name + "finiteDifferenceVelocity", "", alphaVariable, dt, registry); this.hasBeenCalled = new YoBoolean(name + "HasBeenCalled", registry); backlashState = new YoEnum<BacklashState>(name + "BacklashState", registry, BacklashState.class, true); backlashState.set(null); timeSinceSloppy = new YoDouble(name + "TimeSinceSloppy", registry); position = positionVariable; this.alphaVariable = alphaVariable; this.slopTime = slopTime; this.dt = dt; lastPosition = new YoDouble(name + "_lastPosition", registry); reset(); }
public RevisedBacklashCompensatingVelocityYoVariable(String name, String description, YoDouble alphaVariable, double dt, YoDouble slopTime, YoVariableRegistry registry) { super(name, description, registry); finiteDifferenceVelocity = new FilteredVelocityYoVariable(name + "finiteDifferenceVelocity", "", alphaVariable, dt, registry); this.hasBeenCalled = new YoBoolean(name + "HasBeenCalled", registry); backlashState = new YoEnum<BacklashState>(name + "BacklashState", registry, BacklashState.class, true); backlashState.set(null); timeSinceSloppy = new YoDouble(name + "timeInState", registry); this.position = null; this.alphaVariable = alphaVariable; this.slopTime = slopTime; this.dt = dt; lastPosition = new YoDouble(name + "_lastPosition", registry); reset(); }
public YoSignalDerivative(String name, YoVariableRegistry registry) { this.name = name; differentiationMode = new YoEnum<DifferentiationMode>(name + "_differentiationMode", registry, DifferentiationMode.class); previousDerivative = new YoDouble(name + "_previousDerivative", registry); previousSignal = new YoDouble(name + "_previousSignal", registry); timeAtLastSignalChange = new YoDouble(name + "_timeAtLastSignalChange", registry); previousTime = new YoDouble(name + "_previousTime", registry); tolerance = new YoDouble(name + "_tolerance", registry); lastSignalChange = new YoDouble(name + "_lastSignalChange", registry); tolerance.set(DEFAULT_TOLERANCE); resetToZero(); }
@BeforeEach public void setUp() throws Exception { rootRegistry = new YoVariableRegistry("root"); registryOne = new YoVariableRegistry("registryOne"); registryTwo = new YoVariableRegistry("registryTwo"); rootRegistry.addChild(registryOne); registryOne.addChild(registryTwo); doubleVariable = new YoDouble("doubleVariable", rootRegistry); booleanVariable = new YoBoolean("booleanVariable", registryOne); integerVariable = new YoInteger("integerVariable", registryTwo); enumVariable = new YoEnum<TimeScriptTestEnums>("enumVariable", registryTwo, TimeScriptTestEnums.class); }