-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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
Conversation
7431cab
to
76ff08d
Compare
@mcsauder I'd suggest that you request review from someone appropriate, otherwise I'm not sure how this should proceed. |
76ff08d
to
edc4a98
Compare
bb0fcfb
to
2ac6195
Compare
71a8afb
to
abcdbc2
Compare
683eeae
to
5900c06
Compare
If this doesn't break anything, let's just add it and deal with any repercussions after we discover an issue! |
5900c06
to
bdd1fb4
Compare
bdd1fb4
to
5ce94c8
Compare
5ce94c8
to
5c9f543
Compare
@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)); |
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.
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.
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.
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!
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.
Aha, now I understand. Does the tone_info
struct need to be packed then? Otherwise padding might mess with the format, right?
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.
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.
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.
Hm, I see. Where is the counterpart for this function? The one sending the tunes?
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.
Or asking differently? How can I test/use this?
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.
FYI @JonasVautherin
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.
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.
5c9f543
to
5f3049d
Compare
bdc06cd
to
a7ca36c
Compare
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.
a7ca36c
to
369645d
Compare
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. |
Ah got it. In that respect a lot more work would need to be done on the
sim side, since it was basically just playing a tone for a specified time
and not interpreting a string of characters. I was trying to get it to
mimic a bare bones buzzer as closely as possible to reflect exactly how the
px4 stack would have played it. I guess a message long would have made more
sense, when I get some time I will reopen this with the necessary changes.
…On Thu, Oct 24, 2019 at 11:06 AM Mark Sauder ***@***.***> wrote:
Hi @mcsauder <https://github.com/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 <https://github.com/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.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#12507>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABRHPO6QBA7MA4G2SQVP733QQHPZRANCNFSM4IEWLOQQ>
.
--
*Jimmy Johnson*
Field Application Engineer
Phone: (253) 242-3689
Seattle, Wa
www.auterion.com
|
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.