Skip to content

Commit

Permalink
gnssReceiver: corrected local transformationen (north, east, up) for …
Browse files Browse the repository at this point in the history
…LEOs.
  • Loading branch information
tmayerguerr committed Aug 22, 2023
1 parent 2a5c927 commit dca9dab
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
6 changes: 3 additions & 3 deletions source/gnss/gnssObservation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ static void positionVelocityTime(const GnssReceiver &receiver, const GnssTransmi

// line of sight from transmitter to receiver
k = normalize(posRecv - posTrans);
kRecv = receiver.local2antennaFrame(idEpoch).transform(receiver.global2localFrame(idEpoch).transform(rotCrf2Trf.rotate(-k))); // line of sight in receiver antenna system (north, east, up)
kRecv = receiver.global2antennaFrame(idEpoch).transform(rotCrf2Trf.rotate(-k)); // line of sight in receiver antenna system (north, east, up)
azimutRecv = kRecv.lambda();
elevationRecv = kRecv.phi();
kTrans = transmitter.celestial2antennaFrame(idEpoch, timeTrans).transform(k);
Expand Down Expand Up @@ -128,7 +128,7 @@ Bool GnssObservation::init(const GnssReceiver &receiver, const GnssTransmitter &
// phase wind-up
// Carrier phase wind-up in GPS reflectometry, Georg Beyerle, Springer Verlag 2008
// -------------------------------------------------------------------------------
const Transform3d crf2arfRecv = receiver.local2antennaFrame(idEpoch) * receiver.global2localFrame(idEpoch) * rotCrf2Trf;
const Transform3d crf2arfRecv = receiver.global2antennaFrame(idEpoch) * rotCrf2Trf;
const Transform3d crf2arfTrans = transmitter.celestial2antennaFrame(idEpoch, timeTrans);
const Vector3d Tx = crf2arfRecv.transform(crossProduct(crossProduct(k, crf2arfTrans.inverseTransform(Vector3d(1,0,0))), k));
const Vector3d Ty = crf2arfRecv.transform(crossProduct(crossProduct(k, crf2arfTrans.inverseTransform(Vector3d(0,1,0))), k));
Expand Down Expand Up @@ -299,7 +299,7 @@ void GnssObservationEquation::compute(const GnssObservation &observation, const
k, kRecvAnt, kTrans);
const Double rDotTrans = inner(k, velocityTrans)/LIGHT_VELOCITY;
const Double rDotRecv = inner(k, velocityRecv) /LIGHT_VELOCITY;
const Vector3d kRecvLocal = receiver_.local2antennaFrame(idEpoch).inverseTransform(kRecvAnt);
const Vector3d kRecvLocal = receiver_.global2localFrame(idEpoch).transform(rotCrf2Trf.rotate(-k));
azimutRecvLocal = kRecvLocal.lambda();
elevationRecvLocal = kRecvLocal.phi();

Expand Down
8 changes: 4 additions & 4 deletions source/gnss/gnssReceiver.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class GnssReceiver : public GnssTransceiver
std::vector<Double> clk;
std::vector<Vector3d> pos, vel; // regularized marker pos in global system
std::vector<Vector3d> offset; // pos to ARF in local system
std::vector<Transform3d> global2local, local2antenna;
std::vector<Transform3d> global2local, global2antenna;
std::vector<GnssTrackPtr> tracks; // tracking phase observations
Double observationSampling;
Bool integerAmbiguities;
Expand Down Expand Up @@ -97,11 +97,11 @@ class GnssReceiver : public GnssTransceiver
/** @brief velocity in TRF or CRF [m/s]. */
Vector3d velocity(UInt idEpoch) const {return vel.at(idEpoch);}

/** @brief Rotation from terrestrial reference frame (TRF) or celestial reference frame (CRF) to local/body frame (north, east, up or vehicle system). */
/** @brief Rotation from terrestrial reference frame (TRF) or celestial reference frame (CRF) to local horizont system (north, east, up). */
Transform3d global2localFrame(UInt idEpoch) const {return global2local.at(idEpoch);}

/** @brief Rotation from local/body frame to left-handed antenna system (usually north, east, up). */
Transform3d local2antennaFrame(UInt idEpoch) const {return local2antenna.at(idEpoch);}
/** @brief Rotation from terrestrial reference frame (TRF) or celestial reference frame (CRF) to left-handed antenna system (usually north, east, up). */
Transform3d global2antennaFrame(UInt idEpoch) const {return global2antenna.at(idEpoch);}

/** @brief Transformation matrix for observed (composed) types from original transmitted types.
* E.g. C2DG = C1CG - C1WG + C2WG.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ void GnssReceiverGeneratorLowEarthOrbiter::init(const std::vector<Time> &times,
recv->vel.resize(times.size());
recv->offset.resize(times.size());
recv->global2local.resize(times.size());
recv->local2antenna.resize(times.size());
recv->global2antenna.resize(times.size());

OrbitArc orbit = InstrumentFile::read(fileNameOrbit);
StarCameraArc starCamera = InstrumentFile::read(fileNameStarCamera);
Expand All @@ -155,11 +155,11 @@ void GnssReceiverGeneratorLowEarthOrbiter::init(const std::vector<Time> &times,
continue;
}

recv->pos.at(idEpoch) = orbit.at(i).position;
recv->vel.at(idEpoch) = orbit.at(i).velocity;
recv->offset.at(idEpoch) = antenna->position - platform.referencePoint(times.at(idEpoch));
recv->global2local.at(idEpoch) = inverse(starCamera.at(i).rotary);
recv->local2antenna.at(idEpoch) = antenna->local2antennaFrame;
recv->pos.at(idEpoch) = orbit.at(i).position;
recv->vel.at(idEpoch) = orbit.at(i).velocity;
recv->global2local.at(idEpoch) = inverse(localNorthEastUp(recv->pos.at(idEpoch), Ellipsoid()));
recv->global2antenna.at(idEpoch) = antenna->local2antennaFrame * inverse(starCamera.at(i).rotary);
recv->offset.at(idEpoch) = recv->global2local.at(idEpoch).transform(starCamera.at(i).rotary.rotate(antenna->position - platform.referencePoint(times.at(idEpoch))));
idEpoch++;
}
recv->preprocessingInfo("init()");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,14 +190,14 @@ void GnssReceiverGeneratorStationNetwork::init(const std::vector<Time> &times, c
recv->vel.resize(times.size());
recv->offset.resize(times.size());
recv->global2local.resize(times.size(), inverse(localNorthEastUp(recv->platform.approxPosition, Ellipsoid())));
recv->local2antenna.resize(times.size());
recv->global2antenna.resize(times.size());
for(UInt idEpoch=0; idEpoch<times.size(); idEpoch++)
{
auto antenna = recv->platform.findEquipment<PlatformGnssAntenna>(times.at(idEpoch));
if(antenna && antenna->antennaDef && antenna->accuracyDef)
{
recv->offset.at(idEpoch) = antenna->position - recv->platform.referencePoint(times.at(idEpoch));
recv->local2antenna.at(idEpoch) = antenna->local2antennaFrame;
recv->offset.at(idEpoch) = antenna->position - recv->platform.referencePoint(times.at(idEpoch));
recv->global2antenna.at(idEpoch) = antenna->local2antennaFrame * recv->global2local.at(idEpoch);
}
else
recv->disable(idEpoch, "missing antenna/accuracy patterns");
Expand Down

0 comments on commit dca9dab

Please sign in to comment.