-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Enable setting motor power level through MSP #1214
Enable setting motor power level through MSP #1214
Conversation
…onfigurator) - Two public functions were added to motors.h and motors.c to enable this. - msp.c was also extended to support command MSP_SET_MOTOR - Fixed the msp request state machine to support data in requests, which was not supported prior to this. - Fixed function mspIsRequestValid() to no longer discard packets with payload data, since certain requests (like MSP_SET_MOTOR) DOES contain data in the packet. - Refactored old functions to use helper-function mspMakeTxPacket() instead of manually assembling packets every time.
Nice addition, something we should probably have in the cfclient as well. |
That's a good point. Wasn't sure if and how you wanted the public API (to |
The best would be to set parameters using the internal param API. This will send updated value to a potentially connected client so it make sure everything stays in sync. |
…tead of the public functions in motors.h. Note that this requires the Crazyflie to be connected to the cfclient when setting motor power, OR the build flag CONFIG_PARAM_SILENT_UPDATES must be set.
bed4f73
to
d9227bc
Compare
Good idea Arnaud, I made a new commit where I removed the newly added public functions in I've tried this with cf bolt, using ESC Configurator and both options:
works :) |
It i s a bit of a problem that it does not work unless a client is connected. I added an issue for this #1234. |
Thanks! |
This PR adds functionality to set the motor power level through MSP, which can be done directly from ESC Configurator for instance (using the motor sliders). This can be very handy when configuring the Crazyflie Bolt.
I also refactored some code in
msp.c
.A concern I discovered when working with the Crazyflie Bolt and ESC Configurator:
esc4wayProcess()
function that takes too long, but have not investigated this further.