Beispiel #1
0
vrpn_IMU_SimpleCombiner::vrpn_IMU_SimpleCombiner
    (const char * name, vrpn_Connection * trackercon,
      vrpn_Tracker_IMU_Params *params,
      float update_rate, bool report_changes)
  : vrpn_Tracker(name, trackercon),
  d_update_interval(update_rate ? (1 / update_rate) : 1.0),
  d_report_changes(report_changes)
{
  // Set the restoration rates for gravity and north.
  // These are the fraction of the way to full restoration that should
  // occur over one second.
  d_gravity_restore_rate = 0.9;
  d_north_restore_rate = 0.9;

  // Hook up the parameters for acceleration and rotational velocity
  d_acceleration.params = params->d_acceleration;
  d_rotational_vel.params = params->d_rotational_vel;

  // Magetometers by definition produce unit vectors and
  // have their axes as (x,y,z) so we just have to specify
  // the name here and the others are all set to pass the
  // values through.
  d_magnetometer.params.name = params->d_magnetometer_name;
  for (int i = 0; i < 3; i++) {
    d_magnetometer.params.channels[i] = i;
    d_magnetometer.params.offsets[i] = 0;
    d_magnetometer.params.scales[i] = 1;
  }

  //--------------------------------------------------------------------
  // Open analog remotes for any channels that have non-NULL names.
  // If the name starts with the "*" character, use tracker
  // connection rather than getting a new connection for it.
  // Set up callbacks to handle updates to the analog values.
  setup_vector(&d_acceleration, handle_analog_update);
  setup_vector(&d_rotational_vel, handle_analog_update);
  setup_vector(&d_magnetometer, handle_analog_update);

  //--------------------------------------------------------------------
  // Set the current timestamp to "now", the current orientation to identity
  // and the angular rotation velocity to zero.
  vrpn_gettimeofday(&d_prevtime, NULL);
  d_prev_update_time = d_prevtime;
  vrpn_Tracker::timestamp = d_prevtime;
  q_vec_set(pos, 0, 0, 0);
  q_from_axis_angle(d_quat, 0, 0, 1, 0);
  q_vec_set(vel, 0, 0, 0);
  q_from_axis_angle(vel_quat, 0, 0, 1, 0);
  vel_quat_dt = 1;
}
Beispiel #2
0
void __init init_IRQ(void)
{
	int c;

	setup_vector();

	for (c = 0; c < NR_IRQS; c++)
		set_irq_chip_and_handler(c, &h8300irq_chip, handle_simple_irq);
}
Beispiel #3
0
void __init init_IRQ(void)
{
	int c;

	setup_vector();

	for (c = 0; c < NR_IRQS; c++) {
		irq_desc[c].status = IRQ_DISABLED;
		irq_desc[c].action = NULL;
		irq_desc[c].depth = 1;
		irq_desc[c].chip = &h8300irq_chip;
	}
}
Beispiel #4
0
void init_system()
{
    uint8_t cpuid = smp_processor_id();

    setup_vector();

    setup_httbr((uint32_t) &__HYP_PGTABLE);

    setup_mem_attr();

    if (cpuid == 0) {
        // TODO(wonseok) console init will be moved dev_init().
        console_init();

        libc_init();
    }

    irq_init();

    //enable_traps();

    if (cpuid == 0) {
        paging_create((addr_t) &__HYP_PGTABLE);

        platform_init();

        dev_init(); /* we don't have */

        vdev_init(); /* Already we have */

        timer_hw_init(NS_PL2_PTIMER_IRQ);

        setup_vm_mmap();

#ifdef CONFIG_SMP
        printf("wake up...other CPUs\n");
        secondary_smp_pen = 1;
#endif
    }
    printf("%s[%d]: CPU[%d]\n", __func__, __LINE__, cpuid);

    enable_mmu();

    start_hypervisor();
}
int main(int argc, char *argv[]) {
	
	//Recupero il numero di elementi da generare
	int nmax;
	nmax = atoi(argv[1]);
	int intervallo = nmax;
	int v[nmax];
	
	f = fopen("file.txt", "w");
	if(f == NULL){
		printf("Error opening file!\n");
		return(1);
	}
		
	setup_vector(v,nmax);
	//printv(v, nmax);
	permute(v,0,nmax-1,nmax);
	
	fclose(f);
}
Beispiel #6
0
vrpn_IMU_Magnetometer::vrpn_IMU_Magnetometer
          (std::string const &name, vrpn_Connection *output_con,
            vrpn_IMU_Axis_Params params,
           float update_rate, bool report_changes) :
	vrpn_Analog_Server(name.c_str(), output_con),
	d_update_interval (update_rate ? (1/update_rate) : 1.0),
	d_report_changes (report_changes)
{
  // We have 3 output channels.
  num_channel = 3;

	//--------------------------------------------------------------------
	// Set the current timestamp to "now" and current direction to along X.
	// This is done in case we never hear from the analog devices.
  vrpn_gettimeofday(&d_prevtime, NULL);
  vrpn_Analog::timestamp = d_prevtime;
  channel[0] = 1;
  channel[1] = 0;
  channel[2] = 0;

  // Set empty axis values.
	d_vector.params = params;
  d_vector.time = d_prevtime;

	//--------------------------------------------------------------------
	// Open analog remote to use to listen to.
	//   If the name starts with the "*" character, use our output
  // connection rather than getting a new connection for it.
	//   Set up callbacks to handle updates to the analog reports.
	setup_vector(&d_vector);

	//--------------------------------------------------------------------
  // Set the minimum and maximum values past each other and past what
  // we expect from any real device, so they will be inialized properly
  // the first time we get a report.
  for (size_t i = 0; i < 3; i++) {
    d_mins[i] = 1e100;
    d_maxes[i] = -1e100;
  }
}
Beispiel #7
0
void __init init_IRQ(void)
{
    setup_vector();
    irqchip_init();
}