List<Class<? extends Command<?, ?>>> controllerSupportedCommands = ControllerAPIDefinition.getControllerSupportedCommands(); for(int i = 0; i < controllerSupportedCommands.size(); i++)
public DRCSimulationTestHelper(SimulationTestingParameters simulationTestParameters, DRCRobotModel robotModel, CommonAvatarEnvironmentInterface testEnvironment) { this.robotModel = robotModel; this.walkingControlParameters = robotModel.getWalkingControllerParameters(); this.simulationTestingParameters = simulationTestParameters; robotName = robotModel.getSimpleRobotName(); if (testEnvironment != null) this.testEnvironment = testEnvironment; simulationStarter = new DRCSimulationStarter(robotModel, this.testEnvironment); fullRobotModel = robotModel.createFullRobotModel(); HumanoidReferenceFrames referenceFrames = new HumanoidReferenceFrames(fullRobotModel); scriptedFootstepGenerator = new ScriptedFootstepGenerator(referenceFrames, fullRobotModel, walkingControlParameters); guiInitialSetup = new DRCGuiInitialSetup(false, false, simulationTestingParameters); networkProcessorParameters.enableNetworkProcessor(false); networkProcessorParameters.enableLocalControllerCommunicator(true); List<Class<? extends Command<?, ?>>> controllerSupportedCommands = ControllerAPIDefinition.getControllerSupportedCommands(); for (Class<? extends Command<?, ?>> command : controllerSupportedCommands) { Class<?> messageClass = ROS2Tools.newMessageInstance(command).getMessageClass(); IHMCROS2Publisher<?> defaultPublisher = createPublisherForController(messageClass); defaultControllerPublishers.put(messageClass, defaultPublisher); } defaultControllerPublishers.put(WholeBodyTrajectoryMessage.class, createPublisherForController(WholeBodyTrajectoryMessage.class)); defaultControllerPublishers.put(MessageCollection.class, createPublisherForController(MessageCollection.class)); defaultControllerPublishers.put(ValkyrieHandFingerTrajectoryMessage.class, createPublisherForController(ValkyrieHandFingerTrajectoryMessage.class)); }
public MomentumBasedControllerFactory(ContactableBodiesFactory contactableBodiesFactory, SideDependentList<String> footForceSensorNames, SideDependentList<String> footContactSensorNames, SideDependentList<String> wristSensorNames, WalkingControllerParameters walkingControllerParameters, ArmControllerParameters armControllerParameters, CapturePointPlannerParameters capturePointPlannerParameters, HighLevelState initialBehavior) { this.footSensorNames = footForceSensorNames; this.footContactSensorNames = footContactSensorNames; this.wristSensorNames = wristSensorNames; this.contactableBodiesFactory = contactableBodiesFactory; this.initialBehavior = initialBehavior; this.walkingControllerParameters = walkingControllerParameters; this.capturePointPlannerParameters = capturePointPlannerParameters; commandInputManager = new CommandInputManager(ControllerAPIDefinition.getControllerSupportedCommands()); statusOutputManager = new StatusMessageOutputManager(ControllerAPIDefinition.getControllerSupportedStatusMessages()); managerFactory = new HighLevelControlManagerFactory(statusOutputManager, registry); managerFactory.setArmControlParameters(armControllerParameters); managerFactory.setCapturePointPlannerParameters(capturePointPlannerParameters); managerFactory.setWalkingControllerParameters(walkingControllerParameters); }
@ContinuousIntegrationTest(estimatedDuration = 0.0) @Test(timeout = 30000) public void testConstructor() { List<Class<? extends Command<?, ?>>> controllerSupportedCommands = ControllerAPIDefinition.getControllerSupportedCommands(); CommandInputManager commandInputManager = new CommandInputManager(controllerSupportedCommands); YoDouble yoTime = new YoDouble("yoTime", null); CommandConsumerWithDelayBuffers commandConsumer = new CommandConsumerWithDelayBuffers(commandInputManager, yoTime); assertNotNull(commandConsumer); for(Class clazz: controllerSupportedCommands) { assertFalse(commandConsumer.isNewCommandAvailable(clazz)); assertNull(commandConsumer.pollNewestCommand(clazz)); assertEquals(0, commandConsumer.pollNewCommands(clazz).size()); } }
List<Class<? extends Command<?, ?>>> controllerSupportedCommands = ControllerAPIDefinition.getControllerSupportedCommands(); CommandInputManager commandInputManager = new CommandInputManager(controllerSupportedCommands); YoDouble yoTime = new YoDouble("yoTime", null);
List<Class<? extends Command<?, ?>>> controllerSupportedCommands = ControllerAPIDefinition.getControllerSupportedCommands(); CommandInputManager commandInputManager = new CommandInputManager(controllerSupportedCommands); YoDouble yoTime = new YoDouble("yoTime", null);
List<Class<? extends Command<?, ?>>> controllerSupportedCommands = ControllerAPIDefinition.getControllerSupportedCommands(); CommandInputManager commandInputManager = new CommandInputManager(controllerSupportedCommands); YoDouble yoTime = new YoDouble("yoTime", null);