diff --git a/simulation/halsim_ws_core/doc/hardware_ws_api.md b/simulation/halsim_ws_core/doc/hardware_ws_api.md index 057b555488a..63d450848c6 100644 --- a/simulation/halsim_ws_core/doc/hardware_ws_api.md +++ b/simulation/halsim_ws_core/doc/hardware_ws_api.md @@ -261,12 +261,14 @@ C++/Java implementation note: these are created as SimDevice nodes where the dev Only one of ``"supplyCurrent"`` or ``"motorCurrent"`` should be sent by the hardware; the other value should be set to zero. If ``"busVoltage"`` is not simulated it should also be set to zero. -| Data Key | Type | Description | -| -------------------- | ---------------- | ------------------------------------------------ | -| ``"supplyCurrent"`` | Float | The supply current in amps as simulated/measured | -| ``">motorCurrent"`` | Float | The motor current in amps as simulated/measured | -| ``">busVoltage"`` | Float | The bus voltage as simulated/measured | +| Data Key | Type | Description | +| -------------------- | ---------------- | ----------------------------------------------------------------------------------- | +| ``"supplyCurrent"`` | Float | The supply current in amps as simulated/measured | +| ``">motorCurrent"`` | Float | The motor current in amps as simulated/measured | +| ``">busVoltage"`` | Float | The bus voltage as simulated/measured | #### CANEncoder diff --git a/simulation/halsim_ws_core/doc/wpilib-ws.yaml b/simulation/halsim_ws_core/doc/wpilib-ws.yaml index b4ddb04bead..bb2e87243db 100644 --- a/simulation/halsim_ws_core/doc/wpilib-ws.yaml +++ b/simulation/halsim_ws_core/doc/wpilib-ws.yaml @@ -52,6 +52,7 @@ components: - $ref: "#/components/schemas/relayData" - $ref: "#/components/schemas/solenoidData" - $ref: "#/components/schemas/roborioData" + - $ref: "#/components/schemas/simdeviceData" schemas: accelData: @@ -514,3 +515,167 @@ components: ">3v3_faults": type: integer description: "Number of faults on 3.3V rail" + + canmotorData: + type: object + required: + - type + - device + properties: + type: + type: string + description: "Dummy type used for SimDevice type with device=CANMotor:*" + const: CANMotor + device: + type: string + description: "Should have the form CANMotor:ControllerClassName[id]" + data: + type: object + description: "CANMotor Data" + properties: + supplyCurrent": + type: number + description: "Supply current in Amps" + minimum: 0.0 + ">motorCurrent": + type: number + description: "Motor current in Amps" + minimum: 0.0 + ">busVoltage": + type: number + description: "Bus voltage in Volts" + minimum: 0.0 + "position": + type: number + description: "Position in rotations" + ">velocity": + type: number + description: "Velocity in rotations per second" + + simdeviceData: + type: object + required: + - type + - device + oneOf: + - properties: + type: + type: string + const: SimDevice + device: + type: string + format: "[^:]+" + data: + type: object + additionalProperties: + type: string + - properties: + type: + type: string + const: SimDevice + device: + type: string + format: "DutyCycle:.+" + data: + $ref: "#/components/schemas/dutycycleData/properties/data" + - properties: + type: + type: string + const: SimDevice + device: + type: string + format: "CANMotor:.+" + data: + $ref: "#/components/schemas/canmotorData/properties/data" + - properties: + type: + type: string + const: SimDevice + device: + type: string + format: "CANEncoder:.+" + data: + $ref: "#/components/schemas/canencoderData/properties/data" + - properties: + type: + type: string + const: SimDevice + device: + type: string + format: "CANGyro:.+" + data: + $ref: "#/components/schemas/gyroData/properties/data" + - properties: + type: + type: string + const: SimDevice + device: + type: string + format: "CANAccel:.+" + data: + $ref: "#/components/schemas/accelData/properties/data" + - properties: + type: + type: string + const: SimDevice + device: + type: string + format: "CANAIn:.+" + data: + $ref: "#/components/schemas/aiData/properties/data" + - properties: + type: + type: string + const: SimDevice + device: + type: string + format: "CANDIO:.+" + data: + ref: "#/components/schemas/dioData/properties/data" + - properties: + type: + type: string + const: SimDevice + device: + type: string + format: "CANDutyCycle:.+" + data: + $ref: "#/components/schemas/dutycycleData/properties/data" +