RobotCore
1.0
WPILib port to raspberry Pi
Toggle main menu visibility
Loading...
Searching...
No Matches
Rotation2dStruct.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
5
package
org.wpilib.math.geometry.struct;
6
7
import
java.nio.ByteBuffer;
8
import
org.wpilib.math.geometry.Rotation2d;
9
import
org.wpilib.util.struct.Struct;
10
11
public
final
class
Rotation2dStruct
implements
Struct
<Rotation2d> {
12
@Override
13
public
Class<Rotation2d>
getTypeClass
() {
14
return
Rotation2d
.class;
15
}
16
17
@Override
18
public
String
getTypeName
() {
19
return
"Rotation2d"
;
20
}
21
22
@Override
23
public
int
getSize
() {
24
return
DOUBLE_SIZE
;
25
}
26
27
@Override
28
public
String
getSchema
() {
29
return
"double value"
;
30
}
31
32
@Override
33
public
Rotation2d
unpack
(ByteBuffer bb) {
34
double
value = bb.getDouble();
35
return
new
Rotation2d
(value);
36
}
37
38
@Override
39
public
void
pack(ByteBuffer bb,
Rotation2d
value) {
40
bb.putDouble(value.
getRadians
());
41
}
42
43
@Override
44
public
boolean
isImmutable
() {
45
return
true
;
46
}
47
}
org.wpilib.math.geometry.Rotation2d
Definition
Rotation2d.java:30
org.wpilib.math.geometry.Rotation2d.Rotation2d
Rotation2d()
Definition
Rotation2d.java:84
org.wpilib.math.geometry.Rotation2d.getRadians
double getRadians()
Definition
Rotation2d.java:301
org.wpilib.math.geometry.struct.Rotation2dStruct
Definition
Rotation2dStruct.java:11
org.wpilib.math.geometry.struct.Rotation2dStruct.isImmutable
boolean isImmutable()
Definition
Rotation2dStruct.java:44
org.wpilib.math.geometry.struct.Rotation2dStruct.unpack
Rotation2d unpack(ByteBuffer bb)
Definition
Rotation2dStruct.java:33
org.wpilib.math.geometry.struct.Rotation2dStruct.getTypeName
String getTypeName()
Definition
Rotation2dStruct.java:18
org.wpilib.math.geometry.struct.Rotation2dStruct.getSize
int getSize()
Definition
Rotation2dStruct.java:23
org.wpilib.math.geometry.struct.Rotation2dStruct.getTypeClass
Class< Rotation2d > getTypeClass()
Definition
Rotation2dStruct.java:13
org.wpilib.math.geometry.struct.Rotation2dStruct.getSchema
String getSchema()
Definition
Rotation2dStruct.java:28
org.wpilib.util.struct.Struct
Definition
Struct.java:22
org.wpilib.util.struct.Struct.DOUBLE_SIZE
int DOUBLE_SIZE
Definition
Struct.java:42
org
wpilib
math
geometry
struct
Rotation2dStruct.java
Generated by
1.18.0