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

Add memory handler for the Led Timings driver #597 + example #158

Merged
merged 6 commits into from
Jul 27, 2020

Conversation

dolfje
Copy link
Contributor

@dolfje dolfje commented Jul 15, 2020

As we introduce the functionality of a led timings driver, we update the library to support this new led method.
And also add an example.

@knmcguire
Copy link
Contributor

The build has failed so that would need to be fixed. You can check it in the details of travis CI or if you have the toolbelt installed you can run test locally on your machine. https://github.com/bitcraze/crazyflie-lib-python#testing

Let us know if you need help with that.

cflib/crazyflie/mem.py Outdated Show resolved Hide resolved
@knmcguire
Copy link
Contributor

Alright looks good! I will use this change to check out the pull request in the firmware and to try out the example. No time today anymore but I will try tomorrow.

@knmcguire
Copy link
Contributor

I'm currently trying both pull request on the led timing out at once. With running the python example, I get the following error message:

$ python3 examples/basicLedTiming.py 

Connecting to radio://0/80/2M/E7E7E7E7E7
Connected to radio://0/80/2M/E7E7E7E7E7
Traceback (most recent call last):
  File "examples/basicLedTiming.py", line 56, in <module>
    mem[0].add(25, {'r': 100, 'g': 0, 'b': 0})
IndexError: tuple index out of range

@dolfje
Copy link
Contributor Author

dolfje commented Jul 17, 2020

That looks like your crazyflie doesn't has the correct firmware. As the library can't find the memory module added in the firmware.

@knmcguire
Copy link
Contributor

hmm maybe not, but the firmware I flashed did had your commits in there I checked with git log.
'''
commit 787cc9b
Author: Nikos Verschore [email protected]
Date: Wed Jul 15 23:35:30 2020 +0200

Test and fix the implementation of Led Timings

'''
also handleLedMemRead is in mem.c.

There might be something else going on

@knmcguire
Copy link
Contributor

is there maybe something in config.mk that needs to be added?

@dolfje
Copy link
Contributor Author

dolfje commented Jul 17, 2020

No changes to config.mk are needed. In the firmware itself it adds the new driver: https://github.com/bitcraze/crazyflie-firmware/pull/598/files#diff-a175f25f456b304028ac704ac00ee2b8R245 If both the crazyflie has the pull request firmware and you have installed the pull request library in your pc, then it should work. I just checked it with both branches without any configuration changes. Maybe you didn't reinstall the library on your pc?

But in general, have no clue, why it don't work with you :(

@knmcguire
Copy link
Contributor

so I cloned the repos on a temp folder to make sure its super fresh. The cflib is installed from that folder which i checked with pip3 lib:
cflib 0.1.11 /home/kimberly/projects/temp/crazyflie-lib-python
lib is in feature/597 from your repo.

I did the same with the firmware which I checked with the cfclient in help>debug:

Crazyflie
Connected: usb://0
Firmware: 787cc9bd1d1c (CLEAN)

This is the last commit of your pull request.

Unfortunately... the same problem:

$ python3 basicLedTiming.py 

Connecting to radio://0/80/2M/E7E7E7E7E7
Connected to radio://0/80/2M/E7E7E7E7E7
Traceback (most recent call last):
  File "basicLedTiming.py", line 56, in <module>
    mem[0].add(25, {'r': 100, 'g': 0, 'b': 0})
IndexError: tuple index out of range

Adding the following helps with the error, but it doesn't activate the leds:
if len(mem) > 0:

@knmcguire
Copy link
Contributor

Next week one of the other developers are back so I will ask him to try it out on his computer. I still think there is something missing but at least we can be sure.

@krichardsson krichardsson merged commit 4be16c3 into bitcraze:master Jul 27, 2020
@krichardsson
Copy link
Contributor

Merged. Thanks!

@krichardsson krichardsson added this to the next-release milestone Jul 27, 2020
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.

3 participants