-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rtl button #28
base: main
Are you sure you want to change the base?
Rtl button #28
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So far so good! You need to rewrite some stuff, look at the implementation of the mode changer, that is the widget that's most similar to yours
/// | ||
/// @return A MissionItem representing the reutrn to launch command. | ||
|
||
MissionItem returnToLaunch(int sequence, int systemID, int componentID, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I didn't read the docs when I approved this. You need to use a Command Long for this, check set_mode_constructor.dart, that should be similar.
final MissionItem returnToLaunchConstructor; | ||
|
||
// Requires both the constructor (Mission Item) and comm | ||
ReturnToLaunch({required this.comm, required this.returnToLaunchConstructor}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can call the command constructor within the module (look at change_drone_mode for an example)
await comm.tcpSocketInitializationFlag.future; | ||
} | ||
|
||
var frame = MavlinkFrame.v2( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part should be done in the command constructor
@@ -0,0 +1,40 @@ | |||
import 'package:dart_mavlink/dialects/common.dart'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
expect(find.text("Return To Launch"), findsOneWidget); | ||
}); | ||
|
||
testWidgets("Button sends MavLink command", (WidgetTester tester) async {}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you need help with this test lmk
Implemented code for a return to launch function