Example #1
0
 public MissionClient(IMavlinkV2Connection mavlink, IPacketSequenceCalculator seq,
                      MavlinkClientIdentity identity, MissionClientConfig config)
 {
     _mavlink  = mavlink ?? throw new ArgumentNullException(nameof(mavlink));
     _seq      = seq ?? throw new ArgumentNullException(nameof(seq));
     _identity = identity ?? throw new ArgumentNullException(nameof(identity));
     _config   = config;
 }
Example #2
0
 public MissionClient(IMavlinkV2Connection mavlink, MavlinkClientIdentity identity, IPacketSequenceCalculator seq, MissionClientConfig config) : base(mavlink, identity, seq, "MISSION")
 {
     _config         = config;
     _missionCurrent = new RxValue <ushort>().DisposeItWith(Disposable);
     _missionReached = new RxValue <ushort>().DisposeItWith(Disposable);
     mavlink.FilterVehicle(identity).Filter <MissionCurrentPacket>().Select(_ => _.Payload.Seq).Subscribe(_missionCurrent)
     .DisposeItWith(Disposable);
     mavlink.FilterVehicle(identity).Filter <MissionItemReachedPacket>().Select(_ => _.Payload.Seq).Subscribe(_missionReached)
     .DisposeItWith(Disposable);
 }