libnifalcon
1.0.1
|
#include <FalconFirmwareNovintSDK.h>
Public Member Functions | |
FalconFirmwareNovintSDK () | |
virtual | ~FalconFirmwareNovintSDK () |
virtual std::string | getRawReturn () |
bool | runIOLoop () |
int32_t | getGripInfoSize () |
const uint8_t * | getGripInfo () |
![]() | |
FalconFirmware () | |
virtual | ~FalconFirmware () |
void | setForces (const std::array< int, 3 >(&force)) |
std::array< int, 3 > | getEncoderValues () |
void | setLEDStatus (unsigned int leds) |
uint8_t | getLEDStatus () |
void | setHomingMode (bool value) |
unsigned int | getHomingModeStatus () |
bool | isHomed () |
void | setFalconComm (std::shared_ptr< FalconComm > f) |
bool | isFirmwareLoaded () |
bool | setFirmwareFile (const std::string &filename) |
bool | loadFirmware (unsigned int retries, bool skip_checksum=false) |
bool | loadFirmware (bool skip_checksum=false) |
bool | loadFirmware (bool skip_checksum, const unsigned int &firmware_size, uint8_t *buffer) |
virtual void | resetFirmwareState () |
uint64_t | getLoopCount () |
![]() | |
FalconCore () | |
virtual | ~FalconCore () |
int | getErrorCode () |
Protected Member Functions | |
void | formatInput () |
bool | formatOutput () |
Protected Attributes | |
uint8_t | m_gripInfo |
uint8_t | m_rawData [128] |
uint8_t | m_rawInput [17] |
uint8_t | m_rawOutput [17] |
uint8_t | m_rawOutputInternal [17] |
unsigned int | m_currentOutputIndex |
unsigned int | m_rawDataSize |
![]() | |
std::shared_ptr< FalconComm > | m_falconComm |
std::string | m_firmwareFilename |
bool | m_isFirmwareLoaded |
bool | m_homingMode |
unsigned int | m_ledStatus |
std::array< int, 3 > | m_forceValues |
std::array< int, 3 > | m_encoderValues |
unsigned int | m_homingStatus |
uint64_t | m_loopCount |
uint64_t | m_outputCount |
bool | m_hasWritten |
![]() | |
int | m_errorCode |
Private Member Functions | |
DECLARE_LOGGER () | |
Additional Inherited Members | |
![]() | |
enum | { GREEN_LED =0x2, BLUE_LED =0x4, RED_LED =0x8 } |
enum | { ENCODER_1_HOMED = 0x1, ENCODER_2_HOMED = 0x2, ENCODER_3_HOMED = 0x4 } |
enum | { FALCON_FIRMWARE_NO_COMM_SET = 3000, FALCON_FIRMWARE_NO_FIRMWARE_SET, FALCON_FIRMWARE_NO_FIRMWARE_LOADED, FALCON_FIRMWARE_FILE_NOT_VALID, FALCON_FIRMWARE_CHECKSUM_MISMATCH } |
![]() | |
enum libnifalcon::FalconFirmware:: { ... } | FalconFirmwareLEDValues |
enum libnifalcon::FalconFirmware:: { ... } | FalconFirmwareHomingValues |
enum libnifalcon::FalconFirmware:: { ... } | FalconFirmwareErrorValues |
FalconFirmwareNovintSDK implements the firmware communications strategy for the firmware that comes with the Novint drivers, and with the nVent software.
16 bytes sent to the Falcon causes 16 bytes to be returned. It's expected that the host will be constantly polling the falcon to set motor positions, as it is assumed that the PID loops for the control exist in the software, not the hardware.
Input and output strings are printable. Each string starts with 0x3c ('<') and ends with 0x3e ('>'), and the byte range is 0x41 ('A') to 0x50 ('P').
A null input/output string looks like:
<AAAAAAAAAAAAAA>
However, after any amount of usage, the input/output string will probably look something like:
<HNGPOKOPFPOPAA>
0x3C 0x(g0) 0x(g1) 0x(g2) 0x(g3) 0x(h0) 0x(h1) 0x(h2) 0x(h3) 0x(i0) 0x(i1) 0x(i2) 0x(i3) 0x(j0) 0x(k0) 0x3E
Input Packet Byte Definitions:
Homing and LED Controls (Value of j0 byte):
0x3C 0x(m0) 0x(m1) 0x(m2) 0x(m3) 0x(n0) 0x(n1) 0x(n2) 0x(n3) 0x(o0) 0x(o1) 0x(o2) 0x(o3) 0x4(p0) 0x(q0) 0x3E
Output packet byte definitions:
Buttons and Homing Control Report (Value of j0 byte) - Directions taken from looking at the Falcon from the front:
Retrieving/Setting Axis Position:
Example:
libnifalcon::FalconFirmwareNovintSDK::FalconFirmwareNovintSDK | ( | ) |
Constructor
|
virtual |
Destructor
|
private |
|
protected |
Formats current input (forces, LED commands, etc...) for sending to falcon.
|
protected |
Formats current output from falcon (joint positions, calibration, etc...)
|
inlinevirtual |
Accessor for raw grip info
Implements libnifalcon::FalconFirmware.
|
inlinevirtual |
Returns size of the grip data portion of the message. Currently always 1.
Implements libnifalcon::FalconFirmware.
|
virtual |
Get the raw data string returned from the falcon
Reimplemented from libnifalcon::FalconFirmware.
|
virtual |
Runs device polling, then tries to write next command to device, or read return from device if write has already happened.
Implements libnifalcon::FalconFirmware.
|
protected |
How far the firmware object is into parsing the current packet
|
protected |
Internal representation of grip data (buttons pressed, etc...)
|
protected |
Raw buffer to read into
|
protected |
Amount of data last returned from communications object read
|
protected |
Raw buffer for formatting input. Plus one character to make it zero terminated
|
protected |
Raw buffer for last full output packet. Plus one character to make it zero terminated
|
protected |
Raw buffer for formatting output incrementally. Plus one character to make it zero terminated