Skip to content
This repository has been archived by the owner on Sep 6, 2024. It is now read-only.

Swerve Library 1.5.0

Compare
Choose a tag to compare
@rgatkinson rgatkinson released this 05 Mar 19:37
· 902 commits to master since this release

This is a very large set of changes, perhaps the largest yet. Care has been taken to maintain compatibility where possible through judicious use of "@deprecated", but in some cases functionality has been deleted and removed where it was believed to have been little used (if at all) in the interests of simplicity and the sanity of the library maintainer (if there's something important that you were using that was deleted please let us know). Before committing to upgrade to this release, be sure you have enough time to review the impact to your code and perform any necessary adjustments. Don't do this the night before a competition.

Note that we have had verified reports that, depending on how much your code was affected by these changes, bugs in the dependency analysis of Android Studio (perhaps Gradle itself) are tickled. If you find you get very odd broken dependencies when you sync to this release, give us a ring and we'll try to walk you through things.

The Robot Wifi Protocol Version spoken by this release is v4, the same as in previous releases. Thus, the driver station of the previous release is compatible with robot controller apps you build with this release; no upgrade of the driver station is necessary. That said, the driver station included in this release (in the doc\apk directory, as usual) has enhanced function, notably of its monitoring of battery voltage.

Though the quantity of changes in this release is large, the increment in functionality is relatively small. Most of the changes are in response to the movement of function from the Swerve Library into the Core SDK (most notably the 'easy' controllers and the I2c layer) for a beta release in early March, 2016 (as always, this release of the Swerve Library fully contains the Core SDK with which it is compatible; you do not need to, and should not, download both libraries). That migration is the cause of some of the issues of compatibility. For example, interfaces migrated no longer have the 'IFoo' naming style, and some refinement and polish was applied. II2cDeviceClient is now I2cDeviceSynch; it's implementation I2cDeviceClient is now I2cDeviceSyncImpl. The actual interface II2cDeviceClient technically remains, for compatibility, but is now a trivial extension of I2cDeviceSync, and is deprecated. Other changes have been treated similarly.

Beyond simple movement of function, there are some improvements in this release, including:

  • All thunking has been removed. All calls to sensor and actuator logic now happen, immediately, on the threads on which they are called. A corollary of this change is that optional interfaces on, e.g., sensor objects are no longer masked by the thunking objects.
  • The function waitForOneFullHardwareCycle() now no longer serves a useful purpose, and has been deprecated. In most cases, the idle() function is a better choice, or a Thread.sleep().
  • Improvements have been made in the robustness of OpMode shutdown in the face of errant code and hardware lock up. If, on an OpMode stop or such, you find your app appearing to 'crash' after about 10 seconds of inactivity, have a look at the logcat log: it should be able to significantly help diagnose the problem.
  • Improvements have been made in the software being able to tolerate electrostatic discharge (ESD) events without locking up the hardware. We're still not out of the woods, but it's better.
  • Synchronous and Linear OpModes now auto-stop upon their completion.
  • The cryptographic credentials used during development to sign robot controller apps before they are downloaded to the phone (such signing always happens under the covers) is now built-in to the SDK rather than be automatically generated by Android Studio on each individual development station. For teams on which development is carried out on more than one laptop, this will smooth things significantly: much less disruption will occur (popups and permissions dialogs) as one switches from laptop to laptop. However, it does mean that a one-time occurrence of such popups will be experienced by everyone, just like the very first time they downloaded.
  • The "Please wait while we update the Wifi Direct settings on this device" issue has been resolved.
  • The app build time and date now appears on the About dialog.

There are a few breaking changes, among them the following:

  • The sound files played on robot startup have been moved from YourCodeHere to the SwerveLibrary; if you've customized the sound playing, you may need to adjust your code.
  • As mentioned, some functionality has been deleted, including IThunkDispatcher, SynchronousThreadContext.getEventLoopManger(), and several other thunking-related methods and constants.
  • II2cDeviceClient is now named I2cDeviceSynch; the the old name is still usable, but deprecated
  • II2cDeviceClient.READ_MODE is now I2cDeviceSynch.ReadMode; please change your code accordingly
  • SynchronousOpMode.createSynchronousWorkerThread still executes the Runnnable passed as an argument, but no longer returns a Thread on which that is done, as a more general Executor mechanism is used instead.
  • Some technical internal but formally 'public' functionality has been removed from SwerveThreadContext.
  • I2cDevice.getController() is now I2cDevice.getI2cController()
  • I2cDeviceClient.getI2cCycleCount() is now found on I2cDevice.getCallbackCount().
  • II2cDeviceClientUser.getI2cDeviceClient() is now I2cDeviceSynchUser.getI2cDeviceSynch().
  • ClassFactory.createI2cDeviceClient() no longer supports auto-close on opmode stop.

Note: the JavaDoc documentation in this release has not yet been updated, for doing so would leave the migrated functionality undocumented until the beta of the Core SDK.