![]() |
qwiic_huskylens_py
2.0.0-2-ge82220f
Python for SFE qwiic huskylens py
|
Classes | |
class | _Response |
class | _ReturnInfo |
class | Arrow |
class | Block |
Public Member Functions | |
def | __init__ (self, address=None, i2c_driver=None) |
Constructor. More... | |
def | request_knock (self) |
Request a knock from the Huskylens. More... | |
def | is_connected (self) |
Determines if this device is connected. More... | |
def | begin (self) |
Initializes this device with default parameters. More... | |
def | request (self) |
Request all blocks and arrows from the Huskylens. More... | |
def | wait_for_objects_of_interest (self) |
Wait for the Huskylens to detect objects of interest (blocks) based on the current algorithm. More... | |
def | wait_for_lines_of_interest (self) |
Wait for the Huskylens to detect lines of interest (arrows) based on the current algorithm. More... | |
def | get_objects_of_interest (self) |
Get the objects of interest (blocks) detected by the Huskylens based on the current algorithm. More... | |
def | get_lines_of_interest (self) |
Get the lines of interest (arrows) detected by the Huskylens based on the current algorithm. More... | |
def | request_blocks (self) |
Request all blocks from the Huskylens. More... | |
def | request_arrows (self) |
Request all arrows from the Huskylens. More... | |
def | request_learned (self) |
Request all learned blocks and arrows from the Huskylens. More... | |
def | request_blocks_learned (self) |
Request all learned blocks from the Huskylens. More... | |
def | request_arrows_learned (self) |
Request all learned arrows from the Huskylens. More... | |
def | request_by_id (self, id) |
Request all blocks or arrows by a given ID from the Huskylens. More... | |
def | request_blocks_by_id (self, id) |
Request all blocks by a given ID from the Huskylens. More... | |
def | request_arrows_by_id (self, id) |
Request all arrows by a given ID from the Huskylens. More... | |
def | request_algorithm (self, algorithm) |
Change the algorithm of the Huskylens and return the result. More... | |
def | set_algorithm (self, algorithm) |
Change the algorithm of the Huskylens. More... | |
def | request_custom_names (self, id, name) |
Set a custom name for a learned object from the Huskylens. More... | |
def | get_name_for_id (self, id) |
Get the name of a learned object by its ID. More... | |
def | name_last (self, name) |
Set a custom name for the last learned object from the Huskylens. More... | |
def | request_photo (self) |
Save a photo on the Huskylens SD Card. More... | |
def | request_send_knowledges (self, fileNum) |
Save the current algorithms model to the SD Card. More... | |
def | request_receive_knowledges (self, fileNum) |
Load a model file from the SD Card to the current algorithm. More... | |
def | request_custom_text (self, text, x=0, y=0) |
Place a string of text on the Huskylens UI. More... | |
def | write_to_screen (self, text, x=0, y=0) |
Place a string of text on the Huskylens UI. More... | |
def | request_clear_text (self) |
Clear and delete all custom UI texts from the screen. More... | |
def | clear_screen (self) |
Clear and delete all custom UI texts from the screen. More... | |
def | request_learn (self, id) |
Learn a current recognized object on screen based on its ID. More... | |
def | learn_new (self) |
Learn the current recognized object on screen. More... | |
def | learn_same (self) |
Learn the current recognized object on screen with the same ID as the last learn call. More... | |
def | request_forget (self) |
Forget learned objects for the current running algorithm. More... | |
def | forget (self) |
Forget all learned objects for the current running algorithm. More... | |
def | request_save_screenshot (self) |
Save a screenshot of the current UI to the Huskylens SD Card. More... | |
def | request_is_pro (self) |
Check what model your Huskylens is. More... | |
Public Attributes | |
address | |
blocks | |
arrows | |
nLearned | |
idToName | |
Properties | |
connected = property(is_connected) | |
def qwiic_huskylens.QwiicHuskylens.__init__ | ( | self, | |
address = None , |
|||
i2c_driver = None |
|||
) |
Constructor.
int | address: The I2C address to use for the device If not provided, the default address is used |
I2CDriver | i2c_driver: An existing i2c driver object If not provided, a driver object is created |
int | nLearned: The number of objects already learned. The Huskylens will assign IDs to learned objects starting from nLearned + 1. It is assumed by the protocol that the IDs are consecutive. |
def qwiic_huskylens.QwiicHuskylens.begin | ( | self | ) |
Initializes this device with default parameters.
True
if successful, otherwise False
def qwiic_huskylens.QwiicHuskylens.clear_screen | ( | self | ) |
Clear and delete all custom UI texts from the screen.
def qwiic_huskylens.QwiicHuskylens.forget | ( | self | ) |
Forget all learned objects for the current running algorithm.
def qwiic_huskylens.QwiicHuskylens.get_lines_of_interest | ( | self | ) |
Get the lines of interest (arrows) detected by the Huskylens based on the current algorithm.
Returned objects have the following properties:
def qwiic_huskylens.QwiicHuskylens.get_name_for_id | ( | self, | |
id | |||
) |
Get the name of a learned object by its ID.
Note: This will does not query the device and is based on internal program state, so it will not persist across program runs.
int | id: The ID of the object |
None
if not found def qwiic_huskylens.QwiicHuskylens.get_objects_of_interest | ( | self | ) |
Get the objects of interest (blocks) detected by the Huskylens based on the current algorithm.
Returned objects have the following properties:
def qwiic_huskylens.QwiicHuskylens.is_connected | ( | self | ) |
Determines if this device is connected.
True
if connected, otherwise False
def qwiic_huskylens.QwiicHuskylens.learn_new | ( | self | ) |
Learn the current recognized object on screen.
It will be assigned an ID starting from nLearned + 1.
def qwiic_huskylens.QwiicHuskylens.learn_same | ( | self | ) |
Learn the current recognized object on screen with the same ID as the last learn call.
def qwiic_huskylens.QwiicHuskylens.name_last | ( | self, | |
name | |||
) |
Set a custom name for the last learned object from the Huskylens.
str | name: The name to set |
def qwiic_huskylens.QwiicHuskylens.request | ( | self | ) |
Request all blocks and arrows from the Huskylens.
Will fill self.blocks and self.arrows with the returned information
True
if successful, otherwise False
def qwiic_huskylens.QwiicHuskylens.request_algorithm | ( | self, | |
algorithm | |||
) |
Change the algorithm of the Huskylens and return the result.
int | algorithm: The algorithm to set. See the kAlgorithm constants. |
True
if successful, otherwise False
. def qwiic_huskylens.QwiicHuskylens.request_arrows | ( | self | ) |
Request all arrows from the Huskylens.
Will fill self.arrows with the returned information
True
if successful, otherwise False
def qwiic_huskylens.QwiicHuskylens.request_arrows_by_id | ( | self, | |
id | |||
) |
Request all arrows by a given ID from the Huskylens.
This will fill self.arrows with the returned information
int | id: The ID to request |
def qwiic_huskylens.QwiicHuskylens.request_arrows_learned | ( | self | ) |
Request all learned arrows from the Huskylens.
def qwiic_huskylens.QwiicHuskylens.request_blocks | ( | self | ) |
Request all blocks from the Huskylens.
Will fill self.blocks with the returned information
True
if successful, otherwise False
def qwiic_huskylens.QwiicHuskylens.request_blocks_by_id | ( | self, | |
id | |||
) |
Request all blocks by a given ID from the Huskylens.
This will fill self.blocks with the returned information
int | id: The ID to request |
def qwiic_huskylens.QwiicHuskylens.request_blocks_learned | ( | self | ) |
Request all learned blocks from the Huskylens.
def qwiic_huskylens.QwiicHuskylens.request_by_id | ( | self, | |
id | |||
) |
Request all blocks or arrows by a given ID from the Huskylens.
This will fill self.blocks or self.arrows with the returned information
int | id: The ID to request |
def qwiic_huskylens.QwiicHuskylens.request_clear_text | ( | self | ) |
Clear and delete all custom UI texts from the screen.
def qwiic_huskylens.QwiicHuskylens.request_custom_names | ( | self, | |
id, | |||
name | |||
) |
Set a custom name for a learned object from the Huskylens.
int | id: The ID of the object |
str | name: The name to set |
def qwiic_huskylens.QwiicHuskylens.request_custom_text | ( | self, | |
text, | |||
x = 0 , |
|||
y = 0 |
|||
) |
Place a string of text on the Huskylens UI.
str | text: The text to display |
int | x: The x-coordinate of the text |
int | y: The y-coordinate of the text |
def qwiic_huskylens.QwiicHuskylens.request_forget | ( | self | ) |
Forget learned objects for the current running algorithm.
def qwiic_huskylens.QwiicHuskylens.request_is_pro | ( | self | ) |
Check what model your Huskylens is.
True
if the Huskylens is a pro model, otherwise False
def qwiic_huskylens.QwiicHuskylens.request_knock | ( | self | ) |
Request a knock from the Huskylens.
True
if successful, otherwise False
def qwiic_huskylens.QwiicHuskylens.request_learn | ( | self, | |
id | |||
) |
Learn a current recognized object on screen based on its ID.
int | id: The ID to assign to the object |
def qwiic_huskylens.QwiicHuskylens.request_learned | ( | self | ) |
Request all learned blocks and arrows from the Huskylens.
def qwiic_huskylens.QwiicHuskylens.request_photo | ( | self | ) |
Save a photo on the Huskylens SD Card.
def qwiic_huskylens.QwiicHuskylens.request_receive_knowledges | ( | self, | |
fileNum | |||
) |
Load a model file from the SD Card to the current algorithm.
int | fileNum: The file number to load |
def qwiic_huskylens.QwiicHuskylens.request_save_screenshot | ( | self | ) |
Save a screenshot of the current UI to the Huskylens SD Card.
def qwiic_huskylens.QwiicHuskylens.request_send_knowledges | ( | self, | |
fileNum | |||
) |
Save the current algorithms model to the SD Card.
int | fileNum: The file number to save |
def qwiic_huskylens.QwiicHuskylens.set_algorithm | ( | self, | |
algorithm | |||
) |
Change the algorithm of the Huskylens.
int | algorithm: The algorithm to set. See the kAlgorithm constants. |
True
if successful, otherwise False
. def qwiic_huskylens.QwiicHuskylens.wait_for_lines_of_interest | ( | self | ) |
Wait for the Huskylens to detect lines of interest (arrows) based on the current algorithm.
def qwiic_huskylens.QwiicHuskylens.wait_for_objects_of_interest | ( | self | ) |
Wait for the Huskylens to detect objects of interest (blocks) based on the current algorithm.
def qwiic_huskylens.QwiicHuskylens.write_to_screen | ( | self, | |
text, | |||
x = 0 , |
|||
y = 0 |
|||
) |
Place a string of text on the Huskylens UI.
str | text: The text to display |
int | x: The x-coordinate of the text |
int | y: The y-coordinate of the text |
qwiic_huskylens.QwiicHuskylens.address |
qwiic_huskylens.QwiicHuskylens.arrows |
|
static |
qwiic_huskylens.QwiicHuskylens.blocks |
|
static |
qwiic_huskylens.QwiicHuskylens.idToName |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
qwiic_huskylens.QwiicHuskylens.nLearned |
|
static |