コード例 #1
0
ファイル: telemetry.c プロジェクト: SergDoc/TauLabs
/**
 * Initialise the telemetry module
 * \return -1 if initialisation failed
 * \return 0 on success
 */
int32_t TelemetryInitialize(void)
{
	FlightTelemetryStatsInitialize();
	GCSTelemetryStatsInitialize();

	// Initialize vars
	timeOfLastObjectUpdate = 0;

	// Create object queues
	queue = PIOS_Queue_Create(MAX_QUEUE_SIZE, sizeof(UAVObjEvent));
#if defined(PIOS_TELEM_PRIORITY_QUEUE)
	priorityQueue = PIOS_Queue_Create(MAX_QUEUE_SIZE, sizeof(UAVObjEvent));
#endif

	// Update telemetry settings
	updateSettings();
    
	// Initialise UAVTalk
	uavTalkCon = UAVTalkInitialize(&transmitData);
    
	// Create periodic event that will be used to update the telemetry stats
	txErrors = 0;
	txRetries = 0;
	UAVObjEvent ev;
	memset(&ev, 0, sizeof(UAVObjEvent));
	EventPeriodicQueueCreate(&ev, priorityQueue, STATS_UPDATE_PERIOD_MS);

	SessionManagingInitialize();
	SessionManagingConnectCallback(session_managing_updated);

	//register the new uavo instance callback function in the uavobjectmanager
	UAVObjRegisterNewInstanceCB(update_object_instances);

	return 0;
}
コード例 #2
0
ファイル: telemetry.c プロジェクト: Hoenerk/OpenPilot-1
/**
 * Initialise the telemetry module
 * \return -1 if initialisation failed
 * \return 0 on success
 */
int32_t TelemetryInitialize(void)
{
    FlightTelemetryStatsInitialize();
    GCSTelemetryStatsInitialize();

    // Initialize vars
    timeOfLastObjectUpdate = 0;

    // Create object queues
    queue = xQueueCreate(MAX_QUEUE_SIZE, sizeof(UAVObjEvent));
#if defined(PIOS_TELEM_PRIORITY_QUEUE)
    priorityQueue = xQueueCreate(MAX_QUEUE_SIZE, sizeof(UAVObjEvent));
#endif

    // Update telemetry settings
    telemetryPort = PIOS_COM_TELEM_RF;
    HwSettingsInitialize();
    updateSettings();

    // Initialise UAVTalk
    uavTalkCon = UAVTalkInitialize(&transmitData);
#ifdef PIOS_INCLUDE_RFM22B
    radioUavTalkCon = UAVTalkInitialize(&transmitData);
#endif

    // Create periodic event that will be used to update the telemetry stats
    txErrors  = 0;
    txRetries = 0;
    UAVObjEvent ev;
    memset(&ev, 0, sizeof(UAVObjEvent));
    EventPeriodicQueueCreate(&ev, priorityQueue, STATS_UPDATE_PERIOD_MS);

    return 0;
}
コード例 #3
0
/**
 * Initialise the telemetry module
 * \return -1 if initialisation failed
 * \return 0 on success
 */
int32_t MAVLinkInitialize(void)
{
	UAVObjEvent ev;

	FlightTelemetryStatsInitialize();
	GCSTelemetryStatsInitialize();
	TelemetrySettingsInitialize();

	// Initialize vars
	timeOfLastObjectUpdate = 0;

	// Create object queues
	queue = xQueueCreate(MAX_QUEUE_SIZE, sizeof(UAVObjEvent));
#if defined(PIOS_TELEM_PRIORITY_QUEUE)
	priorityQueue = xQueueCreate(MAX_QUEUE_SIZE, sizeof(UAVObjEvent));
#endif

	// Get telemetry settings object
	updateSettings();

	// Initialize waypoint protocol
	mavlink_wpm_init(&wpm);

	// Start specific update rates


	// Create periodic event that will be used to update the telemetry stats
	txErrors = 0;
	txRetries = 0;
	memset(&ev, 0, sizeof(UAVObjEvent));
	EventPeriodicQueueCreate(&ev, priorityQueue, STATS_UPDATE_PERIOD_MS);


	return 0;
}
コード例 #4
0
/**
 * Function used to initialize the first instance of each object.
 * This file is automatically updated by the UAVObjectGenerator.
 */
void UAVObjectsInitializeAll()
{
    ActuatorCommandInitialize();
    ActuatorDesiredInitialize();
    ActuatorSettingsInitialize();
    AHRSCalibrationInitialize();
    AHRSSettingsInitialize();
    AhrsStatusInitialize();
    AttitudeActualInitialize();
    AttitudeDesiredInitialize();
    AttitudeRawInitialize();
    AttitudeSettingsInitialize();
    BaroAltitudeInitialize();
    ExampleObject1Initialize();
    ExampleObject2Initialize();
    ExampleSettingsInitialize();
    FlightBatteryStateInitialize();
    FlightTelemetryStatsInitialize();
    GCSTelemetryStatsInitialize();
    GPSPositionInitialize();
    GPSSatellitesInitialize();
    GPSTimeInitialize();
    HomeLocationInitialize();
    ManualControlCommandInitialize();
    ManualControlSettingsInitialize();
    MixerSettingsInitialize();
    MixerStatusInitialize();
    ObjectPersistenceInitialize();
    PositionActualInitialize();
    StabilizationSettingsInitialize();
    SystemAlarmsInitialize();
    SystemSettingsInitialize();
    SystemStatsInitialize();
    TelemetrySettingsInitialize();
    VTOLSettingsInitialize();
    VTOLStatusInitialize();

}