USC-ACTLab / crazyswarm

A Large Quadcopter Swarm
MIT License
319 stars 316 forks source link

What is the best way to get angular state feedback? #745

Closed Judy021 closed 12 months ago

Judy021 commented 1 year ago

I'm using cf.cmdFullState to follow a path computed using LQR. I need full state feedback to compute the optimal control to follow the path. Th problem is there is no way to get attitude feedback (roll, pitch, yaw angles and rate). I tried using cf.state() but I get the following error: current_state = cf.state() TypeError: 'traj_eval' object is not callable

I can obtain linear position and velocity using cf.position() and cf.velocity() but how do I get angular state information?

knmcguire commented 1 year ago

Not sure if there is an API for that... but you could use the logging <-> topics frameworks perhaps? That is something you can set in the launch file and you can then observe these logging variables: https://www.bitcraze.io/documentation/repository/crazyflie-firmware/master/api/logs/#stateestimate