Actually we have no way of knowing if what I call the "primary speed" (lack
of better term) is airspeed, groundspeed or something else. UASs without
airspeed meter use the ground speed for airspeed where needed. Oki I will
make another signal.


On Mon, Jun 3, 2013 at 5:44 PM, Lorenz Meier <notifications@github.com>wrote:

> In src/uas/UAS.cc:
>
> >              emit globalPositionChanged(this, getLatitude(), getLongitude(), getAltitude(), time);
> > -            emit speedChanged(this, speedX, speedY, speedZ, time);
> > +            // dongfang: The altitude is GPS altitude. Bugger. It needs to be changed to primary.
> > +            emit altitudeChanged(this, GPS_ALTITUDE, getAltitude(), time);
> > +            // We had some frame mess here, global and local axes were mixed.
> > +            emit velocityChanged(this, MAV_FRAME_GLOBAL, speedX, speedY, speedZ, time);
> > +
> > +            double groundspeed = qSqrt(speedX*speedX+speedY*speedY);
> > +            emit speedChanged(this, GROUNDSPEED_BY_GPS, groundspeed, time);
>
> This design pattern is suboptimal as it forces code duplication (and
> consequently aging): It forces every subscriber to have a switch statement
> handling the different signal sources, even if the subscriber just cares
> about one source. A better (and simpler) approach is to create a
> gpsSpeedChanged() signal.
>
> Also note that ground speed and air speed are fundamentally two different
> things, and are physically not related, so its conceptional also not
> optimal.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/mavlink/qgroundcontrol/pull/265/files#r4502436>
> .
>