Offboard total thrust and torque control mode #1659
Replies: 2 comments 1 reply
-
By "emulation," I mean using an approximate dynamics model of the Crazyflie to perform an RK4 update at its current state, using the total thrust and torques generated by the neural network. The resulting position, velocity, attitude, etc., would then be sent to the Crazyflie as setpoints via cmd_full_state_changed (from Crazyswarm2) or send_full_state_setpoint (from cflib), but at a lower frequency, such as 50Hz. What do you think of this approach? While it feels somewhat like a hack, I’m open to suggestions or alternatives for achieving off-board control effectively. |
Beta Was this translation helpful? Give feedback.
-
About sending rate commends, that should be possible to do from the crazyflie python library: https://www.bitcraze.io/documentation/repository/crazyflie-lib-python/master/user-guides/python_api/#sending-control-setpoints-with-the-commander-framework. If it is just 1 crazyradio to 1 crazyflie, the delay should be short enough to work. And about sending more higher-level commands to the Crazyflie, this would be a good option, but just be aware that there are different physics underneath it, but as long as both the simulator and real crazyflie's controller are tuned to a max, I don't see a problem with it. 50 Hz for full state setpoints seems reasonable and maybe you could go even lower. @whoenig you have some experience in this, what would you think of this? |
Beta Was this translation helpful? Give feedback.
-
For my project, I aim to control the Crazyflie using total thrust and torques as inputs. These signals are generated by a deep reinforcement learning (RL) model that is too large to be implemented onboard, similar to the approach used in TinyMPC.
To achieve this, I attempted to create a custom thrust-torque setpoint in both cflib and crazyflie-firmware. However, I encountered a significant bottleneck: the Crazyradio seems unable to transmit these commands at the rate required for the stabilizer to function effectively.
I would like to know if there are any existing examples or implementations that support this type of control mode off-board. Alternatively, is there a way to "emulate" the Crazyflie dynamics off-board to generate a higher-level setpoint (e.g., position or velocity) that closely follows the original control signals' intention?
Any insights, suggestions, or examples would be greatly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions