0.1
Angelo (Angelo.qiao@dfrobot.com)
Robert (robert@dfrobot.com)
command Use to determine whether this is arrow or block
COMMAND_RETURN_BLOCK It is a blockCOMMAND_RETURN_ARROW It is an arrowxCenter X Center of BlockyCenter Y Center of Blockwidth Width of Blockheight Height of BlockID ID of Block, see ID Meaning belowxOrigin X Origin of ArrowyOrigin Y Origin of ArrowxTarget X Target of ArrowyTarget Y Target of ArrowID ID of Arrow, see ID Meaning belowvoid printResult(HUSKYLENSResult result){
if (result.command == COMMAND_RETURN_BLOCK){
Serial.println(String() + F("Block:xCenter=") + result.xCenter + F(",yCenter=") + result.yCenter + F(",width=") + result.width + F(",height=") + result.height + F(",ID=") + result.ID);
}
else if (result.command == COMMAND_RETURN_ARROW){
Serial.println(String() + F("Arrow:xOrigin=") + result.xOrigin + F(",yOrigin=") + result.yOrigin + F(",xTarget=") + result.xTarget + F(",yTarget=") + result.yTarget + F(",ID=") + result.ID);
}
else{
Serial.println("Object unknown!");
}
}
| ID | Means |
|---|---|
| 1 | The first learned item is detected |
| 2 | The second learned item is detected |
| XXX | The XXXth learned item is detected |
| 0 | Item is detected but not learned, like unlearned faces block in grey color. |
ALGORITHM_FACE_RECOGNITION FACE RECOGNITIONALGORITHM_OBJECT_TRACKINGOBJECT TRACKINGALGORITHM_OBJECT_RECOGNITION OBJECT RECOGNITIONALGORITHM_LINE_TRACKING LINE TRACKINGALGORITHM_COLOR_RECOGNITION COLOR RECOGNITIONALGORITHM_TAG_RECOGNITION TAG RECOGNITIONALGORITHM_OBJECT_CLASSIFICATION OBJECT CLASSIFICATIONstreamInput : It could be Serial, Wire, SoftwareSerial, or other port based on Stream class.streamInput : It could be Serial, Wire, SoftwareSerial, or other port based on Stream class.timeOutDurationInput : Time out duration on ms.ID from HUSKYLENS.ID The target ID of blocks and arrowsID from HUSKYLENSID The target ID of blocksalgorithmType The algorithm you need. See protocolAlgorithm for details.ID from HUSKYLENSID The target ID of arrowsDescription: Request all learned blocks and arrows (ID >=1) from HUSKYLENS.
Returns: Whether successfully get the result.
Description: Request all learned blocks (ID >=1) from HUSKYLENS.
Returns: Whether successfully get the result.
Description: Request all learned arrows (ID >=1) from HUSKYLENS.
Returns: Whether successfully get the result.
Description: Return the count of blocks and arrows available to read. (Works like Serial or Wire)
Arguments: None
Returns: The count of blocks and arrows left in the buffer.
Description: Read blocks or arrows.(Works like Serial or Wire)
Returns: blocks or arrows in struct HUSKYLENSResult. See HUSKYLENSResult above for details.
Description: Get whether HUSKYLENS have learn something.
Returns: Whether HUSKYLENS have learn something.
Description: Get whether HUSKYLENS have learn something tagged with ID.
Arguments:
ID The target ID. See ID Meaning above for details.Returns: Whether HUSKYLENS have learn something tagged with ID.
Description: Get the number of frame HUSKYLENS have processed. Once HUSKYLENS process one frame, this number will increase by one.
Returns: The number of frame HUSKYLENS have processed.
Description: Get the count of (faces, colors, objects or lines) you have learned on HUSKYLENS. This value will depend on how many times you learn something on HUSKYLENS.
Returns: The count of (faces, colors, objects or lines) you have learned on HUSKYLENS.
Description: Get count of all blocks and arrows.
Returns: The count of all blocks and arrows.
Description: Get count of all blocks and arrows tagged with ID.
Arguments:
ID The target ID. See ID Meaning above for details.Returns: The count of all blocks and arrows tagged with ID.
Description: Get count of all blocks.
Returns: The count of all blocks.
Description: Get count of all blocks tagged with ID.
Arguments:
ID The target ID. See ID Meaning above for details.Returns: The count of all blocks tagged with ID.
Description: Get count of all arrows.
Returns: The count of all blocks and arrows.
Description: Get count of all arrows tagged with ID.
Arguments:
ID The target ID. See ID Meaning above for details.Returns: The count of all arrows tagged with ID.
Description: Get count of all learned blocks and arrows (ID >=1)
Returns: The count of all learned blocks and arrows (ID >=1)
Description: Get count of all learned blocks (ID >=1)
Returns: The count of all learned blocks (ID >=1)
Description: Get count of all learned arrows (ID >=1)
Returns: The count of all learned arrows (ID >=1)
Description: Get one of the blocks and arrows.
Arguments:
index The index of blocks and arrows, which is ordered by the received sequence. It should less than count()Returns: block or arrow in struct HUSKYLENSResult. See HUSKYLENSResult above for details.
Description: Get one of the blocks and arrows tagged with ID
Arguments:
ID The target ID. See ID Meaning above for details.index The index of blocks and arrows, which is ordered by the received sequence. It should less than count(ID)Returns: block or arrow tagged with ID in struct HUSKYLENSResult. See HUSKYLENSResult above for details.
Description: Get one of the blocks.
Arguments:
index The index of blocks, which is ordered by the received sequence. It should less than countBlocks()Returns: block in struct HUSKYLENSResult. See HUSKYLENSResult above for details.
Description: Get one of the blocks tagged with ID
Arguments:
ID The target ID. See ID Meaning above for details.index The index of blocks, which is ordered by the received sequence. It should less than countBlocks(ID)Returns: block tagged with ID in struct HUSKYLENSResult. See HUSKYLENSResult above for details.
Description: Get one of the arrows.
Arguments:
index The index of arrows, which is ordered by the received sequence. It should less than countArrows()Returns: arrow in struct HUSKYLENSResult. See HUSKYLENSResult above for details.
Description: Get one of the arrows tagged with ID
Arguments:
ID The target ID. See ID Meaning above for details.index The index of arrow, which is ordered by the received sequence. It should less than countArrows(ID)Returns: arrow tagged with ID in struct HUSKYLENSResult. See HUSKYLENSResult above for details.
Description: Get one of the learned blocks and arrows (ID >=1)
Arguments:
index The index of blocks and arrows, which is ordered by the received sequence. It should less than countLearned()Returns: block or arrow in struct HUSKYLENSResult. See HUSKYLENSResult above for details.
Description: Get one of the learned blocks (ID >=1)
Arguments:
index The index of blocks, which is ordered by the received sequence. It should less than countBlocksLearned()Returns: block in struct HUSKYLENSResult. See HUSKYLENSResult above for details.
Description: Get one of the learned arrows (ID >=1)
Arguments:
index The index of arrows, which is ordered by the received sequence. It should less than countArrowsLearned()Returns: arrow in struct HUSKYLENSResult. See HUSKYLENSResult above for details.
Description: Let HUSKYLENS switch to the target algorithm you need.
Arguments:
algorithmType The target algorithm. See protocolAlgorithm for details.Returns: Whether success.
Description: Let HUSKYLENS learn with ID. (It only works in Object Classification)
Arguments:
ID The target ID. See ID Meaning above for details.Returns: Whether success.
Description: Let HUSKYLENS forget all. (It only works in Object Classification)
Returns: Whether success.
Description: Set a custom name for a learned object with a specified ID. For example, if you have learned your face with an ID of 1, you can use setCustomName("Robert",1) to rename the learned face to "Robert".
Arguments:
name The specified custom nameid The ID of the object you want to set the custom name forReturns: Whether success.
fileNum The specified file number to be used in the name for the filefileNum The specified file number to be used in the name for the filetext The specified text you wish to enter on the screenx The X coordinate for the UI Object (0-320)y The Y coordinate for the UI Object (0-240)0.5.1
Angelo (Angelo.qiao@dfrobot.com)
Robert (robert@dfrobot.com)
| Header | Header 2 | Address | Data Length | Command | Data | Checksum |
|---|---|---|---|---|---|---|
| 0x55 | 0xAA | 1 byte | 1 byte | 1 byte | Data 1~Data n | 1 byte |
| Hex | Function | |||||
| ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |||||
| 0x55 | Header | |||||
| 0xAA | Header 2 | |||||
| 0x11 | Address | |||||
| 0x0A | Data Length | |||||
| 0x2A | Command is 0x2A | |||||
| 0x2C | Data[0] | |||||
| 0x01 | Data[1] | |||||
| 0xC8 | Data[2] | |||||
| 0x00 | Data[3] | |||||
| 0x0A | Data[4] | |||||
| 0x00 | Data[5] | |||||
| 0x14 | Data[6] | |||||
| 0x00 | Data[7] | |||||
| 0x01 | Data[8] | |||||
| 0x00 | Data[9] | |||||
| 0x58 | CheckSum, Sum all and only use low byte (Low Byte of 0x258 = 0x55 + 0xAA + 0x11 + 0x0A + 0x2A + 0x2C + 0x01 + 0xC8 + 0x00 + 0x0A + 0x00 + 0x14 + 0x00 + 0x01 +0x00) |
| ID | Means |
|---|---|
| 1 | The first learned item is detected |
| 2 | The second learned item is detected |
| XXX | The XXXth learned item is detected |
| 0 | Item is detected but not learned, like unlearned faces block in grey color. |
| hosts | HUSKYLENS |
|---|---|
| COMMAND_REQUEST_KNOCK===> | |
| <===COMMAND_RETURN_OK | |
| COMMAND_REQUEST===> | |
| <=== COMMAND_RETURN_INFO | |
| <=== COMMAND_RETURN_BLOCK | |
| <=== COMMAND_RETURN_BLOCK | |
| <=== COMMAND_RETURN_ARROW | |
| COMMAND_REQUEST_BLOCKS====> | |
| <=== COMMAND_RETURN_INFO | |
| <=== COMMAND_RETURN_BLOCK | |
| <=== COMMAND_RETURN_BLOCK | |
| COMMAND_REQUEST_ARROWS====> | |
| <=== COMMAND_RETURN_INFO | |
| <=== COMMAND_RETURN_ARROW | |
| COMMAND_REQUEST_ALGORITHM===> | |
| <===COMMAND_RETURN_OK | |
| COMMAND_REQUEST_ALGORITHM===> | |
| COMMAND_REQUEST_ALGORITHM===> | |
| <===COMMAND_RETURN_BUSY | |
| <===COMMAND_RETURN_OK |
Request all blocks and arrows from HUSKYLENS.
| Header | Header 2 | Address | Data Length | Command | Checksum |
|---|---|---|---|---|---|
| 0x55 | 0xAA | 0x11 | 0x00 | 0x20 | 0x30 |
Request all blocks from HUSKYLENS.
| Header | Header 2 | Address | Data Length | Command | Checksum |
|---|---|---|---|---|---|
| 0x55 | 0xAA | 0x11 | 0x00 | 0x21 | 0x31 |
Request all arrows from HUSKYLENS.
| Header | Header 2 | Address | Data Length | Command | Checksum |
|---|---|---|---|---|---|
| 0x55 | 0xAA | 0x11 | 0x00 | 0x22 | 0x32 |
Request all learned blocks and arrows (ID >=1) from HUSKYLENS.
| Header | Header 2 | Address | Data Length | Command | Checksum |
|---|---|---|---|---|---|
| 0x55 | 0xAA | 0x11 | 0x00 | 0x23 | 0x33 |
Request all learned blocks (ID >=1) from HUSKYLENS.
| Header | Header 2 | Address | Data Length | Command | Checksum |
|---|---|---|---|---|---|
| 0x55 | 0xAA | 0x11 | 0x00 | 0x24 | 0x34 |
Request all learned arrows (ID >=1) from HUSKYLENS.
| Header | Header 2 | Address | Data Length | Command | Checksum |
|---|---|---|---|---|---|
| 0x55 | 0xAA | 0x11 | 0x00 | 0x25 | 0x35 |
Request all blocks and arrows by given ID (Here is 0x01) from HUSKYLENS.
| Header | Header 2 | Address | Data Length | Command | Data | Checksum |
|---|---|---|---|---|---|---|
| 0x55 | 0xAA | 0x11 | 0x02 | 0x26 | 0x01 0x00 | 0x39 |
Data details:
| Data | Function |
|---|---|
| 0x01 | Given ID, see ID Details above (Low Byte of 1 = 0x0001) |
| 0x00 | Given ID, see ID Details above (High Byte of 1 = 0x0001) |
Request all blocks by given ID (Here is 0x01) from HUSKYLENS.
| Header | Header 2 | Address | Data Length | Command | Data | Checksum |
|---|---|---|---|---|---|---|
| 0x55 | 0xAA | 0x11 | 0x02 | 0x27 | 0x01 0x00 | 0x3A |
Data details:
| Data | Function |
|---|---|
| 0x01 | Given ID, see ID Details above (Low Byte of 1 = 0x0001) |
| 0x00 | Given ID, see ID Details above (High Byte of 1 = 0x0001) |
Request all arrows by given ID (Here is 0x01) from HUSKYLENS.
| Header | Header 2 | Address | Data Length | Command | Data | Checksum |
|---|---|---|---|---|---|---|
| 0x55 | 0xAA | 0x11 | 0x02 | 0x28 | 0x01 0x00 | 0x3B |
Data details:
| Data | Function |
|---|---|
| 0x01 | Given ID, see ID Details above (Low Byte of 1 = 0x0001) |
| 0x00 | Given ID, see ID Details above (High Byte of 1 = 0x0001) |
When HUSKYLENS Receives the command above, HUSKYLENS will return this info first and then return the arrows and blocks.
| Header | Header 2 | Address | Data Length | Command | Data | Checksum |
|---|---|---|---|---|---|---|
| 0x55 | 0xAA | 0x11 | 0x0A | 0x29 | 0x01 0x00 0x01 0x00 0x05 0x00 0x00 0x00 0x00 0x00 | 0x4A |
Data details:
| Data | Function |
|---|---|
| 0x01 | numbers of blocks and arrows from HUSKYLENS (Low Byte of 1 = 0x0001) |
| 0x00 | numbers of blocks and arrows from HUSKYLENS (High Byte of 1 = 0x0001) |
| 0x01 | numbers of IDs HUSKYLENS have learned (Low Byte of 1 = 0x0001) |
| 0x00 | numbers of IDs HUSKYLENS have learned (High Byte of 1 = 0x0001) |
| 0x05 | current frame number (Low Byte of 5 = 0x0005) |
| 0x00 | current frame number (High Byte of 5 = 0x0005) |
| 0x00 | reserved |
| 0x00 | reserved |
| 0x00 | reserved |
| 0x00 | reserved |
After HUSKYLENS returns info, HUSKYLENS will return the blocks like this:
| Header | Header 2 | Address | Data Length | Command | Data | Checksum |
|---|---|---|---|---|---|---|
| 0x55 | 0xAA | 0x11 | 0x0A | 0x2A | 0x2C 0x01 0xC8 0x00 0x0A 0x00 0x14 0x00 0x01 0x00 | 0x58 |
Data details:
| Hex | Function |
|---|---|
| 2C | X Center of Block (Low Byte of 300 = 0x012C, range:0-319) |
| 01 | X Center of Block (High Byte of 300 = 0x012C, range:0-319) |
| C8 | Y Center of Block (Low Byte of 200 = 0x00C8, range:0-239) |
| 00 | Y Center of Block (High Byte of 200 = 0x00C8, range:0-239) |
| 0A | Width of Block (Low Byte of 10 = 0x000A, range:0-319) |
| 00 | Width of Block (High Byte of 10 = 0x000A, range:0-319) |
| 14 | Height of Block (Low Byte of 20 = 0x0014, range:0-239) |
| 00 | Height of Block (High Byte of 20 = 0x0014, range:0-239) |
| 01 | ID, see ID Meaning above (Low Byte of 1 = 0x0001) |
| 00 | ID, see ID Meaning above (High Byte of 1 = 0x0001) |
After HUSKYLENS returns info, HUSKYLENS will return the arrows like this:
| Header | Header 2 | Address | Data Length | Command | Data | Checksum |
|---|---|---|---|---|---|---|
| 0x55 | 0xAA | 0x11 | 0x0A | 0x2B | 0x2C 0x01 0xC8 0x00 0x0A 0x00 0x14 0x00 0x01 0x00 | 0x5A |
Data details:
| Data | Function |
|---|---|
| 2C | X Origin of Arrow (Low Byte of 300 = 0x012C, range:0-319) |
| 01 | X Origin of Arrow (High Byte of 300 = 0x012C, range:0-319) |
| C8 | Y Origin of Arrow (Low Byte of 200 = 0x00C8, range:0-239) |
| 00 | Y Origin of Arrow (High Byte of 200 = 0x00C8, range:0-239) |
| 0A | X Target of Arrow (Low Byte of 10 = 0x000A, range:0-319) |
| 00 | X Target of Arrow (High Byte of 10 = 0x000A, range:0-319) |
| 14 | Y Target of Arrow (Low Byte of 20 = 0x0014, range:0-239) |
| 00 | Y Target of Arrow (High Byte of 20 = 0x0014, range:0-239) |
| 01 | ID, see ID Meaning above (Low Byte of 1 = 0x0001) |
| 00 | ID, see ID Meaning below (High Byte of 1 = 0x0001) |
Used for test connection with HUSKYLENS. When HUSKYLENS received this command, HUSKYLENS will return COMMAND_RETURN_OK.
| Header | Header 2 | Address | Data Length | Command | Checksum |
|---|---|---|---|---|---|
| 0x55 | 0xAA | 0x11 | 0x00 | 0x2C | 0x3C |
When HUSKYLENS receives this command, HUSKYLENS will change the algorithm by the Data. And will return COMMAND_RETURN_OK.
| Header | Header 2 | Address | Data Length | Command | Data | Checksum |
|---|---|---|---|---|---|---|
| 0x55 | 0xAA | 0x11 | 0x02 | 0x2D | 0x01 0x00 | 0x40 |
Data details:
| Data | Function |
|---|---|
| 0x01 | Change to ALGORITHM_OBJECT_TRACKING (Low Byte of 1 = 0x0001) |
| 0x00 | Change to ALGORITHM_OBJECT_TRACKING (High Byte of 1 = 0x0001) |
Data's correspondent algorithm:
| Data | Algorithm |
|---|---|
| 0x00 0x00 | ALGORITHM_FACE_RECOGNITION |
| 0x01 0x00 | ALGORITHM_OBJECT_TRACKING |
| 0x02 0x00 | ALGORITHM_OBJECT_RECOGNITION |
| 0x03 0x00 | ALGORITHM_LINE_TRACKING |
| 0x04 0x00 | ALGORITHM_COLOR_RECOGNITION |
| 0x05 0x00 | ALGORITHM_TAG_RECOGNITION |
| 0x06 0x00 | ALGORITHM_OBJECT_CLASSIFICATION |
HUSKYLENS will return OK, if HUSKYLENS receives COMMAND_REQUEST_ALGORITHM, COMMAND_REQUEST_KNOCK.
| Header | Header 2 | Address | Data Length | Command | Checksum |
|---|---|---|---|---|---|
| 0x55 | 0xAA | 0x11 | 0x00 | 0x2E | 0x3E |
Set a custom name for a learned object.
| Header | Header 2 | Address | Data Length | Command | Data | Checksum |
|---|---|---|---|---|---|---|
| 0x55 | 0xAA | 0x11 | 0x07 | 0x2F | 0x01 0x05 0x54 0x45 0x53 0x54 0x00 | 0x8C |
Data details:
Name: TEST
| Data | Function |
|---|---|
| 0x01 | Given ID of object |
| 0x05 | Length of name + 1 |
| 0x54 | HEX Value of "T" |
| 0x45 | HEX Value of "E" |
| 0x53 | HEX Value of "S" |
| 0x54 | HEX Value of "T" |
| 0x00 | 0 Value to mark the end of the name |
Save a photo on the HuskyLens SD Card.
| Header | Header 2 | Address | Data Length | Command | Checksum |
|---|---|---|---|---|---|
| 0x55 | 0xAA | 0x11 | 0x00 | 0x30 | 0x40 |
Save the current algorithms model to the SD Card in the following file format "AlgorithimName_Backup_FileNum.conf"
| Header | Header 2 | Address | Data Length | Command | Data | Checksum |
|---|---|---|---|---|---|---|
| 0x55 | 0xAA | 0x11 | 0x002 | 0x32 | 0x01 0x00 | 0x45 |
Data details:
FileNum: 1
Example File Name : LineTracking_Backup_1.conf
| Data | Function |
|---|---|
| 0x01 | LOW Byte of FileNum (1 = 0x0001) |
| 0x00 | HIGH Byte of FileNum (1 = 0x0001) |
Load a model file from the SD Card to the current algorithm and refresh the algorithm. The loaded file will be the following format "AlgorithimName_Backup_FileNum.conf"
| Header | Header 2 | Address | Data Length | Command | Data | Checksum |
|---|---|---|---|---|---|---|
| 0x55 | 0xAA | 0x11 | 0x02 | 0x33 | 0x01 0x00 | 0x46 |
Data details:
FileNum: 1
Example File Name : LineTracking_Backup_1.conf
| Data | Function |
|---|---|
| 0x01 | LOW Byte of FileNum (1 = 0x0001) |
| 0x00 | HIGH Byte of FileNum (1 = 0x0001) |
Place a string of text (less than 20 characters) on top of the HuskyLens UI. The position of the texts (X,Y) cordinate is the top left of the text box.
You can have at most 10 custom texts on the UI at once, and if you continue adding texts you will replace previous texts in a circular fashion. For example, if you enter 10 texts you will fill the text buffer. If you then insert a new text object, you will overwrite the first text position (textBuffer[0]). Inserting another new text object will overwrite the second text position (textBuffer[1]).
Each text is uniquely identified by its (X,y) cordinate, so you can replace the text string at a (X,Y) cordinate instead of adding a new text object. For example, if you insert "TEST_1" at (120,120) and then later submit "TEST_2" at (120,120), you will replace the string "TEST_1" with "TEST_2" and maintain an overall text count of 1.
| Header | Header 2 | Address | Data Length | Command | Data | Checksum |
|---|---|---|---|---|---|---|
| 0x55 | 0xAA | 0x11 | 0x0A | 0x34 | 0x06 0x00 0x78 0x78 0x54 0x45 0x53 0x54 0x5F 0x31 | 0x14 |
Data details:
Text: "TEST_1"
Cordinate : (120,120) or (0x78,0x78)
| Data | Function |
|---|---|
| 0x06 | Length of String ("TEST_1") |
| 0x00 | X Flag (if X>=255, this byte should be set as 0xFF) |
| 0x78 | X Cordinate (if X Flag is 0xFF, this value should X % 255 ) |
| 0x78 | Y Cordinate |
| 0x54 | HEX Value of "T" |
| 0x45 | HEX Value of "E" |
| 0x53 | HEX Value of "S" |
| 0x54 | HEX Value of "T" |
| 0x5F | HEX Value of "_" |
| 0x31 | HEX Value of "1" |
Clear and delete all custom UI texts from the screen.
| Header | Header 2 | Address | Data Length | Command | Checksum |
|---|---|---|---|---|---|
| 0x55 | 0xAA | 0x11 | 0x00 | 0x35 | 0x45 |
Learn the current recognized object on screen with a chosen ID
| Header | Header 2 | Address | Data Length | Command | Data | Checksum |
|---|---|---|---|---|---|---|
| 0x55 | 0xAA | 0x11 | 0x02 | 0x36 | 0x01 0x00 | 0x49 |
Data details:
| Data | Function |
|---|---|
| 0x01 | Given ID, see ID Details above (Low Byte of 1 = 0x0001) |
| 0x00 | Given ID, see ID Details above (High Byte of 1 = 0x0001) |
Forget learned objects for the current running algorithm.
| Header | Header 2 | Address | Data Length | Command | Checksum |
|---|---|---|---|---|---|
| 0x55 | 0xAA | 0x11 | 0x00 | 0x37 | 0x47 |
Save a screenshot of the current UI to the HuskyLens SD Card.
| Header | Header 2 | Address | Data Length | Command | Checksum |
|---|---|---|---|---|---|
| 0x55 | 0xAA | 0x11 | 0x00 | 0x39 | 0x49 |
Check what model your HuskyLens is.
| Header | Header 2 | Address | Data Length | Command | Checksum |
|---|---|---|---|---|---|
| 0x55 | 0xAA | 0x11 | 0x00 | 0x3B | 0x4b |
The return value for the IS_PRO command will send a 1 (logical True) if it is a pro model and 0 (logical false) if it is the standard model.
| Header | Header 2 | Address | Data Length | Command | Data | Checksum |
|---|---|---|---|---|---|---|
| 0x55 | 0xAA | 0x11 | 0x02 | 0x3B | 0x01 0x00 | 0x4E |
Data details:
Return Value -> 1 (Pro Model)
| Data | Function |
|---|---|
| 0x01 | LOW Byte of return value |
| 0x00 | HIGH Byte of return value |
HUSKYLENS will return Busy, if send multiple command and not wait for ok.
| Header | Header 2 | Address | Data Length | Command | Checksum |
|---|---|---|---|---|---|
| 0x55 | 0xAA | 0x11 | 0x00 | 0x3D | 0x4D |
HUSKYLENS will return need pro, if send pro only command to huskylens.
| Header | Header 2 | Address | Data Length | Command | Checksum |
|---|---|---|---|---|---|
| 0x55 | 0xAA | 0x11 | 0x00 | 0x3E | 0x4E |
0.1
Angelo (Angelo.qiao@dfrobot.com)
Robert (robert@dfrobot.com)
command Use to determine whether this is arrow or block
COMMAND_RETURN_BLOCK It is a blockCOMMAND_RETURN_ARROW It is an arrowxCenter X Center of BlockyCenter Y Center of Blockwidth Width of Blockheight Height of BlockID ID of Block, see ID Meaning belowxOrigin X Origin of ArrowyOrigin Y Origin of ArrowxTarget X Target of ArrowyTarget Y Target of ArrowID ID of Arrow, see ID Meaning belowvoid printResult(HUSKYLENSResult result){
if (result.command == COMMAND_RETURN_BLOCK){
Serial.println(String() + F("Block:xCenter=") + result.xCenter + F(",yCenter=") + result.yCenter + F(",width=") + result.width + F(",height=") + result.height + F(",ID=") + result.ID);
}
else if (result.command == COMMAND_RETURN_ARROW){
Serial.println(String() + F("Arrow:xOrigin=") + result.xOrigin + F(",yOrigin=") + result.yOrigin + F(",xTarget=") + result.xTarget + F(",yTarget=") + result.yTarget + F(",ID=") + result.ID);
}
else{
Serial.println("Object unknown!");
}
}
| ID | Means |
|---|---|
| 1 | The first learned item is detected |
| 2 | The second learned item is detected |
| XXX | The XXXth learned item is detected |
| 0 | Item is detected but not learned, like unlearned faces block in grey color. |
ALGORITHM_FACE_RECOGNITION FACE RECOGNITIONALGORITHM_OBJECT_TRACKINGOBJECT TRACKINGALGORITHM_OBJECT_RECOGNITION OBJECT RECOGNITIONALGORITHM_LINE_TRACKING LINE TRACKINGALGORITHM_COLOR_RECOGNITION COLOR RECOGNITIONALGORITHM_TAG_RECOGNITION TAG RECOGNITIONALGORITHM_OBJECT_CLASSIFICATION OBJECT CLASSIFICATIONstreamInput : It could be Serial, Wire, SoftwareSerial, or other port based on Stream class.streamInput : It could be Serial, Wire, SoftwareSerial, or other port based on Stream class.timeOutDurationInput : Time out duration on ms.ID from HUSKYLENS.ID The target ID of blocks and arrowsID from HUSKYLENSID The target ID of blocksalgorithmType The algorithm you need. See protocolAlgorithm for details.ID from HUSKYLENSID The target ID of arrowsDescription: Request all learned blocks and arrows (ID >=1) from HUSKYLENS.
Returns: Whether successfully get the result.
Description: Request all learned blocks (ID >=1) from HUSKYLENS.
Returns: Whether successfully get the result.
Description: Request all learned arrows (ID >=1) from HUSKYLENS.
Returns: Whether successfully get the result.
Description: Return the count of blocks and arrows available to read. (Works like Serial or Wire)
Arguments: None
Returns: The count of blocks and arrows left in the buffer.
Description: Read blocks or arrows.(Works like Serial or Wire)
Returns: blocks or arrows in struct HUSKYLENSResult. See HUSKYLENSResult above for details.
Description: Get whether HUSKYLENS have learn something.
Returns: Whether HUSKYLENS have learn something.
Description: Get whether HUSKYLENS have learn something tagged with ID.
Arguments:
ID The target ID. See ID Meaning above for details.Returns: Whether HUSKYLENS have learn something tagged with ID.
Description: Get the number of frame HUSKYLENS have processed. Once HUSKYLENS process one frame, this number will increase by one.
Returns: The number of frame HUSKYLENS have processed.
Description: Get the count of (faces, colors, objects or lines) you have learned on HUSKYLENS. This value will depend on how many times you learn something on HUSKYLENS.
Returns: The count of (faces, colors, objects or lines) you have learned on HUSKYLENS.
Description: Get count of all blocks and arrows.
Returns: The count of all blocks and arrows.
Description: Get count of all blocks and arrows tagged with ID.
Arguments:
ID The target ID. See ID Meaning above for details.Returns: The count of all blocks and arrows tagged with ID.
Description: Get count of all blocks.
Returns: The count of all blocks.
Description: Get count of all blocks tagged with ID.
Arguments:
ID The target ID. See ID Meaning above for details.Returns: The count of all blocks tagged with ID.
Description: Get count of all arrows.
Returns: The count of all blocks and arrows.
Description: Get count of all arrows tagged with ID.
Arguments:
ID The target ID. See ID Meaning above for details.Returns: The count of all arrows tagged with ID.
Description: Get count of all learned blocks and arrows (ID >=1)
Returns: The count of all learned blocks and arrows (ID >=1)
Description: Get count of all learned blocks (ID >=1)
Returns: The count of all learned blocks (ID >=1)
Description: Get count of all learned arrows (ID >=1)
Returns: The count of all learned arrows (ID >=1)
Description: Get one of the blocks and arrows.
Arguments:
index The index of blocks and arrows, which is ordered by the received sequence. It should less than count()Returns: block or arrow in struct HUSKYLENSResult. See HUSKYLENSResult above for details.
Description: Get one of the blocks and arrows tagged with ID
Arguments:
ID The target ID. See ID Meaning above for details.index The index of blocks and arrows, which is ordered by the received sequence. It should less than count(ID)Returns: block or arrow tagged with ID in struct HUSKYLENSResult. See HUSKYLENSResult above for details.
Description: Get one of the blocks.
Arguments:
index The index of blocks, which is ordered by the received sequence. It should less than countBlocks()Returns: block in struct HUSKYLENSResult. See HUSKYLENSResult above for details.
Description: Get one of the blocks tagged with ID
Arguments:
ID The target ID. See ID Meaning above for details.index The index of blocks, which is ordered by the received sequence. It should less than countBlocks(ID)Returns: block tagged with ID in struct HUSKYLENSResult. See HUSKYLENSResult above for details.
Description: Get one of the arrows.
Arguments:
index The index of arrows, which is ordered by the received sequence. It should less than countArrows()Returns: arrow in struct HUSKYLENSResult. See HUSKYLENSResult above for details.
Description: Get one of the arrows tagged with ID
Arguments:
ID The target ID. See ID Meaning above for details.index The index of arrow, which is ordered by the received sequence. It should less than countArrows(ID)Returns: arrow tagged with ID in struct HUSKYLENSResult. See HUSKYLENSResult above for details.
Description: Get one of the learned blocks and arrows (ID >=1)
Arguments:
index The index of blocks and arrows, which is ordered by the received sequence. It should less than countLearned()Returns: block or arrow in struct HUSKYLENSResult. See HUSKYLENSResult above for details.
Description: Get one of the learned blocks (ID >=1)
Arguments:
index The index of blocks, which is ordered by the received sequence. It should less than countBlocksLearned()Returns: block in struct HUSKYLENSResult. See HUSKYLENSResult above for details.
Description: Get one of the learned arrows (ID >=1)
Arguments:
index The index of arrows, which is ordered by the received sequence. It should less than countArrowsLearned()Returns: arrow in struct HUSKYLENSResult. See HUSKYLENSResult above for details.
Description: Let HUSKYLENS switch to the target algorithm you need.
Arguments:
algorithmType The target algorithm. See protocolAlgorithm for details.Returns: Whether success.
Description: Let HUSKYLENS learn with ID. (It only works in Object Classification)
Arguments:
ID The target ID. See ID Meaning above for details.Returns: Whether success.
Description: Let HUSKYLENS forget all. (It only works in Object Classification)
Returns: Whether success.
Description: Set a custom name for a learned object with a specified ID. For example, if you have learned your face with an ID of 1, you can use setCustomName("Robert",1) to rename the learned face to "Robert".
Arguments:
name The specified custom nameid The ID of the object you want to set the custom name forReturns: Whether success.
fileNum The specified file number to be used in the name for the filefileNum The specified file number to be used in the name for the filetext The specified text you wish to enter on the screenx The X coordinate for the UI Object (0-320)y The Y coordinate for the UI Object (0-240)