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

Proper mag rotation handling #1772

Closed
wants to merge 15 commits into from
Closed

Proper mag rotation handling #1772

wants to merge 15 commits into from

Conversation

LorenzMeier
Copy link
Member

@DonLakeFlyer This finishes the multi-mag support properly, thanks for pointing out the earlier problems. Its not tested yet, so it'll need to wait until tomorrow morning.

@LorenzMeier
Copy link
Member Author

@DonLakeFlyer If the CAL_MAG0_ROT param exists it should be used for the mag orientation. For now I don't want to expose MAG1 and MAG2, since it will confuse users and those are likely internal.

@LorenzMeier
Copy link
Member Author

@DonLakeFlyer I think I worked this one out. I will reset the param CAL_MAG0_ROT to -1 as default if the mag is internal, and I will reset it if a GCS sets it. If its zero the mag is external. So please scan CAL_MAG0-2 and display a config pane for each one which is >= 0.

@LorenzMeier
Copy link
Member Author

@bansiesta @thomasgubler Code review would be heavily appreciated. This is a housekeeping PR addressing a bunch of small nuisances: Functionality:

  • Allow to set a mag rotation for all connected mags
  • Copy the SENS_MAG_ROT param to CAL_MAG0_ROT if CAL_MAG0_ROT is zero
  • Set CAL_MAGX_ROT to -1 if the mag is internal to allow the GCS to hide the settings box for internal mags.
  • Drive by: Fix IO update when safety off circuit breaker is set
  • Drive by: More retries when booting RGB led

This is intensely bench tested, and I think it can be merged without requiring flight tests.

@@ -23,6 +23,7 @@ set TUNE_ERR ML<<CP4CP4CP4CP4CP4
#
# Try to mount the microSD card.
#
# REBOOTWORK this needs to start after the flight control loop
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I plan to speed up in-air reboot, and these comments mark locations to be reviewed.

@@ -1542,6 +1506,39 @@ Sensors::parameter_update_poll(bool forced)
(void)sprintf(str, "CAL_MAG%u_ZSCALE", i);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is setting failed bitwise intentional?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was, but I do realize that it can look odd. I've changed to the more verbose logical or style, thanks!

@LorenzMeier
Copy link
Member Author

@bansiesta Good for another pass. I introduced param_set_no_notification because the loop setting the parameter is also responding to param sets and is the only location this param is used. It means that notifying turns it into a perpetuum mobile as its calling itself constantly. Some more context:
https://groups.google.com/forum/#!topic/px4users/VecH3KXdudA

@bansiesta
Copy link
Contributor

@LorenzMeier Ah ok thanks for the explanation. Now, how am I supposed to see your additional commits? This is just commit chaos now...

@LorenzMeier
Copy link
Member Author

That commit chaos is called rebase :-). The last 5 commits are new, but it might be easier to just run through the diff.

@bansiesta
Copy link
Contributor

Why are you rebasing now? Wouldn't it be better to rebase in the end before merging? Otherwise github gets confused (and so do I).

I want to see what you changed after the last review and I really don't want to review everything again.

@LorenzMeier
Copy link
Member Author

There is no way to bring back the Github state, sorry. I can hold off from rebasing next time until its good to merge - since it sounds there will be no further comments, I'm merging this now.

@LorenzMeier
Copy link
Member Author

Applied via rebase.

@LorenzMeier LorenzMeier deleted the magrot branch February 15, 2015 18:52
PX4BuildBot added a commit that referenced this pull request Feb 23, 2022
    - mavlink in PX4/Firmware (df3fdaa): mavlink/mavlink@4b0558d
    - mavlink current upstream: mavlink/mavlink@79e9545
    - Changes: mavlink/mavlink@4b0558d...79e9545

    79e9545a 2022-02-23 Hamish Willee - Remove external dialect doc and improve dialect pages (#1802)
fd7ccfbe 2022-02-23 Hamish Willee - MAV_PROTOCOL_CAPABILITY_FLIGHT_TERMINATION - improve linking to command (#1774)
2b7de26c 2022-02-23 Hamish Willee - [Discuss.] MAV_PROTOCOL_CAPABILITY_FTP - supports FTP protocol not specific message (#1772)
a7541658 2022-02-18 Alessandro Ros - fix common.xml include in AVSSUAS (#1800)
5b4482fe 2022-02-17 Hamish Willee - RFC 0016 - Mavlink Standard Modes - Add to development.xml
4ee1eebb 2022-02-15 Thomas-Li-AVSS - AVSS dialect version 2 (#1795)
51441f82 2022-02-16 Julian Oes - PREFLIGHT_STORAGE: use lowercase, don't shout (#1797)
4071353f 2022-02-16 Beat Küng - actuators.schema.json: add optional title and help url (#1798)
b724aab5 2022-02-16 Hamish Willee - Reinstate MAV_PROTOCOL_CAPABILITY_PARAM_UNION
PX4BuildBot added a commit that referenced this pull request Feb 24, 2022
    - mavlink in PX4/Firmware (6f90bd7): mavlink/mavlink@4b0558d
    - mavlink current upstream: mavlink/mavlink@b568a60
    - Changes: mavlink/mavlink@4b0558d...b568a60

    b568a60f 2022-02-24 Hamish Willee - Update pymavlink to latest (#1805)
b86834e0 2022-02-23 Hamish Willee - Component info - tidy descriptiosn (#1803)
79e9545a 2022-02-23 Hamish Willee - Remove external dialect doc and improve dialect pages (#1802)
fd7ccfbe 2022-02-23 Hamish Willee - MAV_PROTOCOL_CAPABILITY_FLIGHT_TERMINATION - improve linking to command (#1774)
2b7de26c 2022-02-23 Hamish Willee - [Discuss.] MAV_PROTOCOL_CAPABILITY_FTP - supports FTP protocol not specific message (#1772)
a7541658 2022-02-18 Alessandro Ros - fix common.xml include in AVSSUAS (#1800)
5b4482fe 2022-02-17 Hamish Willee - RFC 0016 - Mavlink Standard Modes - Add to development.xml
4ee1eebb 2022-02-15 Thomas-Li-AVSS - AVSS dialect version 2 (#1795)
51441f82 2022-02-16 Julian Oes - PREFLIGHT_STORAGE: use lowercase, don't shout (#1797)
4071353f 2022-02-16 Beat Küng - actuators.schema.json: add optional title and help url (#1798)
b724aab5 2022-02-16 Hamish Willee - Reinstate MAV_PROTOCOL_CAPABILITY_PARAM_UNION
PX4BuildBot added a commit that referenced this pull request Feb 26, 2022
    - mavlink in PX4/Firmware (95358ae501e92687b00d2786bc8eadf28ff93930): mavlink/mavlink@4ee1eeb
    - mavlink current upstream: mavlink/mavlink@b568a60
    - Changes: mavlink/mavlink@4ee1eeb...b568a60

    b568a60f 2022-02-24 Hamish Willee - Update pymavlink to latest (#1805)
b86834e0 2022-02-23 Hamish Willee - Component info - tidy descriptiosn (#1803)
79e9545a 2022-02-23 Hamish Willee - Remove external dialect doc and improve dialect pages (#1802)
fd7ccfbe 2022-02-23 Hamish Willee - MAV_PROTOCOL_CAPABILITY_FLIGHT_TERMINATION - improve linking to command (#1774)
2b7de26c 2022-02-23 Hamish Willee - [Discuss.] MAV_PROTOCOL_CAPABILITY_FTP - supports FTP protocol not specific message (#1772)
a7541658 2022-02-18 Alessandro Ros - fix common.xml include in AVSSUAS (#1800)
5b4482fe 2022-02-17 Hamish Willee - RFC 0016 - Mavlink Standard Modes - Add to development.xml
dagar pushed a commit that referenced this pull request Feb 26, 2022
    - mavlink in PX4/Firmware (95358ae501e92687b00d2786bc8eadf28ff93930): mavlink/mavlink@4ee1eeb
    - mavlink current upstream: mavlink/mavlink@b568a60
    - Changes: mavlink/mavlink@4ee1eeb...b568a60

    b568a60f 2022-02-24 Hamish Willee - Update pymavlink to latest (#1805)
b86834e0 2022-02-23 Hamish Willee - Component info - tidy descriptiosn (#1803)
79e9545a 2022-02-23 Hamish Willee - Remove external dialect doc and improve dialect pages (#1802)
fd7ccfbe 2022-02-23 Hamish Willee - MAV_PROTOCOL_CAPABILITY_FLIGHT_TERMINATION - improve linking to command (#1774)
2b7de26c 2022-02-23 Hamish Willee - [Discuss.] MAV_PROTOCOL_CAPABILITY_FTP - supports FTP protocol not specific message (#1772)
a7541658 2022-02-18 Alessandro Ros - fix common.xml include in AVSSUAS (#1800)
5b4482fe 2022-02-17 Hamish Willee - RFC 0016 - Mavlink Standard Modes - Add to development.xml
junwoo091400 pushed a commit to junwoo091400/PX4-Autopilot that referenced this pull request Mar 17, 2022
    - mavlink in PX4/Firmware (95358ae501e92687b00d2786bc8eadf28ff93930): mavlink/mavlink@4ee1eeb
    - mavlink current upstream: mavlink/mavlink@b568a60
    - Changes: mavlink/mavlink@4ee1eeb...b568a60

    b568a60f 2022-02-24 Hamish Willee - Update pymavlink to latest (PX4#1805)
b86834e0 2022-02-23 Hamish Willee - Component info - tidy descriptiosn (PX4#1803)
79e9545a 2022-02-23 Hamish Willee - Remove external dialect doc and improve dialect pages (PX4#1802)
fd7ccfbe 2022-02-23 Hamish Willee - MAV_PROTOCOL_CAPABILITY_FLIGHT_TERMINATION - improve linking to command (PX4#1774)
2b7de26c 2022-02-23 Hamish Willee - [Discuss.] MAV_PROTOCOL_CAPABILITY_FTP - supports FTP protocol not specific message (PX4#1772)
a7541658 2022-02-18 Alessandro Ros - fix common.xml include in AVSSUAS (PX4#1800)
5b4482fe 2022-02-17 Hamish Willee - RFC 0016 - Mavlink Standard Modes - Add to development.xml
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.

None yet

2 participants