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

cpx array sending example to crazyflie #116

Open
knmcguire opened this issue Feb 27, 2023 · 6 comments
Open

cpx array sending example to crazyflie #116

knmcguire opened this issue Feb 27, 2023 · 6 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@knmcguire
Copy link
Member

There have been several request to add an example of CPX sending an array to the crazyflie app, and this is one of them.

So it would be great to have that in the repository.

In the next few weeks we will not have time for this (we as in Bitcraze), but if anybody has an example working, perhaps could make a PR?

@knmcguire knmcguire added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels Feb 27, 2023
@matthewoots
Copy link

@knmcguire I do have an example but it is abit messy since it is compiled to the wifi streamer example since I don't really know how to create another example and compile with the aideck using docker.
Maybe you can let me know the steps and I can help to do a pull request here.
photo_2023-03-01_10-25-04

@hmllr
Copy link
Contributor

hmllr commented Mar 1, 2023

sounds great!
To create another example I would start from an existing one (to not have to write the makefile from scratch), like the wifi streamer example, then duplicate it, rename the folder/files (also in the Makefile), modify your code and then compile with the same docker command as before, just with a changed path.
I hope this helps and am looking forward to your example :) (don't hesitate to ask again if my instructions were not precise enough, we are happy to help out with this)
Hanna

@hmllr
Copy link
Contributor

hmllr commented Mar 2, 2023

I just added a tutorial about how to write your own applications on gap8, as this might be an issue for more than just you: bitcraze/bitcraze-website#155
The example code for it is linked in the PR linked above.
@matthewoots it would be cool if you would use this starting point to do a PR for your CPX communication in both directions :)

@matthewoots
Copy link

Thank you so much for developing the guide @hmllr, I'll get to the example as soon as I can.

Also there are some things that may need to be ironed out in crazyflie-firmware the receiving end, since there may be a need to add a module added to cpx.h (or for me I tapped on aideck) to write the handler function

  • Currently it is using cpx.c where cpxInternalRouterReceiveOthers will receive data with a CPX_F_TEST function, in which one can add a data handler inside the case

Moving forward I think I can create a module and attach it to cpx.h, this will handle the message and pass it into an empty task (which the user can define?)

@hmllr
Copy link
Contributor

hmllr commented Mar 3, 2023

Hmm, I am not completely sure but I thought that using the CPX_F_APP should send it to the app directly.
However, as you have something working maybe you can draft a PR and we go from there?

matthewoots added a commit to matthewoots/aideck-gap8-examples that referenced this issue Mar 4, 2023
…ta is serialized to cpx and sent from gap8 to stm32
matthewoots added a commit to matthewoots/crazyflie-firmware that referenced this issue Mar 4, 2023
…s serialized to cpx and sent from gap8 to stm32, this is the receiving end after routing to the stm32 please run this with (aideck-gap8-examples/examples/other/send_data)
@pladosz
Copy link

pladosz commented Mar 29, 2023

Hi,
I have example of how to send CRTP velocity commands from AI-deck over CPX to the crazyflie. It is based on modified gap8-examples code and disucssion from here: https://github.com/orgs/bitcraze/discussions/519. It can be found here: https://github.com/pladosz/AI_deck_vel_send_cpx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants