@Override public PeriodicThreadScheduler createPeriodicThreadScheduler(String name) { return new PeriodicNonRealtimeThreadScheduler(name); }
private void initialize(String rosNameSpace) { rosMainNode.attachPublisher(rosNameSpace + "/output/high_level_state", statePublisher); scheduler.schedule(this, 1, TimeUnit.MILLISECONDS); }
@Override public void run() { if (Thread.interrupted()) { scheduler.shutdown(); } else if (rosMainNode.isStarted()) { statePublisher.publish(currentState); } } }
RobotMotionStatusHolder robotMotionStatusFromController = new RobotMotionStatusHolder(); DRCRobotSensorInformation sensorInformation = drcRobotModel.getSensorInformation(); PeriodicNonRealtimeThreadScheduler scheduler = new PeriodicNonRealtimeThreadScheduler(threadName); final DRCPoseCommunicator poseCommunicator = new DRCPoseCommunicator(humanoidFullRobotModel, jointConfigurationGatherer, auxiliaryRobotDataProvider, dataProducer, sensorOutputMapReadOnly, sensorRawOutputMapReadOnly, robotMotionStatusFromController, sensorInformation, scheduler, netClassList); scheduler.schedule(new Runnable()
public PeriodicNonRealtimeThreadScheduler(String name) { this.executorService = Executors.newSingleThreadScheduledExecutor(getNamedThreadFactory(name)); }
publisherTopicNameGenerator, realtimeRos2Node, sensorOutputMapReadOnly, sensorRawOutputMapReadOnly, robotMotionStatusFromController, sensorInformation); PeriodicNonRealtimeThreadScheduler scheduler2 = new PeriodicNonRealtimeThreadScheduler(threadName); scheduler2.schedule(new Runnable()
public PeriodicNonRealtimeThreadScheduler(String name) { this.executorService = Executors.newSingleThreadScheduledExecutor(getNamedThreadFactory(name)); }
@Override public PeriodicThreadScheduler createPeriodicThreadScheduler(String name) { return new PeriodicNonRealtimeThreadScheduler(name); }
private void initialize(String rosNameSpace) { rosMainNode.attachPublisher(rosNameSpace + "/output/high_level_state", statePublisher); scheduler.schedule(this, 1, TimeUnit.MILLISECONDS); }
@Override public void run() { if (Thread.interrupted()) { scheduler.shutdown(); } else if (rosMainNode.isStarted()) { statePublisher.publish(currentState); } } }
protected void startYoVariableServer() { if (!startYoVariableServer) return; PeriodicThreadScheduler scheduler = new PeriodicNonRealtimeThreadScheduler("WholeBodyIKScheduler"); yoVariableServer = new YoVariableServer(getClass(), scheduler, modelProvider, LogSettings.TOOLBOX, YO_VARIABLE_SERVER_DT); yoVariableServer.setMainRegistry(registry, fullRobotModel, yoGraphicsListRegistry); startYoVariableServerOnAThread(yoVariableServer); yoVariableServerScheduled = executorService.scheduleAtFixedRate(createYoVariableServerRunnable(yoVariableServer), 0, updatePeriodMilliseconds, TimeUnit.MILLISECONDS); }
private void initialize(String rosNameSpace) { rosMainNode.attachPublisher(rosNameSpace + "/output/high_level_state", statePublisher); scheduler.schedule(this, 1, TimeUnit.MILLISECONDS); }
@Override public void run() { if (Thread.interrupted()) { scheduler.shutdown(); } else if (rosMainNode.isStarted()) { statePublisher.publish(currentState); } } }
private void setupYoVariableServer() { if (robotModel.get().getLogSettings().isLog()) { yoVariableServer = new YoVariableServer(getClass(), new PeriodicNonRealtimeThreadScheduler("DRCSimulationYoVariableServer"), robotModel.get().getLogModelProvider(), robotModel.get().getLogSettings(), robotModel.get().getEstimatorDT()); } else { yoVariableServer = null; } }
public static PlanarRegionBipedalFootstepPlannerVisualizer createWithYoVariableServer(double dtForViz, FullRobotModel fullRobotModel, LogModelProvider logModelProvider, SideDependentList<ConvexPolygon2d> footPolygonsInSoleFrame, String namePrefix) { YoVariableRegistry registry = new YoVariableRegistry(PlanarRegionBipedalFootstepPlannerVisualizerFactory.class.getSimpleName()); YoGraphicsListRegistry graphicsListRegistry = new YoGraphicsListRegistry(); PlanarRegionBipedalFootstepPlannerVisualizer footstepPlannerVisualizer = new PlanarRegionBipedalFootstepPlannerVisualizer(10, footPolygonsInSoleFrame, registry, graphicsListRegistry); PeriodicThreadScheduler scheduler = new PeriodicNonRealtimeThreadScheduler("PlannerScheduler"); YoVariableServer yoVariableServer = new YoVariableServer(namePrefix + PlanarRegionBipedalFootstepPlannerVisualizerFactory.class.getSimpleName(), scheduler, logModelProvider, LogSettings.FOOTSTEP_PLANNER, dtForViz); yoVariableServer.setSendKeepAlive(true); footstepPlannerVisualizer.setTickAndUpdatable(yoVariableServer); yoVariableServer.setMainRegistry(registry, fullRobotModel, graphicsListRegistry); yoVariableServer.start(); return footstepPlannerVisualizer; }
private void setupStateEstimationThread() { stateEstimationThread = new DRCEstimatorThread(robotModel.get().getSensorInformation(), robotModel.get().getContactPointParameters(), robotModel.get().getStateEstimatorParameters(), sensorReaderFactory, threadDataSynchronizer, new PeriodicNonRealtimeThreadScheduler("DRCSimGazeboYoVariableServer"), humanoidGlobalDataProducer.get(), yoVariableServer, gravity.get()); if (humanoidGlobalDataProducer.get() != null) { PelvisPoseCorrectionCommunicatorInterface pelvisPoseCorrectionCommunicator = new PelvisPoseCorrectionCommunicator(humanoidGlobalDataProducer.get()); humanoidGlobalDataProducer.get().attachListener(StampedPosePacket.class, pelvisPoseCorrectionCommunicator); stateEstimationThread.setExternalPelvisCorrectorSubscriber(pelvisPoseCorrectionCommunicator); } else { stateEstimationThread.setExternalPelvisCorrectorSubscriber(null); } }
PeriodicThreadScheduler scheduler = new PeriodicNonRealtimeThreadScheduler("WholeBodyIKScheduler"); yoVariableServer = new YoVariableServer(getClass(), scheduler, modelProvider, LogSettings.KINEMATICS_TOOLBOX, YO_VARIABLE_SERVER_DT); yoVariableServer.setMainRegistry(registry, kinematicsToolBoxController.getDesiredFullRobotModel(), yoGraphicsListRegistry);
private void createPoseCommunicator() { if (useNetworking.get()) { JointConfigurationGatherer jointConfigurationGathererAndProducer = new JointConfigurationGatherer(fullRobotModel.get()); PeriodicThreadScheduler scheduler = new PeriodicNonRealtimeThreadScheduler("PoseCommunicator"); poseCommunicator = new DRCPoseCommunicator(fullRobotModel.get(), jointConfigurationGathererAndProducer, null, globalDataProducer, timestampProvider.get(), sensorReader.getSensorRawOutputMapReadOnly(), controllerManager.getMotionStatusHolder(), null, scheduler, netClassList.get()); } else { poseCommunicator = null; } }
YoVariableServer yoVariableServer = new YoVariableServer(getClass(), new PeriodicNonRealtimeThreadScheduler("GazeboYoVariableServer"), robotModel.getLogModelProvider(), robotModel.getLogSettings(), robotModel.getEstimatorDT()); robotModel.getStateEstimatorParameters(), sensorReaderFactory, threadDataSynchronizer, new PeriodicNonRealtimeThreadScheduler("DRCPoseCommunicator"), dataProducer, yoVariableServer, gravity); estimatorThread.setExternalPelvisCorrectorSubscriber(externalPelvisPoseSubscriber); DRCControllerThread controllerThread = new DRCControllerThread(robotModel, robotModel.getSensorInformation(), controllerFactory, threadDataSynchronizer,
PeriodicThreadScheduler scheduler = new PeriodicNonRealtimeThreadScheduler("BehaviorScheduler"); yoVariableServer = new YoVariableServer(getClass(), scheduler, modelProvider, LogSettings.BEHAVIOR, BEHAVIOR_YO_VARIABLE_SERVER_DT);