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