facebookresearch / digit-design

Design files for the DIGIT tactile sensor
Other
148 stars 25 forks source link

Programming Digit Device #15

Closed vbetancu closed 3 years ago

vbetancu commented 3 years ago

Good evening,

I was trying to flash the firmware for the Digit device but it seems like the instructions (at least for the programmer) are for Linux. Do you have instructions for Windows by chance?

Thanks in advance, Veronica

AlphaBetaPhi commented 3 years ago

Hello @vbetancu,

Thank you for your interest.

You may follow the link in this post to download the toolchain for Windows.

https://github.com/facebookresearch/digit-interface/issues/3#issuecomment-657252046

vbetancu commented 3 years ago

Thank you for your response. I followed the instructions from the other post and downloaded the toolchain and flashed "digit-2020-1b.bin" to the device. Then I went to the programmer and changed the serial to D00001. What would be the next step?

vbetancu commented 3 years ago

I unplugged and plugged back device and now it's recognized. Then I followed installation instructions in this link:https://github.com/facebookresearch/digit-interface/blob/master/README.md How to proceed for the usage section? Spyder or similar? I've been trying with Spyder but since I am working with a Windows it does not recognize the fcntl

AlphaBetaPhi commented 3 years ago

Hi @vbetancu,

I have attached a picture for future reference on Windows programming.

win32-digit-programming

The DIGIT interface currently only supports Linux based operating systems. However, to use DIGIT on Windows you can initialize the DIGIT class without a serial number and then populate the device name using the OpenCV device ID (in this example it is 0):

from digit_interface.digit import Digit

d = Digit(name="DIGIT Dev 0")
d.dev_name = 0

d.connect()
d.show_view()
d.disconnect()
vbetancu commented 3 years ago

Thank you very much Mike. I was able to get the device to stream video but it's not able to take single frames. I am following the procedure in the read me file. Am I missing something?

from digit_interface.digit import Digit d = Digit("DXXXXX") # Unique serial number d.connect() frame = d.get_frame() print(f"Frame WxH: {frame.shape[0]}{frame.shape[1]}")

AlphaBetaPhi commented 3 years ago

Hi @vbetancu,

We do not support connecting to the serial number of the device on Windows platforms. Please try the following,

from digit_interface.digit import Digit

d = Digit(name="DIGIT Dev 0")
d.dev_name = 0
d.connect()

frame = d.get_frame()
print(f"Frame WxH: {frame.shape[0]}{frame.shape[1]}")
vbetancu commented 3 years ago

Thank you Mike. I actually switched to a Linux operating system when trying to implement the code in the previous message. The d.show_view() works but the frame = d.get_frame wasn't working for me.

AlphaBetaPhi commented 3 years ago

What does the output show?

vbetancu commented 3 years ago

runfile('/home/gelsight/.config/spyder-py3/temp.py', wdir='/home/gelsight/.config/spyder-py3') Frame WxH: 320240

But it didn't take a picture

vbetancu commented 3 years ago

That's the output I get after running: from digit_interface.digit import Digit d = Digit("DXXXXX") # Unique serial number d.connect() frame = d.get_frame() print(f"Frame WxH: {frame.shape[0]}{frame.shape[1]}")

AlphaBetaPhi commented 3 years ago

d.get_frame() returns a frame into the variable frame which can then later be used for processing in the application. This does not save the frame. To do this,

from digit_interface.digit import Digit
d = Digit("DXXXXX") # Unique serial number
d.connect()
frame = d.save_frame()
vbetancu commented 3 years ago

That worked! Thank you MIke!

AlphaBetaPhi commented 3 years ago

Great to hear @vbetancu, closing this issue.