Class JavaToMessageConverter<J,M extends org.ros.internal.message.Message>
- java.lang.Object
-
- edu.wpi.grip.core.operations.network.ros.JavaToMessageConverter<J,M>
-
public abstract class JavaToMessageConverter<J,M extends org.ros.internal.message.Message> extends java.lang.Object
Used to convert from a java type to a ROS message.
-
-
Field Summary
Fields Modifier and Type Field Description static JavaToMessageConverter<BlobsReport,grip_msgs.Blobs>
BLOBS
static JavaToMessageConverter<java.lang.Boolean,std_msgs.Bool>
BOOL
static JavaToMessageConverter<ContoursReport,grip_msgs.Contours>
CONTOURS
static JavaToMessageConverter<java.lang.Number,std_msgs.Float64>
FLOAT
protected com.google.common.reflect.TypeToken<J>
javaType
static JavaToMessageConverter<LinesReport,grip_msgs.Lines>
LINES
protected com.google.common.reflect.TypeToken<M>
rosType
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
convert(J javaType, org.ros.internal.message.Message message, org.ros.message.MessageFactory messageFactory)
Takes a java type and a message that type maps to and adds the data to the message.protected abstract void
doConvert(J javaType, M message, org.ros.message.MessageFactory messageFactory)
java.lang.String
getType()
-
-
-
Field Detail
-
BLOBS
public static final JavaToMessageConverter<BlobsReport,grip_msgs.Blobs> BLOBS
-
LINES
public static final JavaToMessageConverter<LinesReport,grip_msgs.Lines> LINES
-
CONTOURS
public static final JavaToMessageConverter<ContoursReport,grip_msgs.Contours> CONTOURS
-
BOOL
public static final JavaToMessageConverter<java.lang.Boolean,std_msgs.Bool> BOOL
-
FLOAT
public static final JavaToMessageConverter<java.lang.Number,std_msgs.Float64> FLOAT
-
rosType
protected final com.google.common.reflect.TypeToken<M extends org.ros.internal.message.Message> rosType
-
javaType
protected final com.google.common.reflect.TypeToken<J> javaType
-
-
Method Detail
-
getType
public final java.lang.String getType()
-
doConvert
protected abstract void doConvert(J javaType, M message, org.ros.message.MessageFactory messageFactory)
-
convert
public void convert(J javaType, org.ros.internal.message.Message message, org.ros.message.MessageFactory messageFactory)
Takes a java type and a message that type maps to and adds the data to the message.- Parameters:
javaType
- The java type to put the data for the message intomessage
- The message to put the data into.messageFactory
- Used to generate inner messages if necessary.
-
-