-
Notifications
You must be signed in to change notification settings - Fork 4k
RC PWM joystick buttons override #10431
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
base: master
Are you sure you want to change the base?
Conversation
785f4db
to
4227fe3
Compare
@zdanek : This breaks the regression? |
4227fe3
to
1db81b9
Compare
@fredowski fixed all issues with compiling and build |
I ran this version of QGroundControl with a Pixhawk 5x and Pixhawk 6c. Very useful feature for our confetti cannon trigger! |
OMG @marshallwicker thank you for your support. Is there any chance to see a video with this cannon? :D |
Can you provide a little bit more info on how you tested? Hardware (CubeOrange / Pixhawk4 for example) and software (Ardupilot / PX4 and release version). I have some feedback I will leave a review but would like to be able to test as well I'm at it. Thanks for the contribution this seems like a really useful feature. |
QGCTextField { | ||
width: ScreenTools.defaultFontPixelWidth * 10 | ||
implicitHeight: ScreenTools.implicitTextFieldHeight | ||
visible: true | ||
validator: IntValidator { bottom:1000; top: 2000} | ||
|
||
Component.onCompleted: { | ||
if(_activeJoystick) { | ||
text = parent._getButtonPwm(modelData, true) | ||
} | ||
} | ||
onEditingFinished: parent._setButtonPwm(modelData, true, text) |
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 text field needs to update when the channel selection changes. For example if you set it up for Channel 10, and then use the drop down to select Channel 11, the PWM values in "low" and "high" will not get applied but they still show up in the text fields. These text fields should reset to 0 when the channel selection changes.
I totally would, but it was just a proof of concept test on the bench to see if it would trigger our PWM switch (basically a pwm controlled relay). If I can find another confetti cannon, I’ll record it! |
I tested on the Holybro Pixhawk 5x and Holybro Pixhawk 6c using PX4-Autopilot. I only tested one channel though! I will test further tomorrow. |
src/Joystick/Joystick.cc
Outdated
_assignableButtonActions.append(new AssignableButtonAction(this, _buttonActionEmergencyStop)); | ||
|
||
// TODO(bzd) take channel nos from config, especially max | ||
for (int ch = 8; ch <= 16;ch++) { |
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.
for (int ch = 8; ch <= 16;ch++) { | |
for (int ch = 9; ch <= 16;ch++) { |
Channels 1-8 are PWM MAIN
Stupid question from me as I haven't used newer PX4 in a long time. I just got a Pixhawk 5X and am using PX4 1.13. I can enable FMU OUT channel 3 (PWM AUX 3) via QGC Actuators menu and control them via slider no problem, but this button feature isn't working. I have pre-arm mode set to always and I have even tested while armed with no success. I do see uORB |
I’m not sure, but I’ll check again tomorrow to see if I did anything out off the ordinary. I am building PX4 from master locally, but I haven’t changed my submodule for Mavlink, so I can’t see why that would be an issue. |
@dakejahl I'm not sure is this related. The mechanism behind my feature it to use RC Override mavlink command to override RC channel value. I'm not sure how AUX channels work since I have only Pixhawk with Ardupilot. Thank you. |
After thinking about this further, this does feel like a bit of a workaround. Instead of directly assigning the outputs of the flight controller to a PWM output, I think we should find a way to map it to an actuator output (RC AUX 1-6) so it can be configured in the actuator menu. The computer joystick should be configured similar to an RC controller where the buttons become analog outputs and can be assigned to an RC AUX output. |
Also after further review, I have discovered that it wasn't functioning on PX4. RC_OVERRIDE commands are only in ardupilot. |
So it seems PX4 does not implement Mavlink standard message # 70 @marshallwicker I don't know PX4. Can you tell me is there any other mechanism I could use to pass (override) RC channel values? |
It looks like MAV_CMD_DO_SET_SERVO will accomplish the same thing in Ardupilot. It is also not implemented in PX4. In fact I don't think there is any way in PX4 to allow the GCS to set an actuator output value outside of MAV_CMD_ACTUATOR_TEST |
@junwoo091400 your input on this PR would be appreciated. I think this feature is useful but we need to find a way for it to work "properly" in both Ardupilot and PX4. Ardupilot does not have any of the ACTUATOR messages/commands in their mavlink fork and PX4 does not currently support setting servo endpoints (by any means) from the GCS using a Joystick. |
76fa87e
to
e662fe9
Compare
cbc49b4
to
fd44d8a
Compare
fd44d8a
to
4e1bc81
Compare
Base changes to enable building and running QGC custom builds. QT build script are sufficient to run custom build but CMake scripts totally ignore all custom changes. There's lot of work to be done in matter of resources which I did not address at all in this commit.
Fix PWM input fields update
4e1bc81
to
30dafd5
Compare
What's the state of this? Still doesn't seem to be ready. |
I did not push latest changes. I can rework this to Qt6 and in case of Ardupilot it's ready. For PX4 someone who knows it, should propose own solution, probably based on actuators or sth. But for Ardupilot it works nicely on real drones, as we're using it. |
This has gotten super stale. I'm cleaning up stale Pulls for the 5.0 release. If nobody is working on this any more I"m gonna close it. |
Apologies for barging in - I've landed here while trying to migrate our operation to QGC from MP. I'm learning QGC seems to lack support for Joystick buttons to servo functions. I see zdanek above has done some work here. I'm casting a vote that it's a really useful feature for those of us flying large ICE trad helis on Arducopter. So far, this limitation is the only thing preventing my move and I think my customers would prefer QGC UI. |
You could post a bounty in the PX4 discord bounty channel to see if that would help anyone else picking this up. |
@InnovativeUAVs thanks for the vote. No one was interested in this feature. This works well in our fork. We tested it with a few drones used for SAR missions on military training ground. With PS3 / Xbox game pad works nice - steering drone and camera gimbal, issuing many different commands with buttons. Some buttons steer same channel, one button for low value if pressed, other for high and idle as 1500. IMO I would not reject cool functionalities just because PX4 doesn't have some features yet. I would also make a demand for those in autopilot. |
This PR realizes #10430
Adds sending PWM values on Joystick press and release. Very useful.
Review would be appreciated :)