コード例 #1
0
/**
 * Initialize object fields and metadata with the default values.
 * If a default value is not specified the object fields
 * will be initialized to zero.
 */
void VibrationAnalysisOutputSetDefaults(UAVObjHandle obj, uint16_t instId)
{
	VibrationAnalysisOutputData data;

	// Initialize object fields to their default values
	UAVObjGetInstanceData(obj, instId, &data);
	memset(&data, 0, sizeof(VibrationAnalysisOutputData));

	UAVObjSetInstanceData(obj, instId, &data);

	// Initialize object metadata to their default values
	if (instId == 0) {
		UAVObjMetadata metadata;
		metadata.flags =
			ACCESS_READWRITE << UAVOBJ_ACCESS_SHIFT |
			ACCESS_READWRITE << UAVOBJ_GCS_ACCESS_SHIFT |
			0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
			0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
			UPDATEMODE_THROTTLED << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
			UPDATEMODE_MANUAL << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
		metadata.telemetryUpdatePeriod = 1000;
		metadata.gcsTelemetryUpdatePeriod = 0;
		metadata.loggingUpdatePeriod = 0;
		UAVObjSetMetadata(obj, &metadata);
	}
}
コード例 #2
0
/**
 * Initialize object fields and metadata with the default values.
 * If a default value is not specified the object fields
 * will be initialized to zero.
 */
void ReceiverActivitySetDefaults(UAVObjHandle obj, uint16_t instId)
{
	ReceiverActivityData data;
	UAVObjMetadata metadata;

	// Initialize object fields to their default values
	UAVObjGetInstanceData(obj, instId, &data);
	memset(&data, 0, sizeof(ReceiverActivityData));
	data.ActiveGroup = 7;
	data.ActiveChannel = 255;

	UAVObjSetInstanceData(obj, instId, &data);

	// Initialize object metadata to their default values
	metadata.flags =
		ACCESS_READWRITE << UAVOBJ_ACCESS_SHIFT |
		ACCESS_READONLY << UAVOBJ_GCS_ACCESS_SHIFT |
		0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
		0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
		UPDATEMODE_ONCHANGE << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
		UPDATEMODE_MANUAL << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
	metadata.telemetryUpdatePeriod = 0;
	metadata.gcsTelemetryUpdatePeriod = 0;
	metadata.loggingUpdatePeriod = 0;
	UAVObjSetMetadata(obj, &metadata);
}
コード例 #3
0
/**
 * Initialize object fields and metadata with the default values.
 * If a default value is not specified the object fields
 * will be initialized to zero.
 */
void HomeLocationSetDefaults(UAVObjHandle obj, uint16_t instId)
{
	HomeLocationData data;
	UAVObjMetadata metadata;

	// Initialize object fields to their default values
	UAVObjGetInstanceData(obj, instId, &data);
	memset(&data, 0, sizeof(HomeLocationData));
	data.Latitude = 0;
	data.Longitude = 0;
	data.Altitude = 0;
	data.Be[0] = 0;
	data.Be[1] = 0;
	data.Be[2] = 0;
	data.g_e = 9.81;
	data.SeaLevelPressure = 1013;
	data.Set = 0;
	data.GroundTemperature = 15;

	UAVObjSetInstanceData(obj, instId, &data);

	// Initialize object metadata to their default values
	metadata.flags =
		ACCESS_READWRITE << UAVOBJ_ACCESS_SHIFT |
		ACCESS_READWRITE << UAVOBJ_GCS_ACCESS_SHIFT |
		1 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
		1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
		UPDATEMODE_ONCHANGE << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
		UPDATEMODE_ONCHANGE << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
	metadata.telemetryUpdatePeriod = 0;
	metadata.gcsTelemetryUpdatePeriod = 0;
	metadata.loggingUpdatePeriod = 0;
	UAVObjSetMetadata(obj, &metadata);
}
コード例 #4
0
/**
 * Initialize object fields and metadata with the default values.
 * If a default value is not specified the object fields
 * will be initialized to zero.
 */
void DebugLogSettingsSetDefaults(UAVObjHandle obj, uint16_t instId)
{
    DebugLogSettingsData data;

    // Initialize object fields to their default values
    UAVObjGetInstanceData(obj, instId, &data);
    memset(&data, 0, sizeof(DebugLogSettingsData));
    data.LoggingEnabled = 0;

    UAVObjSetInstanceData(obj, instId, &data);

    // Initialize object metadata to their default values
    if ( instId == 0 ) {
        UAVObjMetadata metadata;
        metadata.flags =
            ACCESS_READWRITE << UAVOBJ_ACCESS_SHIFT |
            ACCESS_READWRITE << UAVOBJ_GCS_ACCESS_SHIFT |
            1 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
            1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
            UPDATEMODE_ONCHANGE << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
            UPDATEMODE_ONCHANGE << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT |
            UPDATEMODE_MANUAL << UAVOBJ_LOGGING_UPDATE_MODE_SHIFT;
        metadata.telemetryUpdatePeriod = 0;
        metadata.gcsTelemetryUpdatePeriod = 0;
        metadata.loggingUpdatePeriod = 0;
        UAVObjSetMetadata(obj, &metadata);
    }
}
コード例 #5
0
/**
 * Initialize object fields and metadata with the default values.
 * If a default value is not specified the object fields
 * will be initialized to zero.
 */
void AirspeedSettingsSetDefaults(UAVObjHandle obj, uint16_t instId)
{
    AirspeedSettingsData data;

    // Initialize object fields to their default values
    UAVObjGetInstanceData(obj, instId, &data);
    memset(&data, 0, sizeof(AirspeedSettingsData));
    data.Scale = 1.000000e+00f;
    data.IMUBasedEstimationLowPassPeriod1 = 5.000000e-01f;
    data.IMUBasedEstimationLowPassPeriod2 = 1.000000e+01f;
    data.ZeroPoint = 0;
    data.SamplePeriod = 100;
    data.AirspeedSensorType = 5;

    UAVObjSetInstanceData(obj, instId, &data);

    // Initialize object metadata to their default values
    if ( instId == 0 ) {
        UAVObjMetadata metadata;
        metadata.flags =
            ACCESS_READWRITE << UAVOBJ_ACCESS_SHIFT |
            ACCESS_READWRITE << UAVOBJ_GCS_ACCESS_SHIFT |
            1 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
            1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
            UPDATEMODE_ONCHANGE << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
            UPDATEMODE_ONCHANGE << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT |
            UPDATEMODE_MANUAL << UAVOBJ_LOGGING_UPDATE_MODE_SHIFT;
        metadata.telemetryUpdatePeriod = 0;
        metadata.gcsTelemetryUpdatePeriod = 0;
        metadata.loggingUpdatePeriod = 0;
        UAVObjSetMetadata(obj, &metadata);
    }
}
コード例 #6
0
/**
 * Initialize object fields and metadata with the default values.
 * If a default value is not specified the object fields
 * will be initialized to zero.
 */
void GeoFenceSettingsSetDefaults(UAVObjHandle obj, uint16_t instId)
{
	GeoFenceSettingsData data;

	// Initialize object fields to their default values
	UAVObjGetInstanceData(obj, instId, &data);
	memset(&data, 0, sizeof(GeoFenceSettingsData));
	data.WarningRadius = 200;
	data.ErrorRadius = 250;

	UAVObjSetInstanceData(obj, instId, &data);

	// Initialize object metadata to their default values
	if (instId == 0) {
		UAVObjMetadata metadata;
		metadata.flags =
			ACCESS_READWRITE << UAVOBJ_ACCESS_SHIFT |
			ACCESS_READWRITE << UAVOBJ_GCS_ACCESS_SHIFT |
			1 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
			1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
			UPDATEMODE_ONCHANGE << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
			UPDATEMODE_ONCHANGE << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
		metadata.telemetryUpdatePeriod = 0;
		metadata.gcsTelemetryUpdatePeriod = 0;
		metadata.loggingUpdatePeriod = 0;
		UAVObjSetMetadata(obj, &metadata);
	}
}
コード例 #7
0
/**
 * Initialize object fields and metadata with the default values.
 * If a default value is not specified the object fields
 * will be initialized to zero.
 */
void RevoSettingsSetDefaults(UAVObjHandle obj, uint16_t instId)
{
	RevoSettingsData data;
	UAVObjMetadata metadata;

	// Initialize object fields to their default values
	UAVObjGetInstanceData(obj, instId, &data);
	memset(&data, 0, sizeof(RevoSettingsData));
	data.FusionAlgorithm = 0;

	UAVObjSetInstanceData(obj, instId, &data);

	// Initialize object metadata to their default values
	metadata.flags =
		ACCESS_READWRITE << UAVOBJ_ACCESS_SHIFT |
		ACCESS_READWRITE << UAVOBJ_GCS_ACCESS_SHIFT |
		1 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
		1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
		UPDATEMODE_ONCHANGE << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
		UPDATEMODE_ONCHANGE << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
	metadata.telemetryUpdatePeriod = 0;
	metadata.gcsTelemetryUpdatePeriod = 0;
	metadata.loggingUpdatePeriod = 0;
	UAVObjSetMetadata(obj, &metadata);
}
コード例 #8
0
ファイル: uavobjecttemplate.c プロジェクト: Trex4Git/dRonin
/**
 * Initialize object fields and metadata with the default values.
 * If a default value is not specified the object fields
 * will be initialized to zero.
 */
void $(NAME)SetDefaults(UAVObjHandle obj, uint16_t instId)
{
	$(NAME)Data data;

	// Initialize object fields to their default values
	UAVObjGetInstanceData(obj, instId, &data);
	memset(&data, 0, sizeof($(NAME)Data));
$(INITFIELDS)
	UAVObjSetInstanceData(obj, instId, &data);

	// Initialize object metadata to their default values
	if (instId == 0) {
		UAVObjMetadata metadata;
		metadata.flags =
			$(FLIGHTACCESS) << UAVOBJ_ACCESS_SHIFT |
			$(GCSACCESS) << UAVOBJ_GCS_ACCESS_SHIFT |
			$(FLIGHTTELEM_ACKED) << UAVOBJ_TELEMETRY_ACKED_SHIFT |
			$(GCSTELEM_ACKED) << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
			$(FLIGHTTELEM_UPDATEMODE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
			$(GCSTELEM_UPDATEMODE) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
		metadata.telemetryUpdatePeriod = $(FLIGHTTELEM_UPDATEPERIOD);
		metadata.gcsTelemetryUpdatePeriod = $(GCSTELEM_UPDATEPERIOD);
		metadata.loggingUpdatePeriod = $(LOGGING_UPDATEPERIOD);
		UAVObjSetMetadata(obj, &metadata);
	}
}
コード例 #9
0
/**
 * Initialize object fields and metadata with the default values.
 * If a default value is not specified the object fields
 * will be initialized to zero.
 */
void HwFlyingF3SetDefaults(UAVObjHandle obj, uint16_t instId)
{
	HwFlyingF3Data data;
	UAVObjMetadata metadata;

	// Initialize object fields to their default values
	UAVObjGetInstanceData(obj, instId, &data);
	memset(&data, 0, sizeof(HwFlyingF3Data));
	data.RcvrPort = 1;
	data.Uart1 = 0;
	data.Uart2 = 0;
	data.Uart3 = 0;
	data.Uart4 = 0;
	data.Uart5 = 0;
	data.USB_HIDPort = 0;
	data.USB_VCPPort = 3;
	data.DSMxBind = 0;
	data.GyroRange = 1;
	data.AccelRange = 2;

	UAVObjSetInstanceData(obj, instId, &data);

	// Initialize object metadata to their default values
	metadata.flags =
		ACCESS_READWRITE << UAVOBJ_ACCESS_SHIFT |
		ACCESS_READWRITE << UAVOBJ_GCS_ACCESS_SHIFT |
		1 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
		1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
		UPDATEMODE_ONCHANGE << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
		UPDATEMODE_ONCHANGE << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
	metadata.telemetryUpdatePeriod = 0;
	metadata.gcsTelemetryUpdatePeriod = 0;
	metadata.loggingUpdatePeriod = 0;
	UAVObjSetMetadata(obj, &metadata);
}
コード例 #10
0
/**
 * Initialize object fields and metadata with the default values.
 * If a default value is not specified the object fields
 * will be initialized to zero.
 */
void RadioComBridgeStatsSetDefaults(UAVObjHandle obj, uint16_t instId)
{
    RadioComBridgeStatsData data;

    // Initialize object fields to their default values
    UAVObjGetInstanceData(obj, instId, &data);
    memset(&data, 0, sizeof(RadioComBridgeStatsData));

    UAVObjSetInstanceData(obj, instId, &data);

    // Initialize object metadata to their default values
    if (instId == 0) {
        UAVObjMetadata metadata;
        metadata.flags =
            ACCESS_READWRITE << UAVOBJ_ACCESS_SHIFT |
            ACCESS_READONLY << UAVOBJ_GCS_ACCESS_SHIFT |
            0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
            0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
            UPDATEMODE_PERIODIC << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
            UPDATEMODE_MANUAL << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
        metadata.telemetryUpdatePeriod = 5000;
        metadata.gcsTelemetryUpdatePeriod = 0;
        metadata.loggingUpdatePeriod = 0;
        UAVObjSetMetadata(obj, &metadata);
    }
}
コード例 #11
0
/**
 * Initialize object fields and metadata with the default values.
 * If a default value is not specified the object fields
 * will be initialized to zero.
 */
void AirspeedSettingsSetDefaults(UAVObjHandle obj, uint16_t instId)
{
	AirspeedSettingsData data;
	UAVObjMetadata metadata;

	// Initialize object fields to their default values
	UAVObjGetInstanceData(obj, instId, &data);
	memset(&data, 0, sizeof(AirspeedSettingsData));
	data.Scale = 1;
	data.ZeroPoint = 0;
	data.GPSSamplePeriod_ms = 100;
	data.AirspeedSensorType = 3;

	UAVObjSetInstanceData(obj, instId, &data);

	// Initialize object metadata to their default values
	metadata.flags =
		ACCESS_READWRITE << UAVOBJ_ACCESS_SHIFT |
		ACCESS_READWRITE << UAVOBJ_GCS_ACCESS_SHIFT |
		1 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
		1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
		UPDATEMODE_ONCHANGE << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
		UPDATEMODE_ONCHANGE << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
	metadata.telemetryUpdatePeriod = 0;
	metadata.gcsTelemetryUpdatePeriod = 0;
	metadata.loggingUpdatePeriod = 0;
	UAVObjSetMetadata(obj, &metadata);
}
コード例 #12
0
/**
 * Initialize object fields and metadata with the default values.
 * If a default value is not specified the object fields
 * will be initialized to zero.
 */
void FlightPlanControlSetDefaults(UAVObjHandle obj, uint16_t instId)
{
	FlightPlanControlData data;
	UAVObjMetadata metadata;

	// Initialize object fields to their default values
	UAVObjGetInstanceData(obj, instId, &data);
	memset(&data, 0, sizeof(FlightPlanControlData));
	data.Command = 0;

	UAVObjSetInstanceData(obj, instId, &data);

	// Initialize object metadata to their default values
	metadata.flags =
		ACCESS_READWRITE << UAVOBJ_ACCESS_SHIFT |
		ACCESS_READWRITE << UAVOBJ_GCS_ACCESS_SHIFT |
		1 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
		1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
		UPDATEMODE_MANUAL << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
		UPDATEMODE_MANUAL << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
	metadata.telemetryUpdatePeriod = 0;
	metadata.gcsTelemetryUpdatePeriod = 0;
	metadata.loggingUpdatePeriod = 0;
	UAVObjSetMetadata(obj, &metadata);
}
コード例 #13
0
/**
 * Initialize object fields and metadata with the default values.
 * If a default value is not specified the object fields
 * will be initialized to zero.
 */
static void setDefaults(UAVObjHandle obj, uint16_t instId)
{
	AttitudeSettingsData data;
	UAVObjMetadata metadata;

	// Initialize object fields to their default values
	UAVObjGetInstanceData(obj, instId, &data);
	memset(&data, 0, sizeof(AttitudeSettingsData));
	data.PitchBias = 0;
	data.RollBias = 0;

	UAVObjSetInstanceData(obj, instId, &data);

	// Initialize object metadata to their default values
	metadata.access = ACCESS_READWRITE;
	metadata.gcsAccess = ACCESS_READWRITE;
	metadata.telemetryAcked = 1;
	metadata.telemetryUpdateMode = UPDATEMODE_ONCHANGE;
	metadata.telemetryUpdatePeriod = 0;
	metadata.gcsTelemetryAcked = 1;
	metadata.gcsTelemetryUpdateMode = UPDATEMODE_ONCHANGE;
	metadata.gcsTelemetryUpdatePeriod = 0;
	metadata.loggingUpdateMode = UPDATEMODE_NEVER;
	metadata.loggingUpdatePeriod = 0;
	UAVObjSetMetadata(obj, &metadata);
}
コード例 #14
0
/**
 * Initialize object fields and metadata with the default values.
 * If a default value is not specified the object fields
 * will be initialized to zero.
 */
void VtolSelfTuningStatsSetDefaults(UAVObjHandle obj, uint16_t instId)
{
    VtolSelfTuningStatsData data;

    // Initialize object fields to their default values
    UAVObjGetInstanceData(obj, instId, &data);
    memset(&data, 0, sizeof(VtolSelfTuningStatsData));
    data.NeutralThrustOffset = 0.000000e+00f;
    data.NeutralThrustCorrection = 0.000000e+00f;
    data.NeutralThrustAccumulator = 0.000000e+00f;
    data.NeutralThrustRange = 0.000000e+00f;

    UAVObjSetInstanceData(obj, instId, &data);

    // Initialize object metadata to their default values
    if ( instId == 0 ) {
        UAVObjMetadata metadata;
        metadata.flags =
            ACCESS_READWRITE << UAVOBJ_ACCESS_SHIFT |
            ACCESS_READWRITE << UAVOBJ_GCS_ACCESS_SHIFT |
            0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
            0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
            UPDATEMODE_PERIODIC << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
            UPDATEMODE_MANUAL << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT |
            UPDATEMODE_MANUAL << UAVOBJ_LOGGING_UPDATE_MODE_SHIFT;
        metadata.telemetryUpdatePeriod = 1000;
        metadata.gcsTelemetryUpdatePeriod = 0;
        metadata.loggingUpdatePeriod = 0;
        UAVObjSetMetadata(obj, &metadata);
    }
}
コード例 #15
0
/**
 * Initialize object fields and metadata with the default values.
 * If a default value is not specified the object fields
 * will be initialized to zero.
 */
void FixedWingAirspeedsSetDefaults(UAVObjHandle obj, uint16_t instId)
{
	FixedWingAirspeedsData data;
	UAVObjMetadata metadata;

	// Initialize object fields to their default values
	UAVObjGetInstanceData(obj, instId, &data);
	memset(&data, 0, sizeof(FixedWingAirspeedsData));
	data.AirSpeedMax = 20;
	data.CruiseSpeed = 15;
	data.BestClimbRateSpeed = 11;
	data.StallSpeedClean = 8;
	data.StallSpeedDirty = 8;
	data.VerticalVelMax = 10;

	UAVObjSetInstanceData(obj, instId, &data);

	// Initialize object metadata to their default values
	metadata.flags =
		ACCESS_READWRITE << UAVOBJ_ACCESS_SHIFT |
		ACCESS_READWRITE << UAVOBJ_GCS_ACCESS_SHIFT |
		1 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
		1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
		UPDATEMODE_ONCHANGE << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
		UPDATEMODE_ONCHANGE << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
	metadata.telemetryUpdatePeriod = 0;
	metadata.gcsTelemetryUpdatePeriod = 0;
	metadata.loggingUpdatePeriod = 0;
	UAVObjSetMetadata(obj, &metadata);
}
コード例 #16
0
/**
 * Initialize object fields and metadata with the default values.
 * If a default value is not specified the object fields
 * will be initialized to zero.
 */
void SystemSettingsSetDefaults(UAVObjHandle obj, uint16_t instId)
{
	SystemSettingsData data;
	UAVObjMetadata metadata;

	// Initialize object fields to their default values
	UAVObjGetInstanceData(obj, instId, &data);
	memset(&data, 0, sizeof(SystemSettingsData));
	data.GUIConfigData[0] = 0;
	data.GUIConfigData[1] = 0;
	data.GUIConfigData[2] = 0;
	data.GUIConfigData[3] = 0;
	data.AirframeType = 5;

	UAVObjSetInstanceData(obj, instId, &data);

	// Initialize object metadata to their default values
	metadata.flags =
		ACCESS_READWRITE << UAVOBJ_ACCESS_SHIFT |
		ACCESS_READWRITE << UAVOBJ_GCS_ACCESS_SHIFT |
		1 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
		1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
		UPDATEMODE_ONCHANGE << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
		UPDATEMODE_ONCHANGE << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
	metadata.telemetryUpdatePeriod = 0;
	metadata.gcsTelemetryUpdatePeriod = 0;
	metadata.loggingUpdatePeriod = 0;
	UAVObjSetMetadata(obj, &metadata);
}
コード例 #17
0
/**
 * Initialize object fields and metadata with the default values.
 * If a default value is not specified the object fields
 * will be initialized to zero.
 */
void VtolPathFollowerSettingsSetDefaults(UAVObjHandle obj, uint16_t instId)
{
    VtolPathFollowerSettingsData data;

    // Initialize object fields to their default values
    UAVObjGetInstanceData(obj, instId, &data);
    memset(&data, 0, sizeof(VtolPathFollowerSettingsData));
    data.HorizontalPosPI[0] = 1;
    data.HorizontalPosPI[1] = 0;
    data.HorizontalPosPI[2] = 2;
    data.HorizontalVelPID[0] = 2.6;
    data.HorizontalVelPID[1] = 0.4;
    data.HorizontalVelPID[2] = 0;
    data.HorizontalVelPID[3] = 5;
    data.VelocityFeedforward = 0;
    data.PositionFeedforward = 0.45;
    data.EndpointDeadbandWidth = 0.45;
    data.EndpointDeadbandCenterGain = 0.3;
    data.PathDeadbandWidth = 1.25;
    data.PathDeadbandCenterGain = 0.1;
    data.MaxRollPitch = 20;
    data.EndpointRadius = 2;
    data.WaypointAltitudeTol = 2;
    data.UpdatePeriod = 50;
    data.LandingRate = 0.5;
    data.LoiterBrakingTimeConstant = 1.25;
    data.LoiterErrorDecayConstant = 0.15;
    data.LoiterLookaheadTimeConstant = 1.25;
    data.LoiterInitialMaxVel = 3.5;
    data.LoiterAttitudeFeedthrough = 15;
    data.ReturnToHomeVel = 3;
    data.HorizontalVelMax = 10;
    data.VerticalVelMax = 2;
    data.ThrottleControl = 0;
    data.VelocityChangePrediction = 0;
    data.YawMode = 1;
    data.LoiterAllowAltControl = 0;

    UAVObjSetInstanceData(obj, instId, &data);

    // Initialize object metadata to their default values
    if (instId == 0) {
        UAVObjMetadata metadata;
        metadata.flags =
            ACCESS_READWRITE << UAVOBJ_ACCESS_SHIFT |
            ACCESS_READWRITE << UAVOBJ_GCS_ACCESS_SHIFT |
            1 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
            1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
            UPDATEMODE_ONCHANGE << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
            UPDATEMODE_ONCHANGE << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
        metadata.telemetryUpdatePeriod = 0;
        metadata.gcsTelemetryUpdatePeriod = 0;
        metadata.loggingUpdatePeriod = 0;
        UAVObjSetMetadata(obj, &metadata);
    }
}
コード例 #18
0
/**
 * Initialize object fields and metadata with the default values.
 * If a default value is not specified the object fields
 * will be initialized to zero.
 */
void SystemSettingsSetDefaults(UAVObjHandle obj, uint16_t instId)
{
    SystemSettingsData data;

    // Initialize object fields to their default values
    UAVObjGetInstanceData(obj, instId, &data);
    memset(&data, 0, sizeof(SystemSettingsData));
    data.GUIConfigData[0] = 0;
    data.GUIConfigData[1] = 0;
    data.GUIConfigData[2] = 0;
    data.GUIConfigData[3] = 0;
    data.AirSpeedMax = 3.000000e+01f;
    data.AirSpeedMin = 1.000000e+01f;
    data.AirframeType = 5;
    data.VehicleName[0] = 0;
    data.VehicleName[1] = 0;
    data.VehicleName[2] = 0;
    data.VehicleName[3] = 0;
    data.VehicleName[4] = 0;
    data.VehicleName[5] = 0;
    data.VehicleName[6] = 0;
    data.VehicleName[7] = 0;
    data.VehicleName[8] = 0;
    data.VehicleName[9] = 0;
    data.VehicleName[10] = 0;
    data.VehicleName[11] = 0;
    data.VehicleName[12] = 0;
    data.VehicleName[13] = 0;
    data.VehicleName[14] = 0;
    data.VehicleName[15] = 0;
    data.VehicleName[16] = 0;
    data.VehicleName[17] = 0;
    data.VehicleName[18] = 0;
    data.VehicleName[19] = 0;
    data.ThrustControl = 0;

    UAVObjSetInstanceData(obj, instId, &data);

    // Initialize object metadata to their default values
    if ( instId == 0 ) {
        UAVObjMetadata metadata;
        metadata.flags =
            ACCESS_READWRITE << UAVOBJ_ACCESS_SHIFT |
            ACCESS_READWRITE << UAVOBJ_GCS_ACCESS_SHIFT |
            1 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
            1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
            UPDATEMODE_ONCHANGE << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
            UPDATEMODE_ONCHANGE << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT |
            UPDATEMODE_MANUAL << UAVOBJ_LOGGING_UPDATE_MODE_SHIFT;
        metadata.telemetryUpdatePeriod = 0;
        metadata.gcsTelemetryUpdatePeriod = 0;
        metadata.loggingUpdatePeriod = 0;
        UAVObjSetMetadata(obj, &metadata);
    }
}
コード例 #19
0
/**
 * Initialize object fields and metadata with the default values.
 * If a default value is not specified the object fields
 * will be initialized to zero.
 */
void OPLinkStatusSetDefaults(UAVObjHandle obj, uint16_t instId)
{
	OPLinkStatusData data;
	UAVObjMetadata metadata;

	// Initialize object fields to their default values
	UAVObjGetInstanceData(obj, instId, &data);
	memset(&data, 0, sizeof(OPLinkStatusData));
	data.DeviceID = 0;
	data.PairIDs[0] = 0;
	data.PairIDs[1] = 0;
	data.PairIDs[2] = 0;
	data.PairIDs[3] = 0;
	data.UAVTalkErrors = 0;
	data.TXRate = 0;
	data.RXRate = 0;
	data.TXSeq = 0;
	data.RXSeq = 0;
	data.RxGood = 0;
	data.RxCorrected = 0;
	data.RxErrors = 0;
	data.RxMissed = 0;
	data.RxFailure = 0;
	data.TxResent = 0;
	data.TxDropped = 0;
	data.TxFailure = 0;
	data.Resets = 0;
	data.Timeouts = 0;
	data.RSSI = 0;
	data.AFCCorrection = 0;
	data.LinkQuality = 0;
	data.LinkState = 0;
	data.PairSignalStrengths[0] = -127;
	data.PairSignalStrengths[1] = -127;
	data.PairSignalStrengths[2] = -127;
	data.PairSignalStrengths[3] = -127;

	UAVObjSetInstanceData(obj, instId, &data);

	// Initialize object metadata to their default values
	metadata.flags =
		ACCESS_READWRITE << UAVOBJ_ACCESS_SHIFT |
		ACCESS_READONLY << UAVOBJ_GCS_ACCESS_SHIFT |
		0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
		0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
		UPDATEMODE_PERIODIC << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
		UPDATEMODE_MANUAL << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
	metadata.telemetryUpdatePeriod = 1000;
	metadata.gcsTelemetryUpdatePeriod = 0;
	metadata.loggingUpdatePeriod = 1000;
	UAVObjSetMetadata(obj, &metadata);
}
コード例 #20
0
/**
 * Initialize object fields and metadata with the default values.
 * If a default value is not specified the object fields
 * will be initialized to zero.
 */
void FixedWingPathFollowerSettingsSetDefaults(UAVObjHandle obj, uint16_t instId)
{
	FixedWingPathFollowerSettingsData data;

	// Initialize object fields to their default values
	UAVObjGetInstanceData(obj, instId, &data);
	memset(&data, 0, sizeof(FixedWingPathFollowerSettingsData));
	data.HorizontalPosP = 0.6;
	data.VerticalPosP = 0.05;
	data.BearingPI[0] = 0.6;
	data.BearingPI[1] = 0;
	data.BearingPI[2] = 0;
	data.PowerPI[0] = 1.5;
	data.PowerPI[1] = 0.15;
	data.PowerPI[2] = 20;
	data.VerticalToPitchCrossFeed[0] = 5;
	data.VerticalToPitchCrossFeed[1] = 10;
	data.AirspeedToVerticalCrossFeed[0] = 10;
	data.AirspeedToVerticalCrossFeed[1] = 100;
	data.SpeedPI[0] = 0.01;
	data.SpeedPI[1] = 0.01;
	data.SpeedPI[2] = 0.8;
	data.RollLimit[0] = -35;
	data.RollLimit[1] = 0;
	data.RollLimit[2] = 35;
	data.PitchLimit[0] = -10;
	data.PitchLimit[1] = 0;
	data.PitchLimit[2] = 10;
	data.ThrottleLimit[0] = 0;
	data.ThrottleLimit[1] = 0.5;
	data.ThrottleLimit[2] = 1;
	data.OrbitRadius = 50;
	data.UpdatePeriod = 100;

	UAVObjSetInstanceData(obj, instId, &data);

	// Initialize object metadata to their default values
	if (instId == 0) {
		UAVObjMetadata metadata;
		metadata.flags =
			ACCESS_READWRITE << UAVOBJ_ACCESS_SHIFT |
			ACCESS_READWRITE << UAVOBJ_GCS_ACCESS_SHIFT |
			1 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
			1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
			UPDATEMODE_ONCHANGE << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
			UPDATEMODE_ONCHANGE << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
		metadata.telemetryUpdatePeriod = 0;
		metadata.gcsTelemetryUpdatePeriod = 0;
		metadata.loggingUpdatePeriod = 0;
		UAVObjSetMetadata(obj, &metadata);
	}
}
コード例 #21
0
/**
 * Initialize object fields and metadata with the default values.
 * If a default value is not specified the object fields
 * will be initialized to zero.
 */
void SensorSettingsSetDefaults(UAVObjHandle obj, uint16_t instId)
{
	SensorSettingsData data;
	UAVObjMetadata metadata;

	// Initialize object fields to their default values
	UAVObjGetInstanceData(obj, instId, &data);
	memset(&data, 0, sizeof(SensorSettingsData));
	data.AccelBias[0] = 0;
	data.AccelBias[1] = 0;
	data.AccelBias[2] = 0;
	data.AccelScale[0] = 1;
	data.AccelScale[1] = 1;
	data.AccelScale[2] = 1;
	data.GyroScale[0] = 1;
	data.GyroScale[1] = 1;
	data.GyroScale[2] = 1;
	data.XGyroTempCoeff[0] = 0;
	data.XGyroTempCoeff[1] = 0;
	data.XGyroTempCoeff[2] = 0;
	data.XGyroTempCoeff[3] = 0;
	data.YGyroTempCoeff[0] = 0;
	data.YGyroTempCoeff[1] = 0;
	data.YGyroTempCoeff[2] = 0;
	data.YGyroTempCoeff[3] = 0;
	data.ZGyroTempCoeff[0] = 0;
	data.ZGyroTempCoeff[1] = 0;
	data.ZGyroTempCoeff[2] = 0;
	data.ZGyroTempCoeff[3] = 0;
	data.MagBias[0] = 0;
	data.MagBias[1] = 0;
	data.MagBias[2] = 0;
	data.MagScale[0] = 1;
	data.MagScale[1] = 1;
	data.MagScale[2] = 1;
	data.ZAccelOffset = 0;

	UAVObjSetInstanceData(obj, instId, &data);

	// Initialize object metadata to their default values
	metadata.flags =
		ACCESS_READWRITE << UAVOBJ_ACCESS_SHIFT |
		ACCESS_READWRITE << UAVOBJ_GCS_ACCESS_SHIFT |
		1 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
		1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
		UPDATEMODE_ONCHANGE << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
		UPDATEMODE_ONCHANGE << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
	metadata.telemetryUpdatePeriod = 0;
	metadata.gcsTelemetryUpdatePeriod = 0;
	metadata.loggingUpdatePeriod = 0;
	UAVObjSetMetadata(obj, &metadata);
}
コード例 #22
0
/**
 * Initialize object fields and metadata with the default values.
 * If a default value is not specified the object fields
 * will be initialized to zero.
 */
void OsdSettingsSetDefaults(UAVObjHandle obj, uint16_t instId)
{
    OsdSettingsData data;

    // Initialize object fields to their default values
    UAVObjGetInstanceData(obj, instId, &data);
    memset(&data, 0, sizeof(OsdSettingsData));
    data.AttitudeSetup.X = 168;
    data.AttitudeSetup.Y = 135;
    data.TimeSetup.X = 10;
    data.TimeSetup.Y = 250;
    data.BatterySetup.X = 316;
    data.BatterySetup.Y = 210;
    data.SpeedSetup.X = 2;
    data.SpeedSetup.Y = 145;
    data.AltitudeSetup.X = 2;
    data.AltitudeSetup.Y = 145;
    data.HeadingSetup.X = 168;
    data.HeadingSetup.Y = 240;
    data.Attitude = 1;
    data.Time = 1;
    data.Battery = 1;
    data.Speed = 1;
    data.Altitude = 1;
    data.Heading = 1;
    data.Screen = 0;
    data.White = 4;
    data.Black = 1;
    data.AltitudeSource = 0;

    UAVObjSetInstanceData(obj, instId, &data);

    // Initialize object metadata to their default values
    if ( instId == 0 ) {
        UAVObjMetadata metadata;
        metadata.flags =
            ACCESS_READWRITE << UAVOBJ_ACCESS_SHIFT |
            ACCESS_READWRITE << UAVOBJ_GCS_ACCESS_SHIFT |
            1 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
            1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
            UPDATEMODE_ONCHANGE << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
            UPDATEMODE_ONCHANGE << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT |
            UPDATEMODE_MANUAL << UAVOBJ_LOGGING_UPDATE_MODE_SHIFT;
        metadata.telemetryUpdatePeriod = 0;
        metadata.gcsTelemetryUpdatePeriod = 0;
        metadata.loggingUpdatePeriod = 0;
        UAVObjSetMetadata(obj, &metadata);
    }
}
コード例 #23
0
ファイル: pipxstatus.c プロジェクト: AlessioMorale/op_overo
/**
 * Initialize object fields and metadata with the default values.
 * If a default value is not specified the object fields
 * will be initialized to zero.
 */
void PipXStatusSetDefaults(UAVObjHandle obj, uint16_t instId)
{
	PipXStatusData data;
	UAVObjMetadata metadata;

	// Initialize object fields to their default values
	UAVObjGetInstanceData(obj, instId, &data);
	memset(&data, 0, sizeof(PipXStatusData));
	data.MinFrequency = 0;
	data.MaxFrequency = 0;
	data.FrequencyStepSize = 0;
	data.DeviceID = 0;
	data.AFC = 0;
	data.PairIDs[0] = 0;
	data.PairIDs[1] = 0;
	data.PairIDs[2] = 0;
	data.PairIDs[3] = 0;
	data.Retries = 0;
	data.Errors = 0;
	data.UAVTalkErrors = 0;
	data.Dropped = 0;
	data.Resets = 0;
	data.TXRate = 0;
	data.RXRate = 0;
	data.FrequencyBand = 0;
	data.RSSI = 0;
	data.LinkState = 0;
	data.PairSignalStrengths[0] = -127;
	data.PairSignalStrengths[1] = -127;
	data.PairSignalStrengths[2] = -127;
	data.PairSignalStrengths[3] = -127;

	UAVObjSetInstanceData(obj, instId, &data);

	// Initialize object metadata to their default values
	metadata.flags =
		ACCESS_READWRITE << UAVOBJ_ACCESS_SHIFT |
		ACCESS_READONLY << UAVOBJ_GCS_ACCESS_SHIFT |
		0 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
		0 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
		UPDATEMODE_MANUAL << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
		UPDATEMODE_MANUAL << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
	metadata.telemetryUpdatePeriod = 0;
	metadata.gcsTelemetryUpdatePeriod = 0;
	metadata.loggingUpdatePeriod = 1000;
	UAVObjSetMetadata(obj, &metadata);
}
コード例 #24
0
/**
 * Initialize object fields and metadata with the default values.
 * If a default value is not specified the object fields
 * will be initialized to zero.
 */
void VtolPathFollowerSettingsSetDefaults(UAVObjHandle obj, uint16_t instId)
{
	VtolPathFollowerSettingsData data;
	UAVObjMetadata metadata;

	// Initialize object fields to their default values
	UAVObjGetInstanceData(obj, instId, &data);
	memset(&data, 0, sizeof(VtolPathFollowerSettingsData));
	data.HorizontalPosPI[0] = 1;
	data.HorizontalPosPI[1] = 0;
	data.HorizontalPosPI[2] = 0;
	data.HorizontalVelPID[0] = 5;
	data.HorizontalVelPID[1] = 0;
	data.HorizontalVelPID[2] = 1;
	data.HorizontalVelPID[3] = 0;
	data.VerticalPosPI[0] = 0.1;
	data.VerticalPosPI[1] = 0.001;
	data.VerticalPosPI[2] = 200;
	data.VerticalVelPID[0] = 0.1;
	data.VerticalVelPID[1] = 0;
	data.VerticalVelPID[2] = 0;
	data.VerticalVelPID[3] = 0;
	data.VelocityFeedforward = 0;
	data.MaxRollPitch = 20;
	data.UpdatePeriod = 100;
	data.HorizontalVelMax = 10;
	data.VerticalVelMax = 1;
	data.GuidanceMode = 0;
	data.ThrottleControl = 0;
	data.VelocitySource = 0;
	data.PositionSource = 0;

	UAVObjSetInstanceData(obj, instId, &data);

	// Initialize object metadata to their default values
	metadata.flags =
		ACCESS_READWRITE << UAVOBJ_ACCESS_SHIFT |
		ACCESS_READWRITE << UAVOBJ_GCS_ACCESS_SHIFT |
		1 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
		1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
		UPDATEMODE_ONCHANGE << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
		UPDATEMODE_ONCHANGE << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
	metadata.telemetryUpdatePeriod = 0;
	metadata.gcsTelemetryUpdatePeriod = 0;
	metadata.loggingUpdatePeriod = 0;
	UAVObjSetMetadata(obj, &metadata);
}
コード例 #25
0
/**
 * Initialize object fields and metadata with the default values.
 * If a default value is not specified the object fields
 * will be initialized to zero.
 */
void I2CVMUserProgramSetDefaults(UAVObjHandle obj, uint16_t instId)
{
	I2CVMUserProgramData data;

	// Initialize object fields to their default values
	UAVObjGetInstanceData(obj, instId, &data);
	memset(&data, 0, sizeof(I2CVMUserProgramData));
	data.Program[0] = 134676490;
	data.Program[1] = 84541440;
	data.Program[2] = 84607232;
	data.Program[3] = 84673024;
	data.Program[4] = 84738816;
	data.Program[5] = 117441025;
	data.Program[6] = 117441282;
	data.Program[7] = 117441539;
	data.Program[8] = 100663812;
	data.Program[9] = 100664069;
	data.Program[10] = 100664326;
	data.Program[11] = 385875968;
	data.Program[12] = 168296447;
	data.Program[13] = 33554452;
	data.Program[14] = 50855927;
	data.Program[15] = 0;
	data.Program[16] = 0;
	data.Program[17] = 0;
	data.Program[18] = 0;
	data.Program[19] = 0;

	UAVObjSetInstanceData(obj, instId, &data);

	// Initialize object metadata to their default values
	if (instId == 0) {
		UAVObjMetadata metadata;
		metadata.flags =
			ACCESS_READWRITE << UAVOBJ_ACCESS_SHIFT |
			ACCESS_READWRITE << UAVOBJ_GCS_ACCESS_SHIFT |
			1 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
			1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
			UPDATEMODE_ONCHANGE << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
			UPDATEMODE_ONCHANGE << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
		metadata.telemetryUpdatePeriod = 0;
		metadata.gcsTelemetryUpdatePeriod = 0;
		metadata.loggingUpdatePeriod = 0;
		UAVObjSetMetadata(obj, &metadata);
	}
}
コード例 #26
0
/**
 * Initialize object fields and metadata with the default values.
 * If a default value is not specified the object fields
 * will be initialized to zero.
 */
void ModuleSettingsSetDefaults(UAVObjHandle obj, uint16_t instId)
{
	ModuleSettingsData data;
	UAVObjMetadata metadata;

	// Initialize object fields to their default values
	UAVObjGetInstanceData(obj, instId, &data);
	memset(&data, 0, sizeof(ModuleSettingsData));
	data.AdminState[0] = 0;
	data.AdminState[1] = 0;
	data.AdminState[2] = 0;
	data.AdminState[3] = 0;
	data.AdminState[4] = 0;
	data.AdminState[5] = 0;
	data.AdminState[6] = 0;
	data.AdminState[7] = 0;
	data.AdminState[8] = 0;
	data.AdminState[9] = 0;
	data.AdminState[10] = 0;
	data.AdminState[11] = 0;
	data.AdminState[12] = 0;
	data.AdminState[13] = 0;
	data.AdminState[14] = 0;
	data.AdminState[15] = 0;
	data.TelemetrySpeed = 5;
	data.GPSSpeed = 5;
	data.GPSDataProtocol = 1;
	data.ComUsbBridgeSpeed = 5;
	data.I2CVMProgramSelect = 2;

	UAVObjSetInstanceData(obj, instId, &data);

	// Initialize object metadata to their default values
	metadata.flags =
		ACCESS_READWRITE << UAVOBJ_ACCESS_SHIFT |
		ACCESS_READWRITE << UAVOBJ_GCS_ACCESS_SHIFT |
		1 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
		1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
		UPDATEMODE_ONCHANGE << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
		UPDATEMODE_ONCHANGE << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
	metadata.telemetryUpdatePeriod = 0;
	metadata.gcsTelemetryUpdatePeriod = 0;
	metadata.loggingUpdatePeriod = 0;
	UAVObjSetMetadata(obj, &metadata);
}
コード例 #27
0
/**
 * Initialize object fields and metadata with the default values.
 * If a default value is not specified the object fields
 * will be initialized to zero.
 */
static void setDefaults(UAVObjHandle obj, uint16_t instId)
{
	HomeLocationData data;
	UAVObjMetadata metadata;

	// Initialize object fields to their default values
	UAVObjGetInstanceData(obj, instId, &data);
	memset(&data, 0, sizeof(HomeLocationData));
	data.Set = 0;
	data.Indoor = 0;
	data.Latitude = 0;
	data.Longitude = 0;
	data.Altitude = 0;
	data.ECEF[0] = 0;
	data.ECEF[1] = 0;
	data.ECEF[2] = 0;
	data.RNE[0] = 0;
	data.RNE[1] = 0;
	data.RNE[2] = 0;
	data.RNE[3] = 0;
	data.RNE[4] = 0;
	data.RNE[5] = 0;
	data.RNE[6] = 0;
	data.RNE[7] = 0;
	data.RNE[8] = 0;
	data.Be[0] = 0;
	data.Be[1] = 0;
	data.Be[2] = 0;

	UAVObjSetInstanceData(obj, instId, &data);

	// Initialize object metadata to their default values
	metadata.access = ACCESS_READWRITE;
	metadata.gcsAccess = ACCESS_READWRITE;
	metadata.telemetryAcked = 1;
	metadata.telemetryUpdateMode = UPDATEMODE_ONCHANGE;
	metadata.telemetryUpdatePeriod = 0;
	metadata.gcsTelemetryAcked = 1;
	metadata.gcsTelemetryUpdateMode = UPDATEMODE_ONCHANGE;
	metadata.gcsTelemetryUpdatePeriod = 0;
	metadata.loggingUpdateMode = UPDATEMODE_NEVER;
	metadata.loggingUpdatePeriod = 0;
	UAVObjSetMetadata(obj, &metadata);
}
コード例 #28
0
ファイル: hwaq32.c プロジェクト: TauLabs/overo-datalogger
/**
 * Initialize object fields and metadata with the default values.
 * If a default value is not specified the object fields
 * will be initialized to zero.
 */
void HwAQ32SetDefaults(UAVObjHandle obj, uint16_t instId)
{
	HwAQ32Data data;

	// Initialize object fields to their default values
	UAVObjGetInstanceData(obj, instId, &data);
	memset(&data, 0, sizeof(HwAQ32Data));
	data.RcvrPort = 0;
	data.Uart1 = 0;
	data.Uart2 = 0;
	data.Uart3 = 0;
	data.Uart4 = 0;
	data.Uart6 = 0;
	data.ADCInputs = 0;
	data.USB_HIDPort = 0;
	data.USB_VCPPort = 4;
	data.DSMxMode = 0;
	data.GyroRange = 1;
	data.AccelRange = 2;
	data.MPU6000Rate = 3;
	data.MPU6000DLPF = 0;
	data.Magnetometer = 0;
	data.ExtMagOrientation = 0;

	UAVObjSetInstanceData(obj, instId, &data);

	// Initialize object metadata to their default values
	if (instId == 0) {
		UAVObjMetadata metadata;
		metadata.flags =
			ACCESS_READWRITE << UAVOBJ_ACCESS_SHIFT |
			ACCESS_READWRITE << UAVOBJ_GCS_ACCESS_SHIFT |
			1 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
			1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
			UPDATEMODE_ONCHANGE << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
			UPDATEMODE_ONCHANGE << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
		metadata.telemetryUpdatePeriod = 0;
		metadata.gcsTelemetryUpdatePeriod = 0;
		metadata.loggingUpdatePeriod = 0;
		UAVObjSetMetadata(obj, &metadata);
	}
}
コード例 #29
0
static bool enableHil(bool enable)
{
	// READ-ONLY flag write to ActuatorCommand
	UAVObjHandle handle = ActuatorCommandHandle();

	UAVObjMetadata commandMeta;
	UAVObjGetMetadata(handle, &commandMeta);

	if (enable)
	{
		// Disable actuators
		commandMeta.access = ACCESS_READONLY;
	}
	else
	{
		// Enable actuators
		commandMeta.access = ACCESS_READWRITE;
	}

	return (UAVObjSetMetadata(handle, &commandMeta) == 0);
}
コード例 #30
0
/**
 * Initialize object fields and metadata with the default values.
 * If a default value is not specified the object fields
 * will be initialized to zero.
 */
void AttitudeSettingsSetDefaults(UAVObjHandle obj, uint16_t instId)
{
	AttitudeSettingsData data;

	// Initialize object fields to their default values
	UAVObjGetInstanceData(obj, instId, &data);
	memset(&data, 0, sizeof(AttitudeSettingsData));
	data.MagKp = 0.05;
	data.MagKi = 0.0001;
	data.AccelKp = 0.05;
	data.AccelKi = 0.0001;
	data.AccelTau = 0.1;
	data.VertPositionTau = 2;
	data.YawBiasRate = 1e-06;
	data.BoardRotation[0] = 0;
	data.BoardRotation[1] = 0;
	data.BoardRotation[2] = 0;
	data.ZeroDuringArming = 1;
	data.BiasCorrectGyro = 1;
	data.FilterChoice = 0;

	UAVObjSetInstanceData(obj, instId, &data);

	// Initialize object metadata to their default values
	if (instId == 0) {
		UAVObjMetadata metadata;
		metadata.flags =
			ACCESS_READWRITE << UAVOBJ_ACCESS_SHIFT |
			ACCESS_READWRITE << UAVOBJ_GCS_ACCESS_SHIFT |
			1 << UAVOBJ_TELEMETRY_ACKED_SHIFT |
			1 << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
			UPDATEMODE_ONCHANGE << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
			UPDATEMODE_ONCHANGE << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
		metadata.telemetryUpdatePeriod = 0;
		metadata.gcsTelemetryUpdatePeriod = 0;
		metadata.loggingUpdatePeriod = 0;
		UAVObjSetMetadata(obj, &metadata);
	}
}