So now I'm trying to use requestAll() attribute.but I get an indexError: list index out of range. The compiler says something is wrong with blocks = hl.blocks().Code:
hl.requestAll()blocks = hl.blocks()if blocks and len(blocks) > 0: first_object = blocks[0] print(f"ID: {first_object.ID}, X: {first_object.x}, Y: {first_object.y}")else: print("🔍 No objects detected")
1. You make a call to hl.requestAll() but don't make any use the data that is returned.
2. the blocks method is defined as -
Code:
def blocks(self): cmd = self.cmdToBytes(commandHeaderAndAddress+"002131") self.writeToHuskyLens(cmd) return self.processReturnData()[0]This will be my final contribution. I suggest seeing if Robert Prast, the developer of this undocumented library, is still at DFRobot, using the contact details given in the README.md for the Github repository. Or raise an Issue in the Repository. (But I think the chances of getting a reply are slim...) https://github.com/HuskyLens/HUSKYLENSPython/issues And note that Issue #18 seems directly relevant to your query. https://github.com/HuskyLens/HUSKYLENSPython/issues/18
Statistics: Posted by B.Goode — Sun Jul 20, 2025 5:48 pm