// normalizes ball position and returns normalized ball speed void normalizeBallParams(int x_pos, int y_pos, uint sim_time) { // position normalization pos_.x = A_X*x_pos + B_X; pos_.y = A_Y*y_pos + B_Y; // normalizing pos float n_pos = v_norm(pos_); if(n_pos > 1.0) { pos_.x /= n_pos; pos_.y /= n_pos; } compute_speed(sim_time); average_params(); }
void sensor_int4(int irq, FAR void *context) { compute_speed(3); return; }