Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Friends
Crazyflie Class Reference

#include <Crazyflie.h>

List of all members.

Classes

struct  batchRequest
struct  logInfo
struct  LogTocEntry
struct  paramInfo
struct  ParamTocEntry
union  ParamValue

Public Types

enum  BootloaderTarget { TargetSTM32 = 0xFF, TargetNRF51 = 0xFE }
enum  LogType {
  LogTypeUint8 = 1, LogTypeUint16 = 2, LogTypeUint32 = 3, LogTypeInt8 = 4,
  LogTypeInt16 = 5, LogTypeInt32 = 6, LogTypeFloat = 7, LogTypeFP16 = 8
}
enum  ParamType {
  ParamTypeUint8 = 0x00 | (0x00<<2) | (0x01<<3), ParamTypeInt8 = 0x00 | (0x00<<2) | (0x00<<3), ParamTypeUint16 = 0x01 | (0x00<<2) | (0x01<<3), ParamTypeInt16 = 0x01 | (0x00<<2) | (0x00<<3),
  ParamTypeUint32 = 0x02 | (0x00<<2) | (0x01<<3), ParamTypeInt32 = 0x02 | (0x00<<2) | (0x00<<3), ParamTypeFloat = 0x02 | (0x01<<2) | (0x00<<3)
}

Public Member Functions

void alloff ()
 Crazyflie (const std::string &link_uri)
template<class T >
getParam (uint8_t id) const
const ParamTocEntrygetParamTocEntry (const std::string &group, const std::string &name) const
void logReset ()
std::vector< LogTocEntry >
::const_iterator 
logVariablesBegin () const
std::vector< LogTocEntry >
::const_iterator 
logVariablesEnd () const
std::vector< ParamTocEntry >
::const_iterator 
paramsBegin () const
std::vector< ParamTocEntry >
::const_iterator 
paramsEnd () const
void queueOutgoingPacket (const crtpPacket_t &packet)
void readFlash (BootloaderTarget target, size_t size, std::vector< uint8_t > &data)
void reboot ()
uint64_t rebootToBootloader ()
void requestLogToc ()
void requestParamToc ()
std::vector< Crazyradio::AckretrieveGenericPackets ()
void sendExternalPositionUpdate (float x, float y, float z)
void sendPing ()
void sendSetpoint (float roll, float pitch, float yawrate, uint16_t thrust)
void setConsoleCallback (std::function< void(const char *)> cb)
void setEmptyAckCallback (std::function< void(const crtpPlatformRSSIAck *)> cb)
void setLinkQualityCallback (std::function< void(float)> cb)
template<class T >
void setParam (uint8_t id, const T &value)
void sysoff ()
void syson ()
void transmitPackets ()
void trySysOff ()
float vbat ()
void writeFlash (BootloaderTarget target, const std::vector< uint8_t > &data)

Static Public Member Functions

static size_t size (LogType t)

Private Member Functions

void addRequest (const uint8_t *data, size_t numBytes, size_t numBytesToMatch)
template<typename R >
void addRequest (const R &request, size_t numBytesToMatch)
const LogTocEntrygetLogTocEntry (const std::string &group, const std::string &name) const
const ParamValuegetParam (uint8_t id) const
template<typename R >
const R * getRequestResult (size_t index) const
void handleAck (const Crazyradio::Ack &result)
void handleBatchAck (const Crazyradio::Ack &result)
void handleRequests (float baseTime=0.5, float timePerRequest=0.05)
void queueGenericPacket (const Crazyradio::Ack &result)
uint8_t registerLogBlock (std::function< void(crtpLogDataResponse *, uint8_t)> cb)
void sendPacket (const uint8_t *data, uint32_t length, Crazyradio::Ack &result)
bool sendPacket (const uint8_t *data, uint32_t length)
void sendPacketOrTimeout (const uint8_t *data, uint32_t length, float timeout=1.0)
void setParam (uint8_t id, const ParamValue &value)
void startBatchRequest ()
bool unregisterLogBlock (uint8_t id)

Private Attributes

uint64_t m_address
std::vector< batchRequestm_batchRequests
uint8_t m_channel
std::function< void(const char *) m_consoleCallback )
Crazyradio::Datarate m_datarate
int m_devId
std::function< void(const
crtpPlatformRSSIAck *) 
m_emptyAckCallback )
std::vector< Crazyradio::Ackm_generic_packets
std::function< void(float)> m_linkQualityCallback
std::map< uint8_t,
std::function< void(crtpLogDataResponse
*, uint8_t)> 
m_logBlockCb )
std::vector< LogTocEntrym_logTocEntries
size_t m_numRequestsFinished
std::vector< crtpPacket_tm_outgoing_packets
std::vector< ParamTocEntrym_paramTocEntries
std::map< uint8_t, ParamValuem_paramValues
Crazyradiom_radio
ITransportm_transport

Friends

class LogBlock
class LogBlockGeneric

Detailed Description

Definition at line 14 of file Crazyflie.h.


Member Enumeration Documentation

Enumerator:
TargetSTM32 
TargetNRF51 

Definition at line 68 of file Crazyflie.h.

Enumerator:
LogTypeUint8 
LogTypeUint16 
LogTypeUint32 
LogTypeInt8 
LogTypeInt16 
LogTypeInt32 
LogTypeFloat 
LogTypeFP16 

Definition at line 50 of file Crazyflie.h.

Enumerator:
ParamTypeUint8 
ParamTypeInt8 
ParamTypeUint16 
ParamTypeInt16 
ParamTypeUint32 
ParamTypeInt32 
ParamTypeFloat 

Definition at line 17 of file Crazyflie.h.


Constructor & Destructor Documentation

Crazyflie::Crazyflie ( const std::string &  link_uri)

Definition at line 27 of file Crazyflie.cpp.


Member Function Documentation

void Crazyflie::addRequest ( const uint8_t *  data,
size_t  numBytes,
size_t  numBytesToMatch 
) [private]

Definition at line 750 of file Crazyflie.cpp.

template<typename R >
void Crazyflie::addRequest ( const R &  request,
size_t  numBytesToMatch 
) [inline, private]

Definition at line 236 of file Crazyflie.h.

Definition at line 211 of file Crazyflie.cpp.

const Crazyflie::LogTocEntry * Crazyflie::getLogTocEntry ( const std::string &  group,
const std::string &  name 
) const [private]

Definition at line 702 of file Crazyflie.cpp.

template<class T >
T Crazyflie::getParam ( uint8_t  id) const [inline]

Definition at line 134 of file Crazyflie.h.

const ParamValue& Crazyflie::getParam ( uint8_t  id) const [inline, private]

Definition at line 306 of file Crazyflie.h.

const Crazyflie::ParamTocEntry * Crazyflie::getParamTocEntry ( const std::string &  group,
const std::string &  name 
) const

Definition at line 714 of file Crazyflie.cpp.

template<typename R >
const R* Crazyflie::getRequestResult ( size_t  index) const [inline, private]

Definition at line 252 of file Crazyflie.h.

void Crazyflie::handleAck ( const Crazyradio::Ack result) [private]

Definition at line 646 of file Crazyflie.cpp.

void Crazyflie::handleBatchAck ( const Crazyradio::Ack result) [private]

Definition at line 813 of file Crazyflie.cpp.

void Crazyflie::handleRequests ( float  baseTime = 0.5,
float  timePerRequest = 0.05 
) [private]

Definition at line 762 of file Crazyflie.cpp.

Definition at line 110 of file Crazyflie.cpp.

std::vector<LogTocEntry>::const_iterator Crazyflie::logVariablesBegin ( ) const [inline]

Definition at line 119 of file Crazyflie.h.

std::vector<LogTocEntry>::const_iterator Crazyflie::logVariablesEnd ( ) const [inline]

Definition at line 122 of file Crazyflie.h.

std::vector<ParamTocEntry>::const_iterator Crazyflie::paramsBegin ( ) const [inline]

Definition at line 112 of file Crazyflie.h.

std::vector<ParamTocEntry>::const_iterator Crazyflie::paramsEnd ( ) const [inline]

Definition at line 115 of file Crazyflie.h.

void Crazyflie::queueGenericPacket ( const Crazyradio::Ack result) [inline, private]

En-queues an unhandled Ack into a vector so that it can be retrieved later.

Parameters:
resultThe unhandled Ack to be en-queued.

Definition at line 224 of file Crazyflie.h.

void Crazyflie::queueOutgoingPacket ( const crtpPacket_t packet) [inline]

En-queues a generic crtpPacket into a vector so that it can be transmitted later.

Parameters:
packetthe crtpPacket to be en-queued.

Definition at line 193 of file Crazyflie.h.

void Crazyflie::readFlash ( BootloaderTarget  target,
size_t  size,
std::vector< uint8_t > &  data 
)

Definition at line 382 of file Crazyflie.cpp.

Definition at line 160 of file Crazyflie.cpp.

Definition at line 169 of file Crazyflie.cpp.

uint8_t Crazyflie::registerLogBlock ( std::function< void(crtpLogDataResponse *, uint8_t)>  cb) [private]

Definition at line 726 of file Crazyflie.cpp.

Definition at line 445 of file Crazyflie.cpp.

Definition at line 475 of file Crazyflie.cpp.

Returns a copy of the en-queued CRTP packets which were not handled by handleAck.

Returns:
A vector of Ack data structures, where each Ack contains the data from a single packet.

Definition at line 183 of file Crazyflie.h.

void Crazyflie::sendExternalPositionUpdate ( float  x,
float  y,
float  z 
)

Definition at line 128 of file Crazyflie.cpp.

void Crazyflie::sendPacket ( const uint8_t *  data,
uint32_t  length,
Crazyradio::Ack result 
) [private]

Definition at line 603 of file Crazyflie.cpp.

bool Crazyflie::sendPacket ( const uint8_t *  data,
uint32_t  length 
) [private]

Definition at line 579 of file Crazyflie.cpp.

void Crazyflie::sendPacketOrTimeout ( const uint8_t *  data,
uint32_t  length,
float  timeout = 1.0 
) [private]

Definition at line 588 of file Crazyflie.cpp.

Definition at line 137 of file Crazyflie.cpp.

void Crazyflie::sendSetpoint ( float  roll,
float  pitch,
float  yawrate,
uint16_t  thrust 
)

Definition at line 118 of file Crazyflie.cpp.

void Crazyflie::setConsoleCallback ( std::function< void(const char *)>  cb) [inline]

Definition at line 153 of file Crazyflie.h.

void Crazyflie::setEmptyAckCallback ( std::function< void(const crtpPlatformRSSIAck *)>  cb) [inline]

Definition at line 143 of file Crazyflie.h.

void Crazyflie::setLinkQualityCallback ( std::function< void(float)>  cb) [inline]

Definition at line 148 of file Crazyflie.h.

template<class T >
void Crazyflie::setParam ( uint8_t  id,
const T &  value 
) [inline]

Definition at line 127 of file Crazyflie.h.

void Crazyflie::setParam ( uint8_t  id,
const ParamValue value 
) [private]

Definition at line 515 of file Crazyflie.cpp.

static size_t Crazyflie::size ( LogType  t) [inline, static]

Definition at line 158 of file Crazyflie.h.

void Crazyflie::startBatchRequest ( ) [private]

Definition at line 745 of file Crazyflie.cpp.

Definition at line 195 of file Crazyflie.cpp.

void Crazyflie::syson ( )

Definition at line 217 of file Crazyflie.cpp.

Transmits any outgoing packets to the crazyflie.

Definition at line 146 of file Crazyflie.cpp.

Definition at line 201 of file Crazyflie.cpp.

bool Crazyflie::unregisterLogBlock ( uint8_t  id) [private]

Definition at line 737 of file Crazyflie.cpp.

float Crazyflie::vbat ( )

Definition at line 223 of file Crazyflie.cpp.

void Crazyflie::writeFlash ( BootloaderTarget  target,
const std::vector< uint8_t > &  data 
)

Definition at line 240 of file Crazyflie.cpp.


Friends And Related Function Documentation

friend class LogBlock [friend]

Definition at line 330 of file Crazyflie.h.

friend class LogBlockGeneric [friend]

Definition at line 331 of file Crazyflie.h.


Member Data Documentation

uint64_t Crazyflie::m_address [private]

Definition at line 316 of file Crazyflie.h.

std::vector<batchRequest> Crazyflie::m_batchRequests [private]

Definition at line 341 of file Crazyflie.h.

uint8_t Crazyflie::m_channel [private]

Definition at line 315 of file Crazyflie.h.

std::function<void(const char*) Crazyflie::m_consoleCallback) [private]

Definition at line 327 of file Crazyflie.h.

Definition at line 317 of file Crazyflie.h.

int Crazyflie::m_devId [private]

Definition at line 313 of file Crazyflie.h.

std::function<void(const crtpPlatformRSSIAck*) Crazyflie::m_emptyAckCallback) [private]

Definition at line 325 of file Crazyflie.h.

Definition at line 217 of file Crazyflie.h.

std::function<void(float)> Crazyflie::m_linkQualityCallback [private]

Definition at line 326 of file Crazyflie.h.

std::map<uint8_t, std::function<void(crtpLogDataResponse*, uint8_t)> Crazyflie::m_logBlockCb) [private]

Definition at line 320 of file Crazyflie.h.

std::vector<LogTocEntry> Crazyflie::m_logTocEntries [private]

Definition at line 319 of file Crazyflie.h.

Definition at line 342 of file Crazyflie.h.

Definition at line 218 of file Crazyflie.h.

Definition at line 322 of file Crazyflie.h.

std::map<uint8_t, ParamValue> Crazyflie::m_paramValues [private]

Definition at line 323 of file Crazyflie.h.

Definition at line 311 of file Crazyflie.h.

Definition at line 312 of file Crazyflie.h.


The documentation for this class was generated from the following files:


crazyflie_cpp
Author(s): Wolfgang Hoenig
autogenerated on Sun Oct 8 2017 02:47:59