[SOLVED] Changing velocity with assisted flight

Discussions and questions about the Crazyflie Nano Quadcopter
Post Reply
maxmart
Beginner
Posts: 10
Joined: Thu Jan 07, 2021 2:28 am

[SOLVED] Changing velocity with assisted flight

Post by maxmart »

Hi,

I am trying to change the velocity for flying the Crazyflie using a PS4 controller with a flow deck in Hover assisted flight. Currently, the limit for velocity is set to 1m/s by default. I was advised to change the xyVelMax (attached image) to increase the limit of the velocity. I tried to change it to 2.0 or even higher, but when I checked the log file, specifically kalman_states.vy or kalman_states.vx, the maximum value is still 1.0.

Then I also tried to increase the RPLimit and observe the changes. When I checked the log file, specifically the controller.pitch/roll, the limit did change, but the velocity still remained limited to 1.0. Would anyone know how to change the velocity?

Thank you.
Attachments
xyVelMax.png
kimberly
Bitcraze
Posts: 704
Joined: Fri Jul 06, 2018 11:13 am

Re: Changing velocity with assisted flight

Post by kimberly »

Hi!

My colleagues saw this and they said to try to place a multiplier on these lines and build the cfclient again. Apparently the RPLimit is not used there.
maxmart
Beginner
Posts: 10
Joined: Thu Jan 07, 2021 2:28 am

Re: Changing velocity with assisted flight

Post by maxmart »

Hi!

Thank you for your reply. Unfortunately, I am not yet familiar with how to build the cfclient. Does this mean I have to use the VM to edit the lines of code you have mentioned and then thru the terminal window, build the cfclient itself and run the modified cfclient within the VM?

I have recently tried to use the VM in the bitcraze website, so far I am unable to run the Crazyflie client, the terminal window starts and then exits without proceeding to open the client itself. I have updated the source files already by this point.

Would you have an idea on how to go about this?

Thank you!
kimberly
Bitcraze
Posts: 704
Joined: Fri Jul 06, 2018 11:13 am

Re: Changing velocity with assisted flight

Post by kimberly »

Yeah indeed, since this is a feature that requires the source code of the client to be changed.

There are instructions how to build the cfclient from source: https://github.com/bitcraze/crazyflie-clients-python and then go to 'building from source'.
maxmart
Beginner
Posts: 10
Joined: Thu Jan 07, 2021 2:28 am

Re: Changing velocity with assisted flight

Post by maxmart »

Hi!

I just recently tried this. I followed the link you mentioned to setup a virtual environment in the VM. Then I added a multiplier on the variables you mentioned. I tried putting 0.5 for vx, and 1.5 for vy as seen in the image below.
code.png
Then I use this code "python3 -m pip install -e ." to build the cfclient within the venv. Once I opened it in the venv, I saw that the vx and vy are having the 0.5 and 1.5 limits when I push the sticks. The Crazyflie can now move faster or slower based on the multiplier.
graph for velocity.png
kimberly
Bitcraze
Posts: 704
Joined: Fri Jul 06, 2018 11:13 am

Re: Changing velocity with assisted flight

Post by kimberly »

Ah good. And this is what you needed? Is it solved for you now?
maxmart
Beginner
Posts: 10
Joined: Thu Jan 07, 2021 2:28 am

Re: Changing velocity with assisted flight

Post by maxmart »

Yes! So far this is what I needed. Thank you!
kimberly
Bitcraze
Posts: 704
Joined: Fri Jul 06, 2018 11:13 am

Re: Changing velocity with assisted flight

Post by kimberly »

Great! Good luck and if you need to know anything else, just start a new forum thread :)
Post Reply