本文整理汇总了C++中UAVObjGetByID函数的典型用法代码示例。如果您正苦于以下问题:C++ UAVObjGetByID函数的具体用法?C++ UAVObjGetByID怎么用?C++ UAVObjGetByID使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了UAVObjGetByID函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RadioComBridgeStart
/**
* @brief Start the module
*
* @return -1 if initialisation failed, 0 on success
*/
static int32_t RadioComBridgeStart(void)
{
if (data) {
// Check if this is the coordinator modem
data->isCoordinator = PIOS_RFM22B_IsCoordinator(PIOS_COM_RFM22B);
// Parse UAVTalk out of the link
data->parseUAVTalk = true;
// Configure our UAVObjects for updates.
UAVObjConnectQueue(UAVObjGetByID(RFM22BSTATUS_OBJID), data->uavtalkEventQueue,
EV_UPDATED | EV_UPDATED_MANUAL | EV_UPDATE_REQ);
UAVObjConnectQueue(UAVObjGetByID(OBJECTPERSISTENCE_OBJID), data->uavtalkEventQueue,
EV_UPDATED | EV_UPDATED_MANUAL);
if (data->isCoordinator) {
UAVObjConnectQueue(UAVObjGetByID(RFM22BRECEIVER_OBJID), data->radioEventQueue,
EV_UPDATED | EV_UPDATED_MANUAL | EV_UPDATE_REQ);
} else {
UAVObjConnectQueue(UAVObjGetByID(RFM22BRECEIVER_OBJID), data->uavtalkEventQueue,
EV_UPDATED | EV_UPDATED_MANUAL | EV_UPDATE_REQ);
}
if (data->isCoordinator) {
registerObject(RadioComBridgeStatsHandle());
}
// Configure the UAVObject callbacks
ObjectPersistenceConnectCallback(&objectPersistenceUpdatedCb);
// Start the primary tasks for receiving/sending UAVTalk packets from the GCS.
data->telemetryTxTaskHandle = PIOS_Thread_Create(telemetryTxTask, "telemetryTxTask", STACK_SIZE_BYTES, NULL, TASK_PRIORITY);
data->telemetryRxTaskHandle = PIOS_Thread_Create(telemetryRxTask, "telemetryRxTask", STACK_SIZE_BYTES, NULL, TASK_PRIORITY);
if (PIOS_PPM_RECEIVER != 0) {
data->PPMInputTaskHandle = PIOS_Thread_Create(PPMInputTask, "PPMInputTask",STACK_SIZE_BYTES, NULL, TASK_PRIORITY);
#ifdef PIOS_INCLUDE_WDG
PIOS_WDG_RegisterFlag(PIOS_WDG_PPMINPUT);
#endif
}
if (!data->parseUAVTalk) {
// If the user wants raw serial communication, we need to spawn another thread to handle it.
data->serialRxTaskHandle = PIOS_Thread_Create(serialRxTask, "serialRxTask", STACK_SIZE_BYTES, NULL, TASK_PRIORITY);
#ifdef PIOS_INCLUDE_WDG
PIOS_WDG_RegisterFlag(PIOS_WDG_SERIALRX);
#endif
}
data->radioTxTaskHandle = PIOS_Thread_Create(radioTxTask, "radioTxTask", STACK_SIZE_BYTES, NULL, TASK_PRIORITY);
data->radioRxTaskHandle = PIOS_Thread_Create(radioRxTask, "radioRxTask", STACK_SIZE_BYTES, NULL, TASK_PRIORITY);
// Register the watchdog timers.
#ifdef PIOS_INCLUDE_WDG
PIOS_WDG_RegisterFlag(PIOS_WDG_TELEMETRYTX);
PIOS_WDG_RegisterFlag(PIOS_WDG_TELEMETRYRX);
PIOS_WDG_RegisterFlag(PIOS_WDG_RADIOTX);
PIOS_WDG_RegisterFlag(PIOS_WDG_RADIORX);
#endif
return 0;
}
return -1;
}
示例2: VtolSelfTuningStatsInitialize
/**
* Initialize object.
* \return 0 Success
* \return -1 Failure to initialize or -2 for already initialized
*/
int32_t VtolSelfTuningStatsInitialize(void)
{
// Compile time assertion that the VtolSelfTuningStatsDataPacked and VtolSelfTuningStatsData structs
// have the same size (though instances of VtolSelfTuningStatsData
// should be placed in memory by the linker/compiler on a 4 byte alignment).
PIOS_STATIC_ASSERT(sizeof(VtolSelfTuningStatsDataPacked) == sizeof(VtolSelfTuningStatsData));
// Don't set the handle to null if already registered
if (UAVObjGetByID(VTOLSELFTUNINGSTATS_OBJID)) {
return -2;
}
// Register object with the object manager
handle = UAVObjRegister(VTOLSELFTUNINGSTATS_OBJID,
VTOLSELFTUNINGSTATS_ISSINGLEINST, VTOLSELFTUNINGSTATS_ISSETTINGS, VTOLSELFTUNINGSTATS_ISPRIORITY, VTOLSELFTUNINGSTATS_NUMBYTES, &VtolSelfTuningStatsSetDefaults);
// Done
return handle ? 0 : -1;
}
示例3: FlightTelemetryStatsInitialize
/**
* Initialize object.
* \return 0 Success
* \return -1 Failure to initialize or -2 for already initialized
*/
int32_t FlightTelemetryStatsInitialize(void)
{
// Compile time assertion that the FlightTelemetryStatsDataPacked and FlightTelemetryStatsData structs
// have the same size (though instances of FlightTelemetryStatsData
// should be placed in memory by the linker/compiler on a 4 byte alignment).
PIOS_STATIC_ASSERT(sizeof(FlightTelemetryStatsDataPacked) == sizeof(FlightTelemetryStatsData));
// Don't set the handle to null if already registered
if (UAVObjGetByID(FLIGHTTELEMETRYSTATS_OBJID)) {
return -2;
}
// Register object with the object manager
handle = UAVObjRegister(FLIGHTTELEMETRYSTATS_OBJID,
FLIGHTTELEMETRYSTATS_ISSINGLEINST, FLIGHTTELEMETRYSTATS_ISSETTINGS, FLIGHTTELEMETRYSTATS_ISPRIORITY, FLIGHTTELEMETRYSTATS_NUMBYTES, &FlightTelemetryStatsSetDefaults);
// Done
return handle ? 0 : -1;
}
示例4: EKFConfigurationInitialize
/**
* Initialize object.
* \return 0 Success
* \return -1 Failure to initialize or -2 for already initialized
*/
int32_t EKFConfigurationInitialize(void)
{
// Compile time assertion that the EKFConfigurationDataPacked and EKFConfigurationData structs
// have the same size (though instances of EKFConfigurationData
// should be placed in memory by the linker/compiler on a 4 byte alignment).
PIOS_STATIC_ASSERT(sizeof(EKFConfigurationDataPacked) == sizeof(EKFConfigurationData));
// Don't set the handle to null if already registered
if (UAVObjGetByID(EKFCONFIGURATION_OBJID)) {
return -2;
}
// Register object with the object manager
handle = UAVObjRegister(EKFCONFIGURATION_OBJID,
EKFCONFIGURATION_ISSINGLEINST, EKFCONFIGURATION_ISSETTINGS, EKFCONFIGURATION_ISPRIORITY, EKFCONFIGURATION_NUMBYTES, &EKFConfigurationSetDefaults);
// Done
return handle ? 0 : -1;
}
示例5: PositionStateInitialize
/**
* Initialize object.
* \return 0 Success
* \return -1 Failure to initialize or -2 for already initialized
*/
int32_t PositionStateInitialize(void)
{
// Compile time assertion that the PositionStateDataPacked and PositionStateData structs
// have the same size (though instances of PositionStateData
// should be placed in memory by the linker/compiler on a 4 byte alignment).
PIOS_STATIC_ASSERT(sizeof(PositionStateDataPacked) == sizeof(PositionStateData));
// Don't set the handle to null if already registered
if (UAVObjGetByID(POSITIONSTATE_OBJID)) {
return -2;
}
// Register object with the object manager
handle = UAVObjRegister(POSITIONSTATE_OBJID,
POSITIONSTATE_ISSINGLEINST, POSITIONSTATE_ISSETTINGS, POSITIONSTATE_ISPRIORITY, POSITIONSTATE_NUMBYTES, &PositionStateSetDefaults);
// Done
return handle ? 0 : -1;
}
示例6: SystemSettingsInitialize
/**
* Initialize object.
* \return 0 Success
* \return -1 Failure to initialize or -2 for already initialized
*/
int32_t SystemSettingsInitialize(void)
{
// Compile time assertion that the SystemSettingsDataPacked and SystemSettingsData structs
// have the same size (though instances of SystemSettingsData
// should be placed in memory by the linker/compiler on a 4 byte alignment).
PIOS_STATIC_ASSERT(sizeof(SystemSettingsDataPacked) == sizeof(SystemSettingsData));
// Don't set the handle to null if already registered
if (UAVObjGetByID(SYSTEMSETTINGS_OBJID)) {
return -2;
}
// Register object with the object manager
handle = UAVObjRegister(SYSTEMSETTINGS_OBJID,
SYSTEMSETTINGS_ISSINGLEINST, SYSTEMSETTINGS_ISSETTINGS, SYSTEMSETTINGS_ISPRIORITY, SYSTEMSETTINGS_NUMBYTES, &SystemSettingsSetDefaults);
// Done
return handle ? 0 : -1;
}
示例7: AccelSensorInitialize
/**
* Initialize object.
* \return 0 Success
* \return -1 Failure to initialize or -2 for already initialized
*/
int32_t AccelSensorInitialize(void)
{
// Compile time assertion that the AccelSensorDataPacked and AccelSensorData structs
// have the same size (though instances of AccelSensorData
// should be placed in memory by the linker/compiler on a 4 byte alignment).
PIOS_STATIC_ASSERT(sizeof(AccelSensorDataPacked) == sizeof(AccelSensorData));
// Don't set the handle to null if already registered
if (UAVObjGetByID(ACCELSENSOR_OBJID)) {
return -2;
}
// Register object with the object manager
handle = UAVObjRegister(ACCELSENSOR_OBJID,
ACCELSENSOR_ISSINGLEINST, ACCELSENSOR_ISSETTINGS, ACCELSENSOR_ISPRIORITY, ACCELSENSOR_NUMBYTES, &AccelSensorSetDefaults);
// Done
return handle ? 0 : -1;
}
示例8: HwFlyingF3Initialize
/**
* Initialize object.
* \return 0 Success
* \return -1 Failure to initialize or -2 for already initialized
*/
int32_t HwFlyingF3Initialize(void)
{
// Don't set the handle to null if already registered
if(UAVObjGetByID(HWFLYINGF3_OBJID) != NULL)
return -2;
// Register object with the object manager
handle = UAVObjRegister(HWFLYINGF3_OBJID,
HWFLYINGF3_ISSINGLEINST, HWFLYINGF3_ISSETTINGS, HWFLYINGF3_NUMBYTES, &HwFlyingF3SetDefaults);
// Done
if (handle != 0)
{
return 0;
}
else
{
return -1;
}
}
示例9: WaypointInitialize
/**
* Initialize object.
* \return 0 Success
* \return -1 Failure to initialize or -2 for already initialized
*/
int32_t WaypointInitialize(void)
{
// Don't set the handle to null if already registered
if(UAVObjGetByID(WAYPOINT_OBJID) != NULL)
return -2;
// Register object with the object manager
handle = UAVObjRegister(WAYPOINT_OBJID,
WAYPOINT_ISSINGLEINST, WAYPOINT_ISSETTINGS, WAYPOINT_NUMBYTES, &WaypointSetDefaults);
// Done
if (handle != 0)
{
return 0;
}
else
{
return -1;
}
}
示例10: UAVObjRegister
/**
* Initialize object.
* \return 0 Success
* \return -1 Failure to initialize or -2 for already initialized
*/
int32_t $(NAME)Initialize(void)
{
// Don't set the handle to null if already registered
if(UAVObjGetByID($(NAMEUC)_OBJID) != NULL)
return -2;
// Register object with the object manager
handle = UAVObjRegister($(NAMEUC)_OBJID,
$(NAMEUC)_ISSINGLEINST, $(NAMEUC)_ISSETTINGS, $(NAMEUC)_NUMBYTES, &$(NAME)SetDefaults);
// Done
if (handle != 0)
{
return 0;
}
else
{
return -1;
}
}
示例11: BaroAltitudeInitialize
/**
* Initialize object.
* \return 0 Success
* \return -1 Failure to initialize or -2 for already initialized
*/
int32_t BaroAltitudeInitialize(void)
{
// Don't set the handle to null if already registered
if(UAVObjGetByID(BAROALTITUDE_OBJID) != NULL)
return -2;
// Register object with the object manager
handle = UAVObjRegister(BAROALTITUDE_OBJID,
BAROALTITUDE_ISSINGLEINST, BAROALTITUDE_ISSETTINGS, BAROALTITUDE_NUMBYTES, &BaroAltitudeSetDefaults);
// Done
if (handle != 0)
{
return 0;
}
else
{
return -1;
}
}
示例12: HomeLocationInitialize
/**
* Initialize object.
* \return 0 Success
* \return -1 Failure to initialize or -2 for already initialized
*/
int32_t HomeLocationInitialize(void)
{
// Don't set the handle to null if already registered
if(UAVObjGetByID(HOMELOCATION_OBJID) != NULL)
return -2;
// Register object with the object manager
handle = UAVObjRegister(HOMELOCATION_OBJID,
HOMELOCATION_ISSINGLEINST, HOMELOCATION_ISSETTINGS, HOMELOCATION_NUMBYTES, &HomeLocationSetDefaults);
// Done
if (handle != 0)
{
return 0;
}
else
{
return -1;
}
}
示例13: OPLinkReceiverInitialize
/**
* Initialize object.
* \return 0 Success
* \return -1 Failure to initialize or -2 for already initialized
*/
int32_t OPLinkReceiverInitialize(void)
{
// Don't set the handle to null if already registered
if(UAVObjGetByID(OPLINKRECEIVER_OBJID) != NULL)
return -2;
// Register object with the object manager
handle = UAVObjRegister(OPLINKRECEIVER_OBJID,
OPLINKRECEIVER_ISSINGLEINST, OPLINKRECEIVER_ISSETTINGS, OPLINKRECEIVER_NUMBYTES, &OPLinkReceiverSetDefaults);
// Done
if (handle != 0)
{
return 0;
}
else
{
return -1;
}
}
示例14: GCSTelemetryStatsInitialize
/**
* Initialize object.
* \return 0 Success
* \return -1 Failure to initialize or -2 for already initialized
*/
int32_t GCSTelemetryStatsInitialize(void)
{
// Don't set the handle to null if already registered
if(UAVObjGetByID(GCSTELEMETRYSTATS_OBJID) != NULL)
return -2;
// Register object with the object manager
handle = UAVObjRegister(GCSTELEMETRYSTATS_OBJID,
GCSTELEMETRYSTATS_ISSINGLEINST, GCSTELEMETRYSTATS_ISSETTINGS, GCSTELEMETRYSTATS_NUMBYTES, &GCSTelemetryStatsSetDefaults);
// Done
if (handle != 0)
{
return 0;
}
else
{
return -1;
}
}
示例15: AttitudeSimulatedInitialize
/**
* Initialize object.
* \return 0 Success
* \return -1 Failure to initialize or -2 for already initialized
*/
int32_t AttitudeSimulatedInitialize(void)
{
// Don't set the handle to null if already registered
if(UAVObjGetByID(ATTITUDESIMULATED_OBJID) != NULL)
return -2;
// Register object with the object manager
handle = UAVObjRegister(ATTITUDESIMULATED_OBJID,
ATTITUDESIMULATED_ISSINGLEINST, ATTITUDESIMULATED_ISSETTINGS, ATTITUDESIMULATED_NUMBYTES, &AttitudeSimulatedSetDefaults);
// Done
if (handle != 0)
{
return 0;
}
else
{
return -1;
}
}