RobotCore 1.0
WPILib port to raspberry Pi
Loading...
Searching...
No Matches
Translation2dProto.java
1// Copyright (c) FIRST and other WPILib contributors.
2// Open Source Software; you can modify and/or share it under the terms of
3// the WPILib BSD license file in the root directory of this project.
4
5package org.wpilib.math.geometry.proto;
6
7import org.wpilib.math.geometry.Translation2d;
8import org.wpilib.math.geometry.proto.detail.ProtobufTranslation2d;
9import org.wpilib.util.protobuf.Protobuf;
10import us.hebi.quickbuf.Descriptors.Descriptor;
11
12public final class Translation2dProto implements Protobuf<Translation2d, ProtobufTranslation2d> {
13 @Override
14 public Class<Translation2d> getTypeClass() {
15 return Translation2d.class;
16 }
17
18 @Override
19 public Descriptor getDescriptor() {
21 }
22
23 @Override
27
28 @Override
29 public Translation2d unpack(ProtobufTranslation2d msg) {
30 return new Translation2d(msg.getX(), msg.getY());
31 }
32
33 @Override
34 public void pack(ProtobufTranslation2d msg, Translation2d value) {
35 msg.setX(value.getX());
36 msg.setY(value.getY());
37 }
38
39 @Override
40 public boolean isImmutable() {
41 return true;
42 }
43}