sensors-swift
TraceLog
sensors-swift | TraceLog | |
---|---|---|
1 | 1 | |
54 | 52 | |
- | - | |
0.0 | 0.0 | |
5 months ago | 10 months ago | |
Swift | Swift | |
MIT License | Apache License 2.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
sensors-swift
-
Show HN: CycleQuest – Indoor Cycling game with steering
- Comes with ready-to-use models and textures
To generate roads, I downloaded .gpx files from my Strava activities, then implemented a parser to take coordinates and elevations and build roads in-game using EasyRoads3D. These tools combined worked quite well but required some manual work. I had to go over the entire length of the road to smoothen it up (due to GPS noise in .gpx files). The terrain also didn’t always perfectly align with the road, so I had to manually modify it.
I figured that steering would be a good way to keep the user engaged in the gameplay, instead of just sitting on the bike and pedalling. With required steering, you need to be engaged to not drive off the road.
There are some solutions to virtual steering in other smart trainer games, but they are hardware-based - e.g., for Zwift, you need to buy their hardware controller. I really wanted to keep it as simple and inexpensive as possible, so I used a smartphone mounted to the handlebars as a steering controller.
I implemented native apps for both iOS and Android. They use the gyroscope to get the steering value and broadcast it as a BLE peripheral. Implementing Bluetooth in Unity was a little tricky as there is no built-in solution. The implementation depends on the platform the game is running on. It boils down to writing a native plugin for each platform you support.
For macOS, there is an open-source library written in Swift - https://github.com/codeinversion/sensors-swift. It already has the necessary services and characteristics implemented. I had to modify it a little and compile it into a Unity plugin.
For Windows, there also is a library - https://github.com/adabru/BleWinrtDll, but it wasn’t working too well. Because I targeted UWP, I was able to implement my own Bluetooth logic in C# and compile it directly in Unity.
Overall, it was a really fun project to work on. I’m particularly happy that I was able to release it starting from scratch in just a couple of months, and I hope to continue working on it.
TraceLog
-
Swift Utilities for writing to and reading from the device log
TraceLog 🐧 - Dead Simple: logging the way it's meant to be! Runs on iOS, macOS, and Linux.
What are some alternatives?
Atlantis - A powerful input-agnostic swift logging framework made to speed up development with maximum readability.
AEConsole - Customizable Console UI overlay with debug log on top of your iOS App
Rainbow - Delightful console output for Swift developers.
Duration - A simple Swift package for measuring and reporting the time taken for operations
QorumLogs - :closed_book: Swift Logging Utility for Xcode & Google Docs
Puree - [Obsoleted] A log collector for iOS (new version! -> https://github.com/cookpad/Puree-Swift)
Watchdog - Class for logging excessive blocking on the main thread
SwiftyBeaver - Convenient & secure logging during development & release in Swift 4 & 5
TinyConsole - 📱💬🚦 TinyConsole is a micro-console that can help you log and display information inside an iOS application, where having a connection to a development computer is not possible.
CleanroomLogger - CleanroomLogger provides an extensible Swift-based logging API that is simple, lightweight and performant
XCGLogger - A debug log framework for use in Swift projects. Allows you to log details to the console (and optionally a file), just like you would have with NSLog() or print(), but with additional information, such as the date, function name, filename and line number.
Bugfender - Bugfender SDK for iOS, a remote logger tailor-made for mobile