j2000-w84

This commit is contained in:
nuknal
2024-05-21 11:48:10 +08:00
parent c108f0337b
commit dd23760dbb
6 changed files with 141 additions and 36 deletions

View File

@@ -9,6 +9,7 @@ import (
"github.com/k0kubun/pp/v3"
"github.com/sirupsen/logrus"
log "github.com/sirupsen/logrus"
"starwiz.cn/sjy01/preprocessing/calculator"
)
const AuxPlatformFrmSize = 512 // 512 bytes
@@ -29,9 +30,9 @@ type AuxPlatform struct {
QuatOrbJQ1 float64 // [37-40]轨道相对惯性系四元数矢部 的 Q1 值,量纲 1/0x40000000
QuatOrbJQ2 float64 // [41-44]Q2 值
QuatOrbJQ3 float64 // [45-48]Q3 值
Eular1 float64 // [49-52]本体相对轨道姿态角量纲1/1000000 单位rad
Eular2 float64 // [53-56]
Eular3 float64 // [57-60]
Eular1 float64 // [49-52]本体相对轨道姿态角,[Z]Yaw 测摆角,量纲1/1000000 单位rad
Eular2 float64 // [53-56] Pitch [Y]
Eular3 float64 // [57-60] Roll [X]
DotEular1 float64 // [61-62]本体相对轨道角速度量纲1/100000 单位rad
DotEular2 float64 // [63-64]
DotEular3 float64 // [65-66]
@@ -353,23 +354,32 @@ func (e *Extractor) ParseAuxPlatform(auxfile string) ([]*AuxPlatform, error) {
}
aps = append(aps, &ap)
ap.Print()
// ap.Print()
// Calculate(
// Vector3{ap.J2000Pos_X, ap.J2000Pos_Y, ap.J2000Pos_Y},
// Vector3{ap.J2000Vel_X, ap.J2000Vel_Y, ap.J2000Vel_Z},
// Quaternion{ap.SS1_Q1, ap.SS1_Q2, ap.SS1_Q3, ap.SS1_Q4},
// )
// pp.Println(calculator.WGS84XYZtoLngLat(ap.W84PosX, ap.W84PosY, ap.W84PosZ))
// pp.Println(calculator.WGS84XYZtoLngLat(ap.WGS84PosX, ap.WGS84PosY, ap.WGS84PosZ))
pp.Println(calculator.WGS84XYZtoLatLngH(ap.W84PosX, ap.W84PosY, ap.W84PosZ))
pp.Println(calculator.WGS84XYZtoLatLngH(ap.WGS84PosX, ap.WGS84PosY, ap.WGS84PosZ))
pp.Println(calculator.J2000ToWGS84(
ap.J2000PosX,
ap.J2000PosY,
ap.J2000PosZ,
time.Unix(
int64(ap.UTCTimeSec+uint32(ReferenceTime2000)),
int64(ap.Microsecond)*1000).UTC()))
pp.Println(calculator.J2000ToWGS84(
ap.J2000Pos_X,
ap.J2000Pos_Y,
ap.J2000Pos_Z,
time.Unix(
int64(ap.UTCTimeSec+uint32(ReferenceTime2000)),
int64(ap.Microsecond)*1000).UTC()))
break
if i+AuxPlatformFrmSize > len(data) {
logrus.Info("rest of aux data length is not enough", len(data)-i)
break
}
}
return aps, nil
}