예제 #1
0
void sgp_orbit_propagator(void)
{
  vector v_g;
  vector v_v_old;
  float delta_t = ((float)FRAME_TIME) / 10;
  uint8_t i, j;
  
  for(i = 0; i < 10; i++)
  {
    sgp_get_acceleration(v_g);
    
    copy_vector(v_v, v_v_old);
    
    for(j = 0; j < 3; j++)
      v_v[j] += v_g[j] * delta_t;
    
    for(j = 0; j < 3; j++)
      v_r[j] += ((v_v[j] + v_v_old[j]) / 2) * delta_t;
  }

}
예제 #2
0
void sgp_orbit_propagator(void)
{
  vector v_g;
  vector v_v_old;
  float delta_t = ((float)FRAME_TIME) / 10;
  uint8_t i, j;
  
  for(i = 0; i < 10; i++)
  {
    sgp_get_acceleration(v_g);
    
    copy_vector(v_v, v_v_old);
    
    for(j = 0; j < 3; j++)
      v_v[j] += v_g[j] * delta_t;
    
    for(j = 0; j < 3; j++)
      v_r[j] += ((v_v[j] + v_v_old[j]) / 2) * delta_t;// this is also different from controls
  }
  
  /*uint16_t send[3];
  for (int i=0;i<3;i++)
  {
	  if(send[i]<0)
	  send[i]=(uint16_t)(-1*(v_v[i]));
	  else
	  send[i]=(uint16_t)(1*(v_v[i]));
	  
  }
  uint8_t a,b;
  for (int i=0;i<3;i++)
  {
	  a = (uint8_t)send[i];
	  b = (uint8_t)(send[i]>>8);
	  transmit_UART0(a);
	  transmit_UART0(b);
  }*/
  
}