renamed format.go to sensordata.go
This commit is contained in:
parent
79325d9209
commit
f5f98ced5b
@ -9,19 +9,6 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
/*{
|
|
||||||
"smartphone": {
|
|
||||||
// hier daten von hyperimu
|
|
||||||
},
|
|
||||||
"serial": {
|
|
||||||
// hier Daten von M8U:
|
|
||||||
"timestamp": 37539672354
|
|
||||||
"position": [0, 0, 0],
|
|
||||||
"orientation": [0, 0, 0]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
type sourceId string
|
type sourceId string
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@ -81,7 +68,7 @@ func (s Sensordata) Consolidate2(n Sensordata) Sensordata {
|
|||||||
if n.Position == null.Position {
|
if n.Position == null.Position {
|
||||||
n.Position = s.Position
|
n.Position = s.Position
|
||||||
}
|
}
|
||||||
if n.Orientation == null.Orientation{
|
if n.Orientation == null.Orientation {
|
||||||
n.Orientation = s.Orientation
|
n.Orientation = s.Orientation
|
||||||
}
|
}
|
||||||
return n
|
return n
|
||||||
@ -155,7 +142,6 @@ func convertIPhoneSensorLog(jsonData []byte) (*Sensordata, error) {
|
|||||||
return sd, nil
|
return sd, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func convertAndroidHyperImu(jsonData []byte) (*Sensordata, error) {
|
func convertAndroidHyperImu(jsonData []byte) (*Sensordata, error) {
|
||||||
timestamp := gjson.Get(string(jsonData), "Timestamp").Int()
|
timestamp := gjson.Get(string(jsonData), "Timestamp").Int()
|
||||||
lat := gjson.Get(string(jsonData), "GPS.0").Float()
|
lat := gjson.Get(string(jsonData), "GPS.0").Float()
|
||||||
Loading…
Reference in New Issue
Block a user