Skip to content
Snippets Groups Projects
Commit 8c8bd0fb authored by Sergi Hernandez's avatar Sergi Hernandez
Browse files

Merge branch 'smart_charger_fw' of...

Merge branch 'smart_charger_fw' of https://gitlab.iri.upc.edu/humanoides/darwin_stm32_fw into smart_charger_fw
parents 54d8e70e 637a115e
No related branches found
No related tags found
2 merge requests!5Dynamixel manager,!2Smart charger fw
...@@ -258,7 +258,7 @@ void imu_accel_convert_data(uint8_t *data_in,uint8_t *data_out) ...@@ -258,7 +258,7 @@ void imu_accel_convert_data(uint8_t *data_in,uint8_t *data_out)
for(i=0;i<3;i++) for(i=0;i<3;i++)
{ {
accel_data[i]=(data_in[i*2]+(data_in[i*2+1]<<8)); accel_data[i]=(int16_t)(data_in[i*2]+(data_in[i*2+1]<<8));
data_out[i*2]=accel_data[i]%256; data_out[i*2]=accel_data[i]%256;
data_out[i*2+1]=accel_data[i]/256; data_out[i*2+1]=accel_data[i]/256;
} }
......
...@@ -149,10 +149,10 @@ void manager_balance(void) ...@@ -149,10 +149,10 @@ void manager_balance(void)
manager_balance_offset[R_ANKLE_PITCH]=((((int64_t)gyro_y*(int64_t)ankle_pitch_gain)/12000)>>9); manager_balance_offset[R_ANKLE_PITCH]=((((int64_t)gyro_y*(int64_t)ankle_pitch_gain)/12000)>>9);
manager_balance_offset[L_KNEE]=((((int64_t)gyro_y*(int64_t)knee_gain)/12000)>>9); manager_balance_offset[L_KNEE]=((((int64_t)gyro_y*(int64_t)knee_gain)/12000)>>9);
manager_balance_offset[L_ANKLE_PITCH]=-((((int64_t)gyro_y*(int64_t)ankle_pitch_gain)/12000)>>9); manager_balance_offset[L_ANKLE_PITCH]=-((((int64_t)gyro_y*(int64_t)ankle_pitch_gain)/12000)>>9);
manager_balance_offset[R_HIP_ROLL]=-((((int64_t)gyro_x*(int64_t)hip_roll_gain)/12000)>>9); manager_balance_offset[R_HIP_ROLL]=((((int64_t)gyro_x*(int64_t)hip_roll_gain)/12000)>>9);
manager_balance_offset[L_HIP_ROLL]=-((((int64_t)gyro_x*(int64_t)hip_roll_gain)/12000)>>9); manager_balance_offset[L_HIP_ROLL]=((((int64_t)gyro_x*(int64_t)hip_roll_gain)/12000)>>9);
manager_balance_offset[R_ANKLE_ROLL]=((((int64_t)gyro_x*(int64_t)ankle_roll_gain)/12000)>>9); manager_balance_offset[R_ANKLE_ROLL]=-((((int64_t)gyro_x*(int64_t)ankle_roll_gain)/12000)>>9);
manager_balance_offset[L_ANKLE_ROLL]=((((int64_t)gyro_x*(int64_t)ankle_roll_gain)/12000)>>9); manager_balance_offset[L_ANKLE_ROLL]=-((((int64_t)gyro_x*(int64_t)ankle_roll_gain)/12000)>>9);
} }
// fall detection (using accelerometer) // fall detection (using accelerometer)
imu_get_accel_data(&accel_x,&accel_y,&accel_z); imu_get_accel_data(&accel_x,&accel_y,&accel_z);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment