Record Class IMUInfo
java.lang.Object
java.lang.Record
xbot.common.injection.electrical_contract.IMUInfo
- Record Components:
name- device nameimuType- IMU implementation typeinterfaceType- hardware interfacecanBusId- CAN bus identitydeviceId- device numbermountOrientation- onboard IMU mounting orientationpowerFrom- power-source metadata
public record IMUInfo(String name, XGyro.ImuType imuType, XGyro.InterfaceType interfaceType, CANBusId canBusId, int deviceId, org.wpilib.hardware.imu.OnboardIMU.MountOrientation mountOrientation, PowerSource powerFrom)
extends Record
IMU configuration. No bus, interface, orientation, or power metadata is inferred from the IMU type. Construction does
not validate or reserve hardware.
IMUInfo imu = IMUInfo.builder("IMU", XGyro.ImuType.onboard).withDeviceId(1).withMountOrientation(MountOrientation.FLAT).withPowerFrom(PowerSource.RIO)
.build();
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionIMUInfo(String name, XGyro.ImuType imuType, XGyro.InterfaceType interfaceType, CANBusId canBusId, int deviceId, org.wpilib.hardware.imu.OnboardIMU.MountOrientation mountOrientation, PowerSource powerFrom) Creates an instance of aIMUInforecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic IMUInfo.Builderbuilder(String name, XGyro.ImuType imuType) Starts a builder with an explicit name and IMU type.canBusId()Returns the value of thecanBusIdrecord component.static IMUInfocreateMock(IMUInfo realInstance) Preserves identity, interface, bus, and power metadata for a mock, without mounting orientation.intdeviceId()Returns the value of thedeviceIdrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.imuType()Returns the value of theimuTyperecord component.Returns the value of theinterfaceTyperecord component.org.wpilib.hardware.imu.OnboardIMU.MountOrientationReturns the value of themountOrientationrecord component.name()Returns the value of thenamerecord component.Returns the value of thepowerFromrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
IMUInfo
public IMUInfo(String name, XGyro.ImuType imuType, XGyro.InterfaceType interfaceType, CANBusId canBusId, int deviceId, org.wpilib.hardware.imu.OnboardIMU.MountOrientation mountOrientation, PowerSource powerFrom) Creates an instance of aIMUInforecord class.- Parameters:
name- the value for thenamerecord componentimuType- the value for theimuTyperecord componentinterfaceType- the value for theinterfaceTyperecord componentcanBusId- the value for thecanBusIdrecord componentdeviceId- the value for thedeviceIdrecord componentmountOrientation- the value for themountOrientationrecord componentpowerFrom- the value for thepowerFromrecord component
-
-
Method Details
-
builder
Starts a builder with an explicit name and IMU type. All optional metadata defaults to null. Set the CAN address withIMUInfo.Builder.withCanBus(CANPort, int), or a non-CAN device ID withIMUInfo.Builder.withDeviceId(int). An unspecified device ID is -1. -
createMock
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
name
-
imuType
-
interfaceType
Returns the value of theinterfaceTyperecord component.- Returns:
- the value of the
interfaceTyperecord component
-
canBusId
-
deviceId
-
mountOrientation
public org.wpilib.hardware.imu.OnboardIMU.MountOrientation mountOrientation()Returns the value of themountOrientationrecord component.- Returns:
- the value of the
mountOrientationrecord component
-
powerFrom
-