C# Class MissionPlanner.MAVLinkInterface

Inheritance: MAVLink, IDisposable
Afficher le fichier Open project: ArduPilot/MissionPlanner Class Usage Examples

Méthodes publiques

Свойство Type Description
CONNECT_TIMEOUT_SECONDS double
MAVlist MAVList
ReadOnly bool
Terrain MissionPlanner.Utilities.TerrainFollow
speechenabled bool

Private Properties

Свойство Type Description
FrmProgressReporterDoWorkAndParams void
FrmProgressReporterDoWorkNOParams void
FrmProgressReporterGetParams void
OpenBg void
PacketReceived void
SetupMavConnect void
doAction bool
generatePacket void
generatePacket void
generatePacket void
getDatastream void
getDatastream void
getParamListBG System.Collections.Hashtable
getWPsfromstream void
hzratecheck bool
readlogPacketMavlink MAVLinkMessage

Méthodes publiques

Méthode Description
Close ( ) : void
DebugPacket ( MAVLinkMessage datin ) : object
DebugPacket ( MAVLinkMessage datin, bool PrintToConsole ) : object
DebugPacket ( MAVLinkMessage datin, string &text ) : object
DebugPacket ( MAVLinkMessage datin, string &text, bool PrintToConsole, string delimeter = " " ) : object

Print entire decoded packet to console

Dispose ( ) : void
EraseLog ( ) : void
GetLog ( ushort no ) : FileStream
GetLogEntry ( ushort startno, ushort endno = ushort.MaxValue ) : mavlink_log_entry_t
GetLogList ( ) : List
GetMountStatus ( ) : void
GetParam ( byte sysid, byte compid, string name = "", short index = -1, bool requireresponce = true ) : float

Get param by either index or name

GetParam ( short index ) : float
GetParam ( string name ) : float
GetParam ( string name = "", short index = -1, bool requireresponce = true ) : float
InjectGpsData ( byte data, byte length ) : void
InjectGpsData ( byte sysid, byte compid, byte data, byte length, bool rtcm_message = true ) : void

used to inject data into the gps ie rtcm/sbp/ubx

MAVLinkInterface ( ) : System
MAVLinkInterface ( Stream logfileStream ) : System
Open ( ) : void
Open ( bool getparams, bool skipconnectedcheck = false ) : void
SendAck ( ) : void
SendSerialControl ( SERIAL_CONTROL_DEV port, ushort timeoutms, byte data, uint baudrate, bool close = false ) : void
SetSensorOffsets ( sensoroffsetsenum sensor, float x, float y, float z ) : bool
SubscribeToPacketType ( MAVLINK_MSG_ID type, bool>.Func function, bool exclusive = false ) : KeyValuePair>
ToString ( ) : string
UnSubscribeToPacketType ( bool>.KeyValuePair item ) : void
UnSubscribeToPacketType ( MAVLINK_MSG_ID msgtype, bool>.Func item ) : void
Write ( string line ) : bool
disableSigning ( int sysid, int compid ) : bool
doARM ( bool armit ) : bool
doARM ( byte sysid, byte compid, bool armit ) : bool
doAbortLand ( ) : bool
doCommand ( MAV_CMD actionid, float p1, float p2, float p3, float p4, float p5, float p6, float p7, bool requireack = true ) : bool
doCommand ( byte sysid, byte compid, MAV_CMD actionid, float p1, float p2, float p3, float p4, float p5, float p6, float p7, bool requireack = true ) : bool
doMotorTest ( int motor, MAVLink thr_type, int throttle, int timeout, int motorcount ) : bool
doReboot ( bool bootloadermode = false, bool currentvehicle = true ) : bool

reboot the vehicle

enableSigning ( int sysid, int compid ) : bool
getFencePoint ( int no, int &total ) : MissionPlanner.Utilities.PointLatLngAlt
getHeartBeat ( ) : MAVLinkMessage
getHomePosition ( ) : Locationwp
getParamList ( ) : void
getParamPoll ( ) : void
getRallyPoint ( int no, int &total ) : MissionPlanner.Utilities.PointLatLngAlt
getRallyPoints ( ) : List
getRequestedWPNo ( ) : int
getVersion ( ) : bool
getWP ( ushort index ) : Locationwp

Gets specfied WP

getWPCount ( ) : ushort

Returns WP count

modifyParamForDisplay ( bool fromapm, string paramname, float &value ) : void
readPacket ( ) : MAVLinkMessage

Serial Reader to read mavlink packets. POLL method

requestDatastream ( MAVLink id, byte hzrate, int sysid = -1, int compid = -1 ) : void
sendPacket ( object indata, int sysid, int compid ) : void
setAPType ( byte sysid, byte compid ) : void
setAttitudeTarget ( ) : void
setDigicamConfigure ( ) : void
setDigicamControl ( bool shot ) : void
setFencePoint ( byte index, PointLatLngAlt plla, byte fencepointcount ) : bool
setGuidedModeWP ( Locationwp gotohere, bool setguidedmode = true ) : void
setMode ( byte sysid, byte compid, mavlink_set_mode_t mode, MAV_MODE_FLAG base_mode ) : void
setMode ( byte sysid, byte compid, string modein ) : void
setMode ( mavlink_set_mode_t mode, MAV_MODE_FLAG base_mode ) : void
setMode ( string modein ) : void
setMountConfigure ( MAV_MOUNT_MODE mountmode, bool stabroll, bool stabpitch, bool stabyaw ) : void
setMountControl ( double pa, double pb, double pc, bool islatlng ) : void
setNewWPAlt ( Locationwp gotohere ) : void
setNextWPTargetAlt ( ushort wpno, float alt ) : void
setParam ( byte sysid, byte compid, string paramname, double value, bool force = false ) : bool

Set parameter on apm

setParam ( string paramnames, double value ) : bool

set param on apm, used for param rename

setParam ( string paramname, double value, bool force = false ) : bool
setPositionTargetGlobalInt ( byte sysid, byte compid, bool pos, bool vel, bool acc, MAV_FRAME frame, double lat, double lng, double alt, double vx, double vy, double vz ) : void
setRallyPoint ( byte index, PointLatLngAlt plla, short break_alt, UInt16 land_dir_cd, byte flags, byte rallypointcount ) : bool
setWP ( Locationwp loc, ushort index, MAV_FRAME frame, byte current, byte autocontinue = 1, bool use_int = false ) : MAV_MISSION_RESULT

Save wp to eeprom

setWP ( mavlink_mission_item_int_t req ) : MAV_MISSION_RESULT
setWP ( mavlink_mission_item_t req ) : MAV_MISSION_RESULT
setWPACK ( ) : void
setWPCurrent ( ushort index ) : bool
setWPPartialUpdate ( ushort startwp, ushort endwp ) : void

Set start and finish for partial wp upload.

setWPTotal ( ushort wp_total ) : void

Sets wp total count

setupSigning ( string userseed, byte key = null ) : bool
stopall ( bool forget ) : void

Stops all requested data packets.

translateMode ( byte sysid, byte compid, string modein, MAVLink &mode ) : bool
translateMode ( string modein, MAVLink &mode ) : bool

Private Methods

Méthode Description
FrmProgressReporterDoWorkAndParams ( object sender, MissionPlanner.Controls.ProgressWorkerEventArgs e, object passdata = null ) : void
FrmProgressReporterDoWorkNOParams ( object sender, MissionPlanner.Controls.ProgressWorkerEventArgs e, object passdata = null ) : void
FrmProgressReporterGetParams ( object sender, MissionPlanner.Controls.ProgressWorkerEventArgs e, object passdata = null ) : void
OpenBg ( object PRsender, bool getparams, MissionPlanner.Controls.ProgressWorkerEventArgs progressWorkerEventArgs ) : void
PacketReceived ( MAVLinkMessage buffer ) : void
SetupMavConnect ( MAVLinkMessage message, mavlink_heartbeat_t hb ) : void
doAction ( object actionid ) : bool
generatePacket ( MAVLINK_MSG_ID messageType, object indata ) : void
generatePacket ( int messageType, object indata ) : void
generatePacket ( int messageType, object indata, int sysid, int compid, bool forcemavlink2 = false, bool forcesigning = false ) : void

Generate a Mavlink Packet and write to serial

getDatastream ( MAVLink id, byte hzrate ) : void
getDatastream ( byte sysid, byte compid, MAVLink id, byte hzrate ) : void
getParamListBG ( ) : Hashtable

Get param list from apm

getWPsfromstream ( MAVLinkMessage &buffer, byte sysid, byte compid ) : void

Used to extract mission from log file - both sent or received

hzratecheck ( double pps, int hzrate ) : bool
readlogPacketMavlink ( ) : MAVLinkMessage

Method Details

Close() public méthode

public Close ( ) : void
Résultat void

DebugPacket() public méthode

public DebugPacket ( MAVLinkMessage datin ) : object
datin MAVLinkMessage
Résultat object

DebugPacket() public méthode

public DebugPacket ( MAVLinkMessage datin, bool PrintToConsole ) : object
datin MAVLinkMessage
PrintToConsole bool
Résultat object

DebugPacket() public méthode

public DebugPacket ( MAVLinkMessage datin, string &text ) : object
datin MAVLinkMessage
text string
Résultat object

DebugPacket() public méthode

Print entire decoded packet to console
public DebugPacket ( MAVLinkMessage datin, string &text, bool PrintToConsole, string delimeter = " " ) : object
datin MAVLinkMessage packet byte array
text string
PrintToConsole bool
delimeter string
Résultat object

Dispose() public méthode

public Dispose ( ) : void
Résultat void

EraseLog() public méthode

public EraseLog ( ) : void
Résultat void

GetLog() public méthode

public GetLog ( ushort no ) : FileStream
no ushort
Résultat System.IO.FileStream

GetLogEntry() public méthode

public GetLogEntry ( ushort startno, ushort endno = ushort.MaxValue ) : mavlink_log_entry_t
startno ushort
endno ushort
Résultat mavlink_log_entry_t

GetLogList() public méthode

public GetLogList ( ) : List
Résultat List

GetMountStatus() public méthode

public GetMountStatus ( ) : void
Résultat void

GetParam() public méthode

Get param by either index or name
public GetParam ( byte sysid, byte compid, string name = "", short index = -1, bool requireresponce = true ) : float
sysid byte
compid byte
name string
index short
requireresponce bool
Résultat float

GetParam() public méthode

public GetParam ( short index ) : float
index short
Résultat float

GetParam() public méthode

public GetParam ( string name ) : float
name string
Résultat float

GetParam() public méthode

public GetParam ( string name = "", short index = -1, bool requireresponce = true ) : float
name string
index short
requireresponce bool
Résultat float

InjectGpsData() public méthode

public InjectGpsData ( byte data, byte length ) : void
data byte
length byte
Résultat void

InjectGpsData() public méthode

used to inject data into the gps ie rtcm/sbp/ubx
public InjectGpsData ( byte sysid, byte compid, byte data, byte length, bool rtcm_message = true ) : void
sysid byte
compid byte
data byte
length byte
rtcm_message bool
Résultat void

MAVLinkInterface() public méthode

public MAVLinkInterface ( ) : System
Résultat System

MAVLinkInterface() public méthode

public MAVLinkInterface ( Stream logfileStream ) : System
logfileStream Stream
Résultat System

Open() public méthode

public Open ( ) : void
Résultat void

Open() public méthode

public Open ( bool getparams, bool skipconnectedcheck = false ) : void
getparams bool
skipconnectedcheck bool
Résultat void

SendAck() public méthode

public SendAck ( ) : void
Résultat void

SendSerialControl() public méthode

public SendSerialControl ( SERIAL_CONTROL_DEV port, ushort timeoutms, byte data, uint baudrate, bool close = false ) : void
port SERIAL_CONTROL_DEV
timeoutms ushort
data byte
baudrate uint
close bool
Résultat void

SetSensorOffsets() public méthode

public SetSensorOffsets ( sensoroffsetsenum sensor, float x, float y, float z ) : bool
sensor sensoroffsetsenum
x float
y float
z float
Résultat bool

SubscribeToPacketType() public méthode

public SubscribeToPacketType ( MAVLINK_MSG_ID type, bool>.Func function, bool exclusive = false ) : KeyValuePair>
type MAVLINK_MSG_ID
function bool>.Func
exclusive bool
Résultat KeyValuePair>

ToString() public méthode

public ToString ( ) : string
Résultat string

UnSubscribeToPacketType() public méthode

public UnSubscribeToPacketType ( bool>.KeyValuePair item ) : void
item bool>.KeyValuePair
Résultat void

UnSubscribeToPacketType() public méthode

public UnSubscribeToPacketType ( MAVLINK_MSG_ID msgtype, bool>.Func item ) : void
msgtype MAVLINK_MSG_ID
item bool>.Func
Résultat void

Write() public méthode

public Write ( string line ) : bool
line string
Résultat bool

disableSigning() public méthode

public disableSigning ( int sysid, int compid ) : bool
sysid int
compid int
Résultat bool

doARM() public méthode

public doARM ( bool armit ) : bool
armit bool
Résultat bool

doARM() public méthode

public doARM ( byte sysid, byte compid, bool armit ) : bool
sysid byte
compid byte
armit bool
Résultat bool

doAbortLand() public méthode

public doAbortLand ( ) : bool
Résultat bool

doCommand() public méthode

public doCommand ( MAV_CMD actionid, float p1, float p2, float p3, float p4, float p5, float p6, float p7, bool requireack = true ) : bool
actionid MAV_CMD
p1 float
p2 float
p3 float
p4 float
p5 float
p6 float
p7 float
requireack bool
Résultat bool

doCommand() public méthode

public doCommand ( byte sysid, byte compid, MAV_CMD actionid, float p1, float p2, float p3, float p4, float p5, float p6, float p7, bool requireack = true ) : bool
sysid byte
compid byte
actionid MAV_CMD
p1 float
p2 float
p3 float
p4 float
p5 float
p6 float
p7 float
requireack bool
Résultat bool

doMotorTest() public méthode

public doMotorTest ( int motor, MAVLink thr_type, int throttle, int timeout, int motorcount ) : bool
motor int
thr_type MAVLink
throttle int
timeout int
motorcount int
Résultat bool

doReboot() public méthode

reboot the vehicle
public doReboot ( bool bootloadermode = false, bool currentvehicle = true ) : bool
bootloadermode bool reboot into bootloader mode?
currentvehicle bool use current sysid/compid or scan for it
Résultat bool

enableSigning() public méthode

public enableSigning ( int sysid, int compid ) : bool
sysid int
compid int
Résultat bool

getFencePoint() public méthode

public getFencePoint ( int no, int &total ) : MissionPlanner.Utilities.PointLatLngAlt
no int
total int
Résultat MissionPlanner.Utilities.PointLatLngAlt

getHeartBeat() public méthode

public getHeartBeat ( ) : MAVLinkMessage
Résultat MAVLinkMessage

getHomePosition() public méthode

public getHomePosition ( ) : Locationwp
Résultat MissionPlanner.Utilities.Locationwp

getParamList() public méthode

public getParamList ( ) : void
Résultat void

getParamPoll() public méthode

public getParamPoll ( ) : void
Résultat void

getRallyPoint() public méthode

public getRallyPoint ( int no, int &total ) : MissionPlanner.Utilities.PointLatLngAlt
no int
total int
Résultat MissionPlanner.Utilities.PointLatLngAlt

getRallyPoints() public méthode

public getRallyPoints ( ) : List
Résultat List

getRequestedWPNo() public méthode

public getRequestedWPNo ( ) : int
Résultat int

getVersion() public méthode

public getVersion ( ) : bool
Résultat bool

getWP() public méthode

Gets specfied WP
public getWP ( ushort index ) : Locationwp
index ushort
Résultat MissionPlanner.Utilities.Locationwp

getWPCount() public méthode

Returns WP count
public getWPCount ( ) : ushort
Résultat ushort

modifyParamForDisplay() public static méthode

public static modifyParamForDisplay ( bool fromapm, string paramname, float &value ) : void
fromapm bool
paramname string
value float
Résultat void

readPacket() public méthode

Serial Reader to read mavlink packets. POLL method
public readPacket ( ) : MAVLinkMessage
Résultat MAVLinkMessage

requestDatastream() public méthode

public requestDatastream ( MAVLink id, byte hzrate, int sysid = -1, int compid = -1 ) : void
id MAVLink
hzrate byte
sysid int
compid int
Résultat void

sendPacket() public méthode

public sendPacket ( object indata, int sysid, int compid ) : void
indata object
sysid int
compid int
Résultat void

setAPType() public méthode

public setAPType ( byte sysid, byte compid ) : void
sysid byte
compid byte
Résultat void

setAttitudeTarget() public méthode

public setAttitudeTarget ( ) : void
Résultat void

setDigicamConfigure() public méthode

public setDigicamConfigure ( ) : void
Résultat void

setDigicamControl() public méthode

public setDigicamControl ( bool shot ) : void
shot bool
Résultat void

setFencePoint() public méthode

public setFencePoint ( byte index, PointLatLngAlt plla, byte fencepointcount ) : bool
index byte
plla PointLatLngAlt
fencepointcount byte
Résultat bool

setGuidedModeWP() public méthode

public setGuidedModeWP ( Locationwp gotohere, bool setguidedmode = true ) : void
gotohere Locationwp
setguidedmode bool
Résultat void

setMode() public méthode

public setMode ( byte sysid, byte compid, mavlink_set_mode_t mode, MAV_MODE_FLAG base_mode ) : void
sysid byte
compid byte
mode mavlink_set_mode_t
base_mode MAV_MODE_FLAG
Résultat void

setMode() public méthode

public setMode ( byte sysid, byte compid, string modein ) : void
sysid byte
compid byte
modein string
Résultat void

setMode() public méthode

public setMode ( mavlink_set_mode_t mode, MAV_MODE_FLAG base_mode ) : void
mode mavlink_set_mode_t
base_mode MAV_MODE_FLAG
Résultat void

setMode() public méthode

public setMode ( string modein ) : void
modein string
Résultat void

setMountConfigure() public méthode

public setMountConfigure ( MAV_MOUNT_MODE mountmode, bool stabroll, bool stabpitch, bool stabyaw ) : void
mountmode MAV_MOUNT_MODE
stabroll bool
stabpitch bool
stabyaw bool
Résultat void

setMountControl() public méthode

public setMountControl ( double pa, double pb, double pc, bool islatlng ) : void
pa double
pb double
pc double
islatlng bool
Résultat void

setNewWPAlt() public méthode

public setNewWPAlt ( Locationwp gotohere ) : void
gotohere Locationwp
Résultat void

setNextWPTargetAlt() public méthode

public setNextWPTargetAlt ( ushort wpno, float alt ) : void
wpno ushort
alt float
Résultat void

setParam() public méthode

Set parameter on apm
public setParam ( byte sysid, byte compid, string paramname, double value, bool force = false ) : bool
sysid byte
compid byte
paramname string name as a string
value double
force bool
Résultat bool

setParam() public méthode

set param on apm, used for param rename
public setParam ( string paramnames, double value ) : bool
paramnames string
value double
Résultat bool

setParam() public méthode

public setParam ( string paramname, double value, bool force = false ) : bool
paramname string
value double
force bool
Résultat bool

setPositionTargetGlobalInt() public méthode

public setPositionTargetGlobalInt ( byte sysid, byte compid, bool pos, bool vel, bool acc, MAV_FRAME frame, double lat, double lng, double alt, double vx, double vy, double vz ) : void
sysid byte
compid byte
pos bool
vel bool
acc bool
frame MAV_FRAME
lat double
lng double
alt double
vx double
vy double
vz double
Résultat void

setRallyPoint() public méthode

public setRallyPoint ( byte index, PointLatLngAlt plla, short break_alt, UInt16 land_dir_cd, byte flags, byte rallypointcount ) : bool
index byte
plla PointLatLngAlt
break_alt short
land_dir_cd UInt16
flags byte
rallypointcount byte
Résultat bool

setWP() public méthode

Save wp to eeprom
public setWP ( Locationwp loc, ushort index, MAV_FRAME frame, byte current, byte autocontinue = 1, bool use_int = false ) : MAV_MISSION_RESULT
loc Locationwp location struct
index ushort wp no
frame MAV_FRAME global or relative
current byte 0 = no , 2 = guided mode
autocontinue byte
use_int bool
Résultat MAV_MISSION_RESULT

setWP() public méthode

public setWP ( mavlink_mission_item_int_t req ) : MAV_MISSION_RESULT
req mavlink_mission_item_int_t
Résultat MAV_MISSION_RESULT

setWP() public méthode

public setWP ( mavlink_mission_item_t req ) : MAV_MISSION_RESULT
req mavlink_mission_item_t
Résultat MAV_MISSION_RESULT

setWPACK() public méthode

public setWPACK ( ) : void
Résultat void

setWPCurrent() public méthode

public setWPCurrent ( ushort index ) : bool
index ushort
Résultat bool

setWPPartialUpdate() public méthode

Set start and finish for partial wp upload.
public setWPPartialUpdate ( ushort startwp, ushort endwp ) : void
startwp ushort
endwp ushort
Résultat void

setWPTotal() public méthode

Sets wp total count
public setWPTotal ( ushort wp_total ) : void
wp_total ushort
Résultat void

setupSigning() public méthode

public setupSigning ( string userseed, byte key = null ) : bool
userseed string
key byte
Résultat bool

stopall() public méthode

Stops all requested data packets.
public stopall ( bool forget ) : void
forget bool
Résultat void

translateMode() public méthode

public translateMode ( byte sysid, byte compid, string modein, MAVLink &mode ) : bool
sysid byte
compid byte
modein string
mode MAVLink
Résultat bool

translateMode() public méthode

public translateMode ( string modein, MAVLink &mode ) : bool
modein string
mode MAVLink
Résultat bool

Property Details

CONNECT_TIMEOUT_SECONDS public_oe property

public double CONNECT_TIMEOUT_SECONDS
Résultat double

MAVlist public_oe property

public MAVList MAVlist
Résultat MAVList

ReadOnly public_oe property

public bool ReadOnly
Résultat bool

Terrain public_oe property

public TerrainFollow,MissionPlanner.Utilities Terrain
Résultat MissionPlanner.Utilities.TerrainFollow

speechenabled public_oe property

used to disable all speech originating from this module
public bool speechenabled
Résultat bool