-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move org.team199 to org.carlmontrobotics (#49)
- Loading branch information
Showing
28 changed files
with
94 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
# WPIWebSockets | ||
This API provides a Java interface to the [WPILib HALSim WebSockets API](https://github.com/wpilibsuite/allwpilib/blob/master/simulation/halsim_ws_core/doc/hardware_ws_api.md) which mirrors the standard simulation API. | ||
# Building the API | ||
To build the API, navigate to the root directory of this repository and run `./gradlew build`. This will use Gradle to build the API with Java 8. Note that the simulated device files (org.team199.wpiws.devices.*) are auto-generated using the [AsyncAPI Generator](https://github.com/asyncapi/generator) and [an extended version](./wpilib-ws.yaml) of [WPILib's machine readable WebSocket specification](https://github.com/wpilibsuite/allwpilib/blob/master/simulation/halsim_ws_core/doc/wpilib-ws.yaml). The AsyncAPI template used to generate these files is located at [./asyncapi-template](./asyncapi-template). These files are auto-generated during the `WPIWebSockets:build` task, however, they can be manually regenerated by running `./gradlew generateDeviceFiles`. | ||
To build the API, navigate to the root directory of this repository and run `./gradlew build`. This will use Gradle to build the API with Java 8. Note that the simulated device files (org.carlmontrobotics.wpiws.devices.*) are auto-generated using the [AsyncAPI Generator](https://github.com/asyncapi/generator) and [an extended version](./wpilib-ws.yaml) of [WPILib's machine readable WebSocket specification](https://github.com/wpilibsuite/allwpilib/blob/master/simulation/halsim_ws_core/doc/wpilib-ws.yaml). The AsyncAPI template used to generate these files is located at [./asyncapi-template](./asyncapi-template). These files are auto-generated during the `WPIWebSockets:build` task, however, they can be manually regenerated by running `./gradlew generateDeviceFiles`. | ||
# Using the API | ||
Connecting to the running HALSim client and server instances can be accomplished by using the `connectHALSim` and `startHALSimServer` methods of [`org.team199.wpiws.connection.WSConnection`](./src/main/java/org/team199/wpiws/connection/WSConnection.java). Code for connecting to simulated devices can be found in the `org.team199.wpiws.devices` package. These classes can be initialized by providing the constructor with the device id with which it should associate itself. The instance will then provide getter, setter, and callback methods for all of the values exposed by the WebSocket API. (ex. `new PWMSim("5").setSpeed(5)`, `new DIOSim("0").getValue()`). Note: `static` methods apply globaly to the device type. | ||
Connecting to the running HALSim client and server instances can be accomplished by using the `connectHALSim` and `startHALSimServer` methods of [`org.carlmontrobotics.wpiws.connection.WSConnection`](./src/main/java/org/carlmontrobotics/wpiws/connection/WSConnection.java). Code for connecting to simulated devices can be found in the `org.carlmontrobotics.wpiws.devices` package. These classes can be initialized by providing the constructor with the device id with which it should associate itself. The instance will then provide getter, setter, and callback methods for all of the values exposed by the WebSocket API. (ex. `new PWMSim("5").setSpeed(5)`, `new DIOSim("0").getValue()`). Note: `static` methods apply globaly to the device type. | ||
|
||
For a more complete example, see [DeepBlueRobotics/DeepBlueSim](https://github.com/DeepBlueRobotics/DeepBlueSim) which uses this API to provide an interface to a [Webots](https://cyberbotics.com/) robot simulator. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,7 +57,7 @@ task generateDeviceFiles(type: NpxTask) { | |
workingDir = buildDir // Because templateDir can't be under it | ||
command = '@asyncapi/[email protected]' | ||
args = ['--force-write', | ||
'-o', "${outputDir}/org/team199/wpiws/devices", | ||
'-o', "${outputDir}/org/carlmontrobotics/wpiws/devices", | ||
"https://raw.githubusercontent.com/DeepBlueRobotics/allwpilib/c1fc86033a4b5ebda451de657fc2546eb3f431fb/simulation/halsim_ws_core/doc/wpilib-ws.yaml", | ||
file(archiveTemplate.archiveFile).toURI()] | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
src/main/java/org/team199/wpiws/Pair.java → ...java/org/carlmontrobotics/wpiws/Pair.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package org.team199.wpiws; | ||
package org.carlmontrobotics.wpiws; | ||
|
||
import java.util.Objects; | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
...n/java/org/team199/wpiws/StateDevice.java → ...g/carlmontrobotics/wpiws/StateDevice.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...wpiws/connection/ConnectionProcessor.java → ...wpiws/connection/ConnectionProcessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 27 additions & 27 deletions
54
...99/wpiws/connection/MessageProcessor.java → ...cs/wpiws/connection/MessageProcessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...am199/wpiws/connection/RunningObject.java → ...otics/wpiws/connection/RunningObject.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...eam199/wpiws/connection/WSConnection.java → ...botics/wpiws/connection/WSConnection.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...org/team199/wpiws/connection/WSValue.java → ...ontrobotics/wpiws/connection/WSValue.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package org.team199.wpiws.connection; | ||
package org.carlmontrobotics.wpiws.connection; | ||
|
||
import java.util.Objects; | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
...eam199/wpiws/connection/package-info.java → ...botics/wpiws/connection/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/** | ||
* Manages low level interfacing with WebSockets and basic WPI HALSim protocol processing and formatting | ||
*/ | ||
package org.team199.wpiws.connection; | ||
package org.carlmontrobotics.wpiws.connection; |
2 changes: 1 addition & 1 deletion
2
...199/wpiws/interfaces/BooleanCallback.java → ...ics/wpiws/interfaces/BooleanCallback.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
...ws/interfaces/DeviceMessageProcessor.java → ...ws/interfaces/DeviceMessageProcessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...m199/wpiws/interfaces/DoubleCallback.java → ...tics/wpiws/interfaces/DoubleCallback.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...9/wpiws/interfaces/ExceptionConsumer.java → ...s/wpiws/interfaces/ExceptionConsumer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...199/wpiws/interfaces/IntegerCallback.java → ...ics/wpiws/interfaces/IntegerCallback.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...eam199/wpiws/interfaces/LongCallback.java → ...botics/wpiws/interfaces/LongCallback.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...m199/wpiws/interfaces/ObjectCallback.java → ...tics/wpiws/interfaces/ObjectCallback.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...9/wpiws/interfaces/SimDeviceCallback.java → ...s/wpiws/interfaces/SimDeviceCallback.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...eam199/wpiws/interfaces/package-info.java → ...botics/wpiws/interfaces/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/** | ||
* All required {@link java.lang.FunctionalInterface} interfaces used in this API | ||
*/ | ||
package org.team199.wpiws.interfaces; | ||
package org.carlmontrobotics.wpiws.interfaces; |
2 changes: 1 addition & 1 deletion
2
.../java/org/team199/wpiws/package-info.java → .../carlmontrobotics/wpiws/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/** | ||
* Code to interface with the WebSockets API of WPILib | ||
*/ | ||
package org.team199.wpiws; | ||
package org.carlmontrobotics.wpiws; |
2 changes: 1 addition & 1 deletion
2
...ava/org/team199/wpiws/types/LEDColor.java → ...arlmontrobotics/wpiws/types/LEDColor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
...est/java/org/team199/wpiws/TestUtils.java → ...org/carlmontrobotics/wpiws/TestUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...team199/wpiws/interfaces/TriConsumer.java → ...obotics/wpiws/interfaces/TriConsumer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...team199/wpiws/interfaces/TriFunction.java → ...obotics/wpiws/interfaces/TriFunction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters