public class RobotUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static long |
DEFAULT_BLENDER_INTERVAL
Default milliseconds for a Blender interval
|
| Constructor and Description |
|---|
RobotUtils() |
| Modifier and Type | Method and Description |
|---|---|
static Map<Integer,Double> |
convertMap(Robot.RobotPositionMap posMap)
Converts a RobotPositionMap to a Map of Integers to Doubles.
|
static Robot.RobotPositionMap |
getCurrentPositions(org.osgi.framework.BundleContext context,
Robot.Id robotId)
Returns a RobotPositionMap of the current positions for the Robot with
the given Id.
|
static Robot.RobotPositionMap |
getDefaultPositions(org.osgi.framework.BundleContext context,
Robot.Id robotId)
Returns a RobotPositionMap of the default positions for the Robot with
the given Id.
|
static Robot.RobotPositionMap |
getGoalPositions(org.osgi.framework.BundleContext context,
Robot.Id robotId)
Returns a RobotPositionMap of the goal positions for the Robot with
the given Id.
|
static String |
getRobotFilter(Robot.Id robotId)
Returns an OSGi filter String for matching the given Robot.Id.
|
static String |
getRobotFilter(Robot.Id robotId,
String serviceFilter)
Returns an OSGi filter String for matching the given Robot.Id.
|
static RobotManager |
getRobotManager(org.osgi.framework.BundleContext context)
Returns a global RobotManager.
|
static org.osgi.framework.ServiceReference |
getRobotReference(org.osgi.framework.BundleContext context,
Robot.Id robotId)
Finds ServiceReferences for a Robot with the given id.
|
static boolean |
isRobotIdAvailable(org.osgi.framework.BundleContext context,
Robot.Id robotId)
Checks if the given robotId is available to use.
|
static List<org.jflux.impl.services.rk.lifecycle.ManagedService> |
launchDefaultBlender(org.osgi.framework.BundleContext context,
Robot.Id robotId,
long blenderIntervalMsec) |
static org.osgi.framework.ServiceRegistration |
registerFrameSource(org.osgi.framework.BundleContext context,
Robot.Id robotId,
FrameSource frameSource)
Registers a FrameSource using the given Robot.Id as a property.
|
static org.osgi.framework.ServiceRegistration |
registerRobot(org.osgi.framework.BundleContext context,
Robot robot,
Properties props)
Adds a Robot to the OSGi ServiceRegistry with the robotId as a
service property.
|
static List<org.jflux.impl.services.rk.lifecycle.ManagedService> |
startDefaultBlender(org.osgi.framework.BundleContext context,
Robot.Id robotId,
long blenderIntervalMsec)
Creates a DefaultBlender for the Robot with the given robotId.
|
public static final long DEFAULT_BLENDER_INTERVAL
public static Robot.RobotPositionMap getCurrentPositions(org.osgi.framework.BundleContext context, Robot.Id robotId)
context - BundleContext used to locate the robotrobotId - identifies the Robot to usepublic static Robot.RobotPositionMap getGoalPositions(org.osgi.framework.BundleContext context, Robot.Id robotId)
context - BundleContext used to locate the robotrobotId - identifies the Robot to usepublic static Robot.RobotPositionMap getDefaultPositions(org.osgi.framework.BundleContext context, Robot.Id robotId)
context - BundleContext used to locate the robotrobotId - identifies the Robot to usepublic static boolean isRobotIdAvailable(org.osgi.framework.BundleContext context,
Robot.Id robotId)
context - BundleContext to userobotId - Robot.Id to checkpublic static org.osgi.framework.ServiceRegistration registerRobot(org.osgi.framework.BundleContext context,
Robot robot,
Properties props)
context - BundleContext to userobot - Robot to registerprops - option service properties to add to the registrationpublic static org.osgi.framework.ServiceReference getRobotReference(org.osgi.framework.BundleContext context,
Robot.Id robotId)
context - BundleContext used to retrieve a ServiceReferencerobotId - the id to filter byNullPointerException - if context or robotId are nullIllegalArgumentException - if robotId is emptypublic static List<org.jflux.impl.services.rk.lifecycle.ManagedService> startDefaultBlender(org.osgi.framework.BundleContext context, Robot.Id robotId, long blenderIntervalMsec)
context - BundleContext to userobotId - Robot.Id to useblenderIntervalMsec - Blender timer intervalpublic static List<org.jflux.impl.services.rk.lifecycle.ManagedService> launchDefaultBlender(org.osgi.framework.BundleContext context, Robot.Id robotId, long blenderIntervalMsec)
public static org.osgi.framework.ServiceRegistration registerFrameSource(org.osgi.framework.BundleContext context,
Robot.Id robotId,
FrameSource frameSource)
context - BundleContext to userobotId - Robot.Id to associate with the FrameSourceframeSource - FrameSource to registerpublic static String getRobotFilter(Robot.Id robotId)
robotId - the Robot.Id to matchpublic static String getRobotFilter(Robot.Id robotId, String serviceFilter)
robotId - Robot.Id to matchserviceFilter - addition filter to matchpublic static Map<Integer,Double> convertMap(Robot.RobotPositionMap posMap)
posMap - RobotPositionMap to convertpublic static RobotManager getRobotManager(org.osgi.framework.BundleContext context)
context - BundleContext for OSGiCopyright © 2011-2014. All Rights Reserved.