-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
35d9b1b
commit 2bf2140
Showing
5 changed files
with
60 additions
and
52 deletions.
There are no files selected for viewing
52 changes: 23 additions & 29 deletions
52
flutter_app/lib/command_constructors/return_to_launch_constructor.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,37 @@ | ||
import 'package:dart_mavlink/dialects/common.dart'; | ||
import 'package:dart_mavlink/mavlink.dart'; | ||
|
||
/// Constructs a MissionItem command to return to launch using MAV_CMD_NAV_RETURN_TO_LAUNCH (20). | ||
/// | ||
/// @sequence The sequence number for the MAVLink frame. | ||
/// @systemId The MAVLink system ID of the vehicle (normally "1"). | ||
/// @componentId The MAVLink component ID (normally "0"). | ||
/// @latitude The latitude of the launchpad (Defaults to where it was armed). | ||
/// @longitude The longitude of the launchpad (Defaults to where it was armed). | ||
/// @altitude The altitude of the waypoint (Defaults to 15m) | ||
/// @param1 Unused | ||
/// @param2 Unused | ||
/// @param3 Unused | ||
/// @param4 Unused | ||
/// @param5 Unused | ||
/// @param6 Unused | ||
/// @param7 Unused | ||
/// | ||
/// @return A MissionItem representing the reutrn to launch command. | ||
/// @return A MavlinkFrame representing the reutrn to launch command. | ||
MissionItem returnToLaunch(int sequence, int systemID, int componentID, | ||
{double latitude = 0.0, | ||
double longitude = 0.0, | ||
double altitude = 15.0, | ||
double param1 = 0, | ||
double param2 = 0, | ||
double param3 = 0, | ||
double param4 = 0}) { | ||
var missionItem = MissionItem( | ||
targetSystem: systemID, | ||
targetComponent: componentID, | ||
seq: sequence, | ||
frame: mavFrameGlobalRelativeAlt, | ||
command: mavCmdNavReturnToLaunch, | ||
current: 1, | ||
autocontinue: 1, | ||
param1: param1, | ||
param2: param2, | ||
param3: param3, | ||
param4: param4, | ||
x: latitude, | ||
y: longitude, | ||
z: altitude, | ||
missionType: 0); | ||
return missionItem; | ||
MavlinkFrame returnToLaunch(int sequence, int systemID, int componentID) { | ||
var commandLong = CommandLong( | ||
targetSystem: systemID, | ||
targetComponent: componentID, | ||
command: mavCmdNavReturnToLaunch, | ||
confirmation: 0, | ||
param1: 0, | ||
param2: 0, | ||
param3: 0, | ||
param4: 0, | ||
param5: 0, | ||
param6: 0, | ||
param7: 0, | ||
); | ||
|
||
var frm = MavlinkFrame.v2(sequence, systemID, componentID, commandLong); | ||
|
||
return frm; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters