Update grpc version, use servo implementations.
This commit is contained in:
@@ -11,7 +11,7 @@ let package = Package(
|
||||
dependencies: [
|
||||
// Dependencies declare other packages that this package depends on.
|
||||
// .package(url: /* package url */, from: "1.0.0"),
|
||||
.package(url: "https://github.com/grpc/grpc-swift.git", from: "1.0.0-alpha.12"),
|
||||
.package(url: "https://github.com/grpc/grpc-swift.git", from: "1.0.0-alpha.19"),
|
||||
.package(url: "https://github.com/uraimo/SwiftyGPIO.git", from: "1.0.0"),
|
||||
.package(url: "https://vato.ddns.net/gitlab/vato007/swiftrplidar.git", .branch("master")),
|
||||
.package(url: "https://vato.ddns.net/gitlab/vato007/SwiftSerial.git", .branch("dtr_support")),
|
||||
|
||||
@@ -35,11 +35,11 @@ public class IntelligentPiCar : RPiVehicle2D {
|
||||
*/
|
||||
func move2D(magnitude: Float, angle: Float) {
|
||||
if let throttleFunc = self.throttleFunc {
|
||||
self.pwmThrottle.value = throttleFunc(magnitude)
|
||||
// self.pwmThrottle.value = throttleFunc(magnitude)
|
||||
}
|
||||
|
||||
if let steeringFunc = steeringFunc {
|
||||
self.pwmSteering.value = steeringFunc(angle)
|
||||
// self.pwmSteering.value = steeringFunc(angle)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
import SwiftyGPIO
|
||||
|
||||
import Swift2dCar
|
||||
|
||||
func getVehicle2D() throws -> Vehicle2D {
|
||||
if let value = ProcessInfo.processInfo.environment["CAR_VEHICLE"] {
|
||||
@@ -17,7 +17,7 @@ func getVehicle2D() throws -> Vehicle2D {
|
||||
let pwms = SwiftyGPIO.hardwarePWMs(for:.RaspberryPi3)!
|
||||
|
||||
// Read the feature database.
|
||||
return try RPiVehicle2D(withThrottlePin: Servo(forPin: (pwms[0]?[.P18])!)!, withSteeringPin:Servo(forPin: (pwms[1]?[.P19])!)!)
|
||||
return try RPiVehicle2D(withThrottlePin: PWMHardwareServo(forPin: (pwms[0]?[.P18])!)!, withSteeringPin:PWMHardwareServo(forPin: (pwms[1]?[.P19])!)!)
|
||||
default:
|
||||
return MockVehicle()
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user