Class ROSPublishOperation<D>
- java.lang.Object
-
- edu.wpi.grip.core.operations.network.NetworkPublishOperation<D>
-
- edu.wpi.grip.core.operations.network.ros.ROSPublishOperation<D>
-
- Type Parameters:
D
- The type of the socket that is taken as an input to be published
- All Implemented Interfaces:
Operation
public class ROSPublishOperation<D> extends NetworkPublishOperation<D>
An operation that can publish a type to ROS using the java to message converter.
-
-
Field Summary
-
Fields inherited from class edu.wpi.grip.core.operations.network.NetworkPublishOperation
dataSocket, dataType, nameSocket
-
-
Constructor Summary
Constructors Constructor Description ROSPublishOperation(InputSocket.Factory inputSocketFactory, java.lang.Class<D> dataType, ROSNetworkPublisherFactory rosNetworkPublisherFactory, JavaToMessageConverter<D,?> converter)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.List<InputSocket<java.lang.Boolean>>
createFlagSockets()
Creates a list of input sockets that control which items to publish.static OperationDescription
descriptionFor(java.lang.Class<?> dataType)
Creates aOperationDescription
for the given type.protected void
doPublish()
Publishes the data.-
Methods inherited from class edu.wpi.grip.core.operations.network.NetworkPublishOperation
getInputSockets, getOutputSockets, perform
-
-
-
-
Constructor Detail
-
ROSPublishOperation
public ROSPublishOperation(InputSocket.Factory inputSocketFactory, java.lang.Class<D> dataType, ROSNetworkPublisherFactory rosNetworkPublisherFactory, JavaToMessageConverter<D,?> converter)
- Parameters:
inputSocketFactory
- The factory for creatingInputSocket
dataType
- The data type that this Operation will publish.rosNetworkPublisherFactory
- The factory for handling the lifecycle of the ROS node.converter
- The converter between the dataType and the ROS type.
-
-
Method Detail
-
descriptionFor
public static OperationDescription descriptionFor(java.lang.Class<?> dataType)
Creates aOperationDescription
for the given type.- Parameters:
dataType
- The type that this description will be publishing.
-
createFlagSockets
protected java.util.List<InputSocket<java.lang.Boolean>> createFlagSockets()
Description copied from class:NetworkPublishOperation
Creates a list of input sockets that control which items to publish.- Specified by:
createFlagSockets
in classNetworkPublishOperation<D>
-
doPublish
protected void doPublish()
Description copied from class:NetworkPublishOperation
Publishes the data.- Specified by:
doPublish
in classNetworkPublishOperation<D>
-
-