Package frc.robot.shared.config
Class Pose2dDeserializer
java.lang.Object
com.fasterxml.jackson.databind.JsonDeserializer<edu.wpi.first.math.geometry.Pose2d>
frc.robot.shared.config.Pose2dDeserializer
- All Implemented Interfaces:
com.fasterxml.jackson.databind.deser.NullValueProvider
public class Pose2dDeserializer
extends com.fasterxml.jackson.databind.JsonDeserializer<edu.wpi.first.math.geometry.Pose2d>
Jackson deserializer for a Pose2d stored as JSON with fields
x, y (meters), and rotation in degrees.-
Nested Class Summary
Nested classes/interfaces inherited from class com.fasterxml.jackson.databind.JsonDeserializer
com.fasterxml.jackson.databind.JsonDeserializer.None -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionedu.wpi.first.math.geometry.Pose2ddeserialize(com.fasterxml.jackson.core.JsonParser parser, com.fasterxml.jackson.databind.DeserializationContext context) Parses a Pose2d from JSON with fieldsx,y(meters), androtationin degrees.Methods inherited from class com.fasterxml.jackson.databind.JsonDeserializer
deserialize, deserializeWithType, deserializeWithType, findBackReference, getAbsentValue, getDelegatee, getEmptyAccessPattern, getEmptyValue, getEmptyValue, getKnownPropertyNames, getNullAccessPattern, getNullValue, getNullValue, getObjectIdReader, handledType, isCachable, logicalType, replaceDelegatee, supportsUpdate, unwrappingDeserializer
-
Constructor Details
-
Pose2dDeserializer
public Pose2dDeserializer()
-
-
Method Details
-
deserialize
public edu.wpi.first.math.geometry.Pose2d deserialize(com.fasterxml.jackson.core.JsonParser parser, com.fasterxml.jackson.databind.DeserializationContext context) throws IOException Parses a Pose2d from JSON with fieldsx,y(meters), androtationin degrees.- Specified by:
deserializein classcom.fasterxml.jackson.databind.JsonDeserializer<edu.wpi.first.math.geometry.Pose2d>- Parameters:
parser- Jackson parser positioned at the pose nodecontext- deserialization context provided by Jackson- Returns:
- pose built from the JSON values (rotation converted to radians)
- Throws:
IOException- if the JSON cannot be read
-