Merge branch 'develop' into frank-dev2

This commit is contained in:
unknown 2021-01-15 17:11:18 +01:00
commit 1398bae5b1
23 changed files with 53 additions and 18 deletions

1
.gitignore vendored
View File

@ -162,3 +162,4 @@ Temporary Items
gpsconfig.yml gpsconfig.yml
config.yml config.yml
_db _db
/build

Binary file not shown.

View File

@ -0,0 +1 @@
ˆ‰œœ+¥¶Îz {Hello Badger

View File

@ -0,0 +1 @@
38895

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1 @@
;µÐÕ0.Ñþý|uG…Hello Badger

View File

@ -0,0 +1 @@
38895

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1 @@
枯華虌𤥢崱v叐<76>Hello Badger

View File

@ -0,0 +1 @@
6958

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1 @@
ßÁuðÓJäe»|?^<5E>¢˜Hello Badger

View File

@ -0,0 +1 @@
6958

Binary file not shown.

View File

@ -1,3 +1,7 @@
/**
only for testing purposes
*/
package main package main
import ( import (

View File

@ -1,7 +1,6 @@
package core package core
import ( import (
"bufio"
"fmt" "fmt"
"git.timovolkmann.de/gyrogpsc/ublox" "git.timovolkmann.de/gyrogpsc/ublox"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
@ -212,18 +211,18 @@ func (t *tcpCollector) connectionHandler(conn net.Conn) {
conn.Close() conn.Close()
}() }()
sc := bufio.NewScanner(conn) buf := make([]byte, 2048)
skipped := 0 skipped := 0
//loop: //loop:
for sc.Scan() { for {
// Read the incoming connection into the buffer. // Read the incoming connection into the buffer.
res := append([]byte{}, sc.Bytes()...) n, err := conn.Read(buf)
if err2 := sc.Err(); err2 != nil { if err != nil {
logrus.Warn("lost tcp link:", err2) fmt.Println("TCP error - reading from connection:", n, err.Error())
break break
} }
select { select {
case t.out <- res: case t.out <- buf:
skipped = 0 skipped = 0
default: default:
logrus.Traceln("skip collecting tcp messages") logrus.Traceln("skip collecting tcp messages")

View File

@ -1,27 +1,42 @@
# gyropsc ⚡ # gyropsc ⚡
**Realtime Location Dashboard 🚀** **Realtime Location Dashboard 🚀**
## Quickstart # Quickstart
First copy `example_config.yml` to `gpsconfig.yml` and adjust your parameters. if you intend to use this tool with ublox over USB or Serial, you need to set the name of your port in this config file. otherwise the program will panic. First copy `example_config.yml` to `gpsconfig.yml` and adjust your parameters. if you intend to use this tool with ublox over USB or Serial, you need to set the name of your port in this config file. otherwise the program will panic.
### Requirements ## Requirements
* Win, Linux or Mac Computer, ideally with serial port and WiFi * Win, Linux or Mac Computer, ideally with serial port and WiFi
* GPS device (Android or iOS smartphone and/or ublox 8/M8 series module) * GPS device (Android or iOS smartphone and/or ublox 8/M8 series module)
* download latest release and unzip it * download latest release and unzip it
### Preparation ## Preparation
Make sure you prepared your GPS device like described in chapter 3.3 of the Documentation. Make sure you prepared your GPS device like described in chapter 3.3 of the Documentation.
Start gyrogpsc **before** connecting your smartphone via TCP. Start gyrogpsc **before** connecting your smartphone via TCP.
### Run ## Run
Execute `gyropgsc-$OS`, according to your operating system. Execute `gyropgsc-$OS`, according to your operating system.
## Build from source # Build and run from source
### Requirements ## Requirements
* git * git
* go >1.15 * go >1.15
### Build Steps ## Run
1. `git clone --recursive https://git.timovolkmann.de/tvolkmann/gyrogpsc.git` 1. `git clone --recursive https://git.timovolkmann.de/tvolkmann/gyrogpsc.git`
2. run `go install` from project root 2. run `go install` from project root
3. run `go run cmd/server/server.go` from project root to start application or just `go build cmd/server/server.go` for building it only 3. run `go run cmd/server/server.go` from project root to start application or just `go build cmd/server/server.go` for building it only
## Build
For Windows 64-bit: `GOOS=windows GOARCH=amd64 go build -o build/gyrogpsc-win.exe cmd/server/server.go`
For MacOS: `GOOS=darwin GOARCH=amd64 go build -o build/gyrogpsc-mac cmd/server/server.go`
For Linux: `GOOS=linux GOARCH=arm64 go build -o build/gyrogpsc-linux cmd/server/server.go`
Make sure that binaries have execute permissions on Mac and Linux. Currently only working on 64-bit systems.
## Static files and demo database
### Demo database
To use demo data, copy `backups/_db-210115-01/` to folder `_db/` in project root. The prebuilt binaries zip-file already contains demo data.
### Static files
All static files (`static/` and `templates/`) must be in the root of working directory when running gyrogpsc. That's already the case if you follow "Run" instructions.

View File

@ -53,6 +53,8 @@ scene.add(pointLight);
cube.position.x = 0 cube.position.x = 0
cube2.position.x = 0 cube2.position.x = 0
// calibration globals // calibration globals
let manCalibration = new THREE.Euler( 0, 0, 0, 'XYZ' ) let manCalibration = new THREE.Euler( 0, 0, 0, 'XYZ' )
let calibrationRot = new THREE.Quaternion() let calibrationRot = new THREE.Quaternion()
@ -62,6 +64,7 @@ let calYaw = 0
let quaternionOffset = document.getElementById("quaternionOffset") let quaternionOffset = document.getElementById("quaternionOffset")
// function to set current cube rotation from sensor data with respect to calibration
function renderTCP(x, y, z) { function renderTCP(x, y, z) {
let calibration = new THREE.Quaternion().setFromEuler(manCalibration) let calibration = new THREE.Quaternion().setFromEuler(manCalibration)
let eul = new THREE.Euler( x, y, z, 'YXZ' ); let eul = new THREE.Euler( x, y, z, 'YXZ' );
@ -73,6 +76,7 @@ function renderTCP(x, y, z) {
renderer.render(scene, camera); renderer.render(scene, camera);
} }
// function to set current cube rotation from sensor data
function renderSerial(x, y, z) { function renderSerial(x, y, z) {
let eul = new THREE.Euler( x, y, z, 'YXZ' ); // XYZ XZY YZX YXZ ZXY ZYX let eul = new THREE.Euler( x, y, z, 'YXZ' ); // XYZ XZY YZX YXZ ZXY ZYX
@ -137,9 +141,9 @@ function calibrate(evt) {
let dif = new THREE.Euler().setFromQuaternion( diff ) let dif = new THREE.Euler().setFromQuaternion( diff )
console.log("OLD:","pitch", old.x * 180/Math.PI, "yaw", old.y * 180/Math.PI, "roll", old.z * 180/Math.PI) console.log("OLD:","pitch", old.x * 180/Math.PI, "yaw", old.y * 180/Math.PI, "roll", old.z * 180/Math.PI)
console.log("DIFF:","pitch", dif.x * 180/Math.PI, "yaw", dif.y * 180/Math.PI, "roll", dif.z * 180/Math.PI) console.log("DIFF:","pitch", dif.x * 180/Math.PI, "yaw", dif.y * 180/Math.PI, "roll", dif.z * 180/Math.PI)
calPitch = dif.x // * 180/Math.PI calPitch = dif.x
calYaw = dif.y // * 180/Math.PI calYaw = dif.y
calRoll = dif.z // * 180/Math.PI calRoll = dif.z
calibrationRot = diff calibrationRot = diff
} }
document.getElementById("deleteCalibration").onclick = delCalibration document.getElementById("deleteCalibration").onclick = delCalibration
@ -172,6 +176,7 @@ let altimeter = $.flightIndicator('#altimeter', 'altimeter', options);
let airspeedLabel = document.getElementById("airspeedLabel") let airspeedLabel = document.getElementById("airspeedLabel")
let altitudeLabel = document.getElementById("altitudeLabel") let altitudeLabel = document.getElementById("altitudeLabel")
// function to set analog indictors from current sensor data
function setIndicatorsTcp(sensordata) { function setIndicatorsTcp(sensordata) {
let q = new THREE.Euler().setFromQuaternion( cube2.quaternion, 'YXZ' ) // XYZ XZY YZX YXZ ZXY ZYX let q = new THREE.Euler().setFromQuaternion( cube2.quaternion, 'YXZ' ) // XYZ XZY YZX YXZ ZXY ZYX
@ -185,6 +190,7 @@ function setIndicatorsTcp(sensordata) {
} }
} }
// function to set analog indictors from current sensor data
function setIndicatorsSer(sensordata) { function setIndicatorsSer(sensordata) {
if (sensordata.Orientation[0] !== 0 && sensordata.Orientation[1] !== 0) { if (sensordata.Orientation[0] !== 0 && sensordata.Orientation[1] !== 0) {
attitudeSer.setPitch(sensordata.Orientation[0]) attitudeSer.setPitch(sensordata.Orientation[0])

View File

@ -98,7 +98,6 @@ window.addEventListener("load", function(evt) {
document.getElementById("yellow").style.backgroundColor = 'rgb(157,117,25)' document.getElementById("yellow").style.backgroundColor = 'rgb(157,117,25)'
document.getElementById("redlamp").style.backgroundColor = 'rgb(255,14,14)' document.getElementById("redlamp").style.backgroundColor = 'rgb(255,14,14)'
} }
} }
tempTCPCoords = null tempTCPCoords = null
} }

View File

@ -1,3 +1,6 @@
// credits to https://github.com/daedaleanai/ublox for basic ubx parsing idea & code
// missing ubx messages added and code modified by Timo Volkmann
// Package ublox provides methods to encode and decode u-Blox 8 / M8 NMEA and UBX messages // Package ublox provides methods to encode and decode u-Blox 8 / M8 NMEA and UBX messages
// as documented in // as documented in
// UBX-13003221 - R20 u-blox 8 / u-blox M8 Receiver description Including protocol specification // UBX-13003221 - R20 u-blox 8 / u-blox M8 Receiver description Including protocol specification