Ejemplo n.º 1
0
void connectObjects()
{
	imu.ro.name="IMU";
	imu.ro.connections=imuConnections;
	imu.ro.nConnections=1;
	createIMU(&imu);

	pilot.ro.name="Pilot";
	pilot.ro.connections=pilotConnections;
	pilot.ro.nConnections=1;
	createPilot(&pilot);

	RX.ro.name="RX";
	RX.ro.connections=rxConnections;
	RX.ro.nConnections=5;
	RX.ro.parameters=parameterList;
	RX.ro.messageHandler=RXHandleMessage;
	RX.radioOverflows=0;
	RX.servoUpdateRate=0;

	sensorBus1.ro.name="1 wire";
	sensorBus1.ro.connections=onewConnections;
	sensorBus1.ro.nConnections=1;
	createOneWireBus(&sensorBus1);

	routedObjectConnect(&imu.ro);
	routedObjectConnect(&pilot.ro);
	routedObjectConnect(&RX.ro);
	routedObjectConnect(&sensorBus1.ro);

}
Ejemplo n.º 2
0
Pilot *getPilotFromVertex(Vertex *v)
{
   Vect *speed=getSpeedFromIndex(((Vect4D *)v->e)->z);
   if(speed)
      {
	 return createPilot(createVect(((Vect4D *)v->e)->x,((Vect4D *)v->e)->y),speed);
      }
   else
      {
	 perror("Vitesse (NULL)");
      }
}