Skip to content
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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Rtl button #28

wants to merge 5 commits into from

Conversation

Person8790
Copy link

Implemented code for a return to launch function

Copy link
Contributor

@BalajiLeninrajan BalajiLeninrajan left a 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,
Copy link
Contributor

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});
Copy link
Contributor

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(
Copy link
Contributor

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';
Copy link
Contributor

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 {});
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants