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

Accomplish requisite work to close out PR #11431. #12507

Closed
wants to merge 1 commit into from

Conversation

mcsauder
Copy link
Contributor

Describe problem solved by the proposed pull request
This PR simplifies the diff in PR #11431, although it might produce a few merge conflicts for @catch-twenty-two to resolve (apologies). The changes proposed in this PR include alphabetizing #includes and stubbing out method declarations.

This PR is aimed at advancing/closing out PR #11431.

Additional context
See PR #11431.

@mhkabir
Copy link
Member

mhkabir commented Jul 18, 2019

@mcsauder Can you just pull the entirety of #11431 into here so that we can merge the complete feature in one go?

@julianoes
Copy link
Contributor

@mcsauder I'd suggest that you request review from someone appropriate, otherwise I'm not sure how this should proceed.

@mcsauder mcsauder changed the title Accomplish some requisite work to close out PR #11431. Accomplish requisite work to close out PR #11431. Jul 19, 2019
@mcsauder mcsauder requested a review from bkueng July 19, 2019 04:42
@mcsauder mcsauder force-pushed the advance_pr_11431 branch 3 times, most recently from 71a8afb to abcdbc2 Compare July 25, 2019 22:52
@mcsauder mcsauder force-pushed the advance_pr_11431 branch 4 times, most recently from 683eeae to 5900c06 Compare August 7, 2019 21:44
@mcsauder
Copy link
Contributor Author

If this doesn't break anything, let's just add it and deal with any repercussions after we discover an issue!

@mcsauder
Copy link
Contributor Author

@dagar, this is pretty low risk, any concerns I can address?

mavlink_play_tune_t tune_msg {};
mavlink_message_t message {};

memcpy(tune_msg.tune, &tone_info, sizeof(tone_info));
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are you creating the tone_info struct and then copying from it into the mavlink_play_tune_t struct? Couldn't you use the mavlink_play_tune_t struct from the beginning. Also, I wonder if the padding could be different if mavlink_play_tune_t is packed and the struct above is not.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @julianoes , I think the reason this was done originally is that the two two structs differ in how the get_next_note() method operates. get_next_note() gives back unsigned int values for frequency, duration, silence, and volume, and that 16 bytes of data needs to get packed into the mavlink_play_tune.tune[] 30 byte char array. Is there a better way I could try to implement this? Thanks!

Copy link
Contributor

Choose a reason for hiding this comment

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

Aha, now I understand. Does the tone_info struct need to be packed then? Otherwise padding might mess with the format, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think you're right about that, but I'm missing something there. When I try to pack that struct it can't bind the values in the get_next_note() call.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hm, I see. Where is the counterpart for this function? The one sending the tunes?

Copy link
Contributor

Choose a reason for hiding this comment

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

Or asking differently? How can I test/use this?

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @julianoes , the counterpart to this PR is here, now closed. I've tried again to resolve conflicts and so far had only concluded that I don't actually understand everything going on. :/ Give me a little bit of time to try to figure everything out, otherwise, perhaps, we can just close out this PR.

@mcsauder mcsauder force-pushed the advance_pr_11431 branch 2 times, most recently from bdc06cd to a7ca36c Compare October 9, 2019 17:50
@mcsauder
Copy link
Contributor Author

Intermingled with this PR is #12309... The two are attempting to utilize the same functionality from different viewpoints... I am appreciative for input from anyone who wrote this code and understands it!

…ded #includes, add volume to send_sim_tone() message and minor formatting.
@catch-twenty-two
Copy link
Contributor

catch-twenty-two commented Oct 22, 2019

Intermingled with this PR is #12309... The two are attempting to utilize the same functionality from different viewpoints... I am appreciative for input from anyone who wrote this code and understands it!

Hi @mcsauder thanks for continuing to work on this. This code only runs in the PX4 simulator, the other issue seems to be on the actual hardware. So this code is never active when the firmware is loaded on an actual hardware platform and executed. Does that make sense?

@mcsauder
Copy link
Contributor Author

Hi @mcsauder thanks for continuing to work on this. This code only runs in the PX4 simulator, the other issue seems to be on the actual hardware. So this code is never active when the firmware is loaded on an actual hardware platform and executed. Does that make sense?

Thanks @catch-twenty-two , I perhaps wasn't all that clear in my reference above. I think that the intent of this PR is actually at odds with what kind of data this message is meant to carry. It looks to me that we should be loading an ACSII music string instead of the struct that is being proposed in this PR and was originally submitted. I think we need to revisit this PR in that light and am closing this work for now since we lack functionality on the simulator side to receive as well.

@mcsauder mcsauder closed this Oct 24, 2019
@catch-twenty-two
Copy link
Contributor

catch-twenty-two commented Oct 24, 2019 via email

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.

4 participants