RobotCore 1.0
WPILib port to raspberry Pi
Loading...
Searching...
No Matches
Rotation2dProto.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.Rotation2d;
8import org.wpilib.math.geometry.proto.detail.ProtobufRotation2d;
9import org.wpilib.util.protobuf.Protobuf;
10import us.hebi.quickbuf.Descriptors.Descriptor;
11
12public final class Rotation2dProto implements Protobuf<Rotation2d, ProtobufRotation2d> {
13 @Override
14 public Class<Rotation2d> getTypeClass() {
15 return Rotation2d.class;
16 }
17
18 @Override
19 public Descriptor getDescriptor() {
21 }
22
23 @Override
27
28 @Override
29 public Rotation2d unpack(ProtobufRotation2d msg) {
30 return new Rotation2d(msg.getValue());
31 }
32
33 @Override
34 public void pack(ProtobufRotation2d msg, Rotation2d value) {
35 msg.setValue(value.getRadians());
36 }
37
38 @Override
39 public boolean isImmutable() {
40 return true;
41 }
42}