Options
All
  • Public
  • Public/Protected
  • All
Menu

swarms

Index

Type aliases

Type

Type: "int8" | "int16" | "int32" | "int64" | "fp16" | "float" | "double" | "uInt8" | "uInt16" | "uInt32" | "uInt64"

Variables

BM_REQUEST_TYPE

BM_REQUEST_TYPE: 64 = 64

MAX_PAYLOAD_SIZE

MAX_PAYLOAD_SIZE: 31 = 31

Functions

BUFFER_TYPES

  • BUFFER_TYPES(buffer: Buffer): Partial<Record<Type, TypeData>>
  • Factory to return read and write functions for a buffer We need to bind the this context to the functions otherwise it won't work

    todo

    Implement i64/u64/fp16 functions and get rid of Partial

    Parameters

    • buffer: Buffer

    Returns Partial<Record<Type, TypeData>>

GET_DATA_RATE

  • GET_DATA_RATE(targetRate: number): "250K" | "1M" | "2M"
  • Parameters

    • targetRate: number

    Returns "250K" | "1M" | "2M"

GET_LOGGING_TYPE

  • GET_LOGGING_TYPE(typeValue: number): "int8" | "int16" | "int32" | "fp16" | "float" | "uInt8" | "uInt16" | "uInt32"
  • Parameters

    • typeValue: number

    Returns "int8" | "int16" | "int32" | "fp16" | "float" | "uInt8" | "uInt16" | "uInt32"

GET_PARAM_TYPE

  • GET_PARAM_TYPE(typeValue: number): "int8" | "int16" | "int32" | "int64" | "fp16" | "float" | "double" | "uInt8" | "uInt16" | "uInt32" | "uInt64"
  • Parameters

    • typeValue: number

    Returns "int8" | "int16" | "int32" | "int64" | "fp16" | "float" | "double" | "uInt8" | "uInt16" | "uInt32" | "uInt64"

GET_RADIO_POWER

  • GET_RADIO_POWER(targetPower: number): "-18dBm" | "-12dBm" | "-6dBm" | "0dBm"
  • Parameters

    • targetPower: number

    Returns "-18dBm" | "-12dBm" | "-6dBm" | "0dBm"

properEnumKeys

  • properEnumKeys<T>(enumObj: T): Array<keyof T>
  • Takes a TypeScript enum and returns the actual list of keys. Since enums have reverse lookup keys as well, this has to be done when checking for the actual keys.

    Type parameters

    • T: any

    Parameters

    • enumObj: T

    Returns Array<keyof T>

round

  • round(num: number, precision?: number): number
  • Rounds a number to a certain decimal place. Precision 0 by default.

    Parameters

    • num: number
    • Default value precision: number = 0

    Returns number

toBinary

  • toBinary(decimal: number, lengthMultipleOfFour?: boolean, gapEveryByte?: boolean, minLength?: number): string
  • Convert number to binary

    Parameters

    • decimal: number
    • Default value lengthMultipleOfFour: boolean = false
    • Default value gapEveryByte: boolean = false
    • Default value minLength: number = 0

    Returns string

toHex

  • toHex(decimal: number, evenLength?: boolean, xPrefix?: boolean): string
  • Convert number to hex

    Parameters

    • decimal: number
    • Default value evenLength: boolean = false
    • Default value xPrefix: boolean = false

    Returns string

wait

  • wait(milliseconds: number): Promise<Object>
  • Returns a promise that resolves in n milliseconds

    Parameters

    • milliseconds: number

    Returns Promise<Object>

waitUntilEvent

  • waitUntilEvent<T>(emitter: EventEmitter, eventName: string): (Anonymous function)
  • Wait until event is emitted

    todo

    Add timeout as well if event is never emitted

    Type parameters

    • T

    Parameters

    • emitter: EventEmitter
    • eventName: string

    Returns (Anonymous function)

Object literals

BLOCK_ERRORS

BLOCK_ERRORS: object

12

12: object

message

message: string = "No memory to allocate Log Block or Log Item"

name

name: string = "ENOMEM"

2

2: object

message

message: string = "Block or variable not found"

name

name: string = "ENOENT"

7

7: object

message

message: string = "Log block is too long"

name

name: string = "E2BIG"

8

8: object

message

message: string = "Unknown command received"

name

name: string = "ENOEXEC"

BUFFERS

BUFFERS: object

Buffers used for things

NOTHING

NOTHING: Buffer = Buffer.alloc(0)

SOMETHING

SOMETHING: Buffer = Buffer.alloc(1)

CHANNELS

CHANNELS: object

TOC

TOC: number = 0

LOG

LOG: object

CTRL

CTRL: number = 1

DATA

DATA: number = 2

PARAM

PARAM: object

MISC

MISC: number = 3

READ

READ: number = 1

WRITE

WRITE: number = 2

COMMANDS

COMMANDS: object

COMMANDER_GENERIC

COMMANDER_GENERIC: object

HOVER

HOVER: number = 5

STOP

STOP: number = 0

VELOCITY_WORLD

VELOCITY_WORLD: number = 1

Z_DISTANCE

Z_DISTANCE: number = 2

LOG_CTRL

LOG_CTRL: object

APPEND_BLOCK

APPEND_BLOCK: number = 1

CREATE_BLOCK

CREATE_BLOCK: number = 0

DELETE_BLOCK

DELETE_BLOCK: number = 2

RESET_LOG

RESET_LOG: number = 5

START_BLOCK

START_BLOCK: number = 3

STOP_BLOCK

STOP_BLOCK: number = 4

PARAM_MISC

PARAM_MISC: object

SET_BY_NAME

SET_BY_NAME: number = 0

TOC

TOC: object

GET_INFO

GET_INFO: number = 1

GET_ITEM

GET_ITEM: number = 0

CRAZYRADIO

CRAZYRADIO: object

Crazyradio constants These values were taken from (https://wiki.bitcraze.io/doc:crazyradio:usb:index)

PID

PID: number = 30583

VID

VID: number = 6421

PORTS

PORTS: object

Crazyflie Real-Time Protocol (CRTP) These values were taken from (https://wiki.bitcraze.io/projects:crazyflie:crtp)

COMMANDER

COMMANDER: number = 3

COMMANDER_GENERIC

COMMANDER_GENERIC: number = 7

CONSOLE

CONSOLE: number = 0

LINK_LAYER

LINK_LAYER: number = 15

LOGGING

LOGGING: number = 5

PARAMETERS

PARAMETERS: number = 2

VENDOR_REQUESTS

VENDOR_REQUESTS: object

ACK_ENABLE

ACK_ENABLE: number = 16

LAUNCH_BOOTLOADER

LAUNCH_BOOTLOADER: number = 255

SCAN_CHANNELS

SCAN_CHANNELS: number = 33

SET_CONT_CARRIER

SET_CONT_CARRIER: number = 32

SET_DATA_RATE

SET_DATA_RATE: number = 3

SET_RADIO_ADDRESS

SET_RADIO_ADDRESS: number = 2

SET_RADIO_ARC

SET_RADIO_ARC: number = 6

SET_RADIO_ARD

SET_RADIO_ARD: number = 5

SET_RADIO_CHANNEL

SET_RADIO_CHANNEL: number = 1

SET_RADIO_POWER

SET_RADIO_POWER: number = 4

defaultCrazyflieOptions

defaultCrazyflieOptions: object

cacheDir

cacheDir: string = path.join(__dirname, '..', '..', 'cache')

defaultHoverSetpoint

defaultHoverSetpoint: object

velocityX

velocityX: number = 0

velocityY

velocityY: number = 0

yawRate

yawRate: number = 0

zDistance

zDistance: number = 0

defaultOptions

defaultOptions: object

ackEnable

ackEnable: boolean = true

address

address: number = 996028180455

arc

arc: number = 3

ard

ard: number = 160

channel

channel: number = 2

contCarrier

contCarrier: boolean = false

dataRate

dataRate: DATA_RATES = DATA_RATES['2M']

radioPower

radioPower: RADIO_POWERS = RADIO_POWERS['0dBm']

defaultSetpoint

defaultSetpoint: object

pitch

pitch: number = 0

roll

roll: number = 0

thrust

thrust: number = 0

yaw

yaw: number = 0

defaultVelocityWorldSetpoint

defaultVelocityWorldSetpoint: object

velocityX

velocityX: number = 0

velocityY

velocityY: number = 0

velocityZ

velocityZ: number = 0

yawRate

yawRate: number = 0

defaultZDistanceSetpoint

defaultZDistanceSetpoint: object

pitch

pitch: number = 0

roll

roll: number = 0

yawRate

yawRate: number = 0

zDistance

zDistance: number = 0

Generated using TypeDoc