str_ptr=sprintf(str,"meas result for %s: [ %i %i %i ]",orientation_strs[orient],accel_raw_ref[orient][0],accel_raw_ref[orient][1],accel_raw_ref[orient][2]);
mavlink_log_info(mavlink_fd,str);
data_collected[orient]=true;
tune_confirm();
}
close(sensor_combined_sub);
@ -186,26 +180,16 @@ int do_accel_calibration_mesurements(int mavlink_fd, float accel_offs_scaled[3],
@@ -186,26 +180,16 @@ int do_accel_calibration_mesurements(int mavlink_fd, float accel_offs_scaled[3],
/* convert raw accel offset to scaled and transform matrix to scales
*rotationpartoftransformmatrixisnotusedbynow*/
for(inti=0;i<3;i++){
accel_offs_scaled[i]=accel_offs[i]*accel_T[i][i];
accel_scale[i]=accel_T[i][i];
}
returnOK;
}
@ -226,8 +210,8 @@ int detect_orientation(int mavlink_fd, int sub_sensor_combined) {
@@ -226,8 +210,8 @@ int detect_orientation(int mavlink_fd, int sub_sensor_combined) {
floatema_len=0.2f;
/* set "still" threshold to 0.005 m/s^2 */
floatstill_thr2=pow(0.05f/CONSTANTS_ONE_G,2);
/* set accel error threshold to 20% of accel vector length */
floataccel_err_thr=0.2f;
/* set accel error threshold to 30% of accel vector length */
@ -264,7 +248,7 @@ int detect_orientation(int mavlink_fd, int sub_sensor_combined) {
@@ -264,7 +248,7 @@ int detect_orientation(int mavlink_fd, int sub_sensor_combined) {
/* is still now */
if(t_still==0){
/* first time */
mavlink_log_info(mavlink_fd,"still");
mavlink_log_info(mavlink_fd,"still...");
t_still=t;
t_timeout=t+timeout;
}else{
@ -279,7 +263,7 @@ int detect_orientation(int mavlink_fd, int sub_sensor_combined) {
@@ -279,7 +263,7 @@ int detect_orientation(int mavlink_fd, int sub_sensor_combined) {
accel_disp[2]>still_thr_raw2*2.0f){
/* not still, reset still start time */
if(t_still!=0){
mavlink_log_info(mavlink_fd,"moving");
mavlink_log_info(mavlink_fd,"moving...");
t_still=0;
}
}
@ -289,17 +273,11 @@ int detect_orientation(int mavlink_fd, int sub_sensor_combined) {
@@ -289,17 +273,11 @@ int detect_orientation(int mavlink_fd, int sub_sensor_combined) {
@ -316,13 +294,13 @@ int detect_orientation(int mavlink_fd, int sub_sensor_combined) {
@@ -316,13 +294,13 @@ int detect_orientation(int mavlink_fd, int sub_sensor_combined) {