whoenig / crazyflie_ros

ROS Driver for Bitcraze Crazyflie
MIT License
192 stars 205 forks source link

Unable to get any Orientation or Covariance data in IMU topic #182

Closed kashishdhal closed 4 years ago

kashishdhal commented 4 years ago

Hello @whoenig ,

I am not getting any orientation or covariance data in IMU topic. Please help!

Regards, Kashish Dhal

whoenig commented 4 years ago

The IMU does not measure orientation, but angular velocity and acceleration. For both, the exact noise model is not part of crazyflie_ros and the covariance is simply set to -1 as per ROS standard, see https://github.com/whoenig/crazyflie_ros/blob/master/crazyflie_driver/src/crazyflie_server.cpp#L608-L631. You can find noise estimates in state estimators (e.g., https://github.com/bitcraze/crazyflie-firmware/blob/master/src/modules/src/kalman_core.c#L142-L149) and research papers (e.g., the Crazyswarm paper had some data on the gyro noise for CF 2.0).

Perhaps you are instead (or in addition) interested in the output of the state estimator (e.g., the EKF)? In that case, please take a look at the /pose topic that contains the actual orientation estimate based on sensor fusion. The covariance is estimated in the firmware, but by default not exposed in crazyflie_ros. You can create a custom log, that captures the relevant log variables defined in https://github.com/bitcraze/crazyflie-firmware/blob/master/src/modules/src/estimator_kalman.c#L720-L728.

kashishdhal commented 4 years ago

Hello @whoenig ,

Yes, I am interested in EKF outputs. Actually, in the IMU topic, there are fields for orientation and covariance, etc. but they are blank. I will take a look on \pose topic as per your suggestion.

So if I create a custom log, then how will it be transmitted through radio? Do I need to do some modifications in both ros stack and crazyflie firmware? Also, if I want to send the motor commands directly through the ros stack then how can we do that? I realize that on-board controller will have to be in the loop for stability.

Can you please point me to the piece of code where we are sending the radio commands from ros stack and where these commands are recieved in the crazyflie firmware? It will be a great help to me. I just want to understand the flow of the code.

Regards, Kashish Dhal

whoenig commented 4 years ago
kashishdhal commented 4 years ago

Thanks @whoenig , I am closing this issue as I want to analyze all the possible ways suggested. I will touch base if I need more help!