本文整理汇总了C++中UAVObjSetInstanceData函数的典型用法代码示例。如果您正苦于以下问题:C++ UAVObjSetInstanceData函数的具体用法?C++ UAVObjSetInstanceData怎么用?C++ UAVObjSetInstanceData使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了UAVObjSetInstanceData函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: VibrationAnalysisOutputSetDefaults
/**
* 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: HwFlyingF3SetDefaults
/**
* 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);
}
示例3: DebugLogSettingsSetDefaults
/**
* 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);
}
}
示例4: AirspeedSettingsSetDefaults
/**
* 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);
}
示例5: FlightPlanControlSetDefaults
/**
* 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);
}
示例6: HomeLocationSetDefaults
/**
* 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);
}
示例7: RadioComBridgeStatsSetDefaults
/**
* 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);
}
}
示例8: setDefaults
/**
* 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);
}
示例9: VtolSelfTuningStatsSetDefaults
/**
* 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);
}
}
示例10: FixedWingAirspeedsSetDefaults
/**
* 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);
}
示例11: UAVObjGetInstanceData
/**
* 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);
}
}
示例12: AirspeedSettingsSetDefaults
/**
* 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);
}
}
示例13: SystemSettingsSetDefaults
/**
* 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);
}
示例14: ReceiverActivitySetDefaults
/**
* 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);
}
示例15: GeoFenceSettingsSetDefaults
/**
* 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);
}
}