Skip to content

Commit

Permalink
flir code development. flircode_build is the release and can now be f…
Browse files Browse the repository at this point in the history
…ound in artiq!
  • Loading branch information
hoodjd committed Jan 20, 2021
1 parent 06e60f3 commit 0c35c66
Show file tree
Hide file tree
Showing 232 changed files with 51,612 additions and 26 deletions.
3 changes: 2 additions & 1 deletion FLIR/DavidsReadme.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Since it was less than 100mb, I copied the entire python SDK here. You must have it locally installed to be able to run it from here!
The OneNote has instructions on how to install. Dont use their install guide!

FLIRcodev3.0 is the first version I released. It is stable on the software end but the hardware end is untested. v3.1 is the hardware testing end.
FLIRcodev3.0 is the first version I released. It is stable on the software end but the hardware end is untested. v3.1 is the hardware testing end.
v3.3 is a rewriting of 3.2 code to clean it up and simplify.
29 changes: 17 additions & 12 deletions FLIR/FLIRcodev3.1/build/lib/flir/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,37 +390,41 @@ def run_single_camera(cam):
:return: True if successful, False otherwise.
:rtype: bool
"""
print("393-postfunction")
try:
print("395")
result = True
err = False

print("398")
# Retrieve TL device nodemap and print device information
nodemap_tldevice = cam.GetTLDeviceNodeMap()

print("401")
result &= print_device_info(nodemap_tldevice)

print("403")
# Initialize camera
cam.Init()

print("406")
# Retrieve GenICam nodemap
nodemap = cam.GetNodeMap()

print("409")
# Configure trigger
if configure_trigger(cam) is False:
return False

print("413")
# Acquire images
result &= grab_next_image_by_trigger(cam) #acquire_images(cam) THIS IS WHAT I CHANGED TO TRY TO GRAB ONLY ONE IMAGE AT A TIME!

print("416")
# Reset trigger
result &= reset_trigger(cam)

print("419")
# Deinitialize camera
cam.DeInit()

print("422")
except PySpin.SpinnakerException as ex:
print("424-exception")
print('Error: %s' % ex)
result = False


return result

Expand Down Expand Up @@ -459,13 +463,14 @@ def picture(cam):
print('Not enough cameras!')
print("Closing camera instance...") #input('Done! Press Enter to exit...')
return False

print(cam)
# Run example on each camera
for i, cam in enumerate(cam_list):

print('Running example for camera %d...' % i)

result &= run_single_camera(cam)

print("472-prefunction")
result &= run_single_camera(cam)
print('Camera %d example complete... \n' % i)

# Release reference to camera
Expand Down
Binary file added FLIR/FLIRcodev3.1/dist/flir-0.0.0-py3.7.egg
Binary file not shown.
Binary file modified FLIR/FLIRcodev3.1/dist/flir-0.0.0-py3.8.egg
Binary file not shown.
29 changes: 17 additions & 12 deletions FLIR/FLIRcodev3.1/flir/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,37 +390,41 @@ def run_single_camera(cam):
:return: True if successful, False otherwise.
:rtype: bool
"""
print("393-postfunction")
try:
print("395")
result = True
err = False

print("398")
# Retrieve TL device nodemap and print device information
nodemap_tldevice = cam.GetTLDeviceNodeMap()

print("401")
result &= print_device_info(nodemap_tldevice)

print("403")
# Initialize camera
cam.Init()

print("406")
# Retrieve GenICam nodemap
nodemap = cam.GetNodeMap()

print("409")
# Configure trigger
if configure_trigger(cam) is False:
return False

print("413")
# Acquire images
result &= grab_next_image_by_trigger(cam) #acquire_images(cam) THIS IS WHAT I CHANGED TO TRY TO GRAB ONLY ONE IMAGE AT A TIME!

print("416")
# Reset trigger
result &= reset_trigger(cam)

print("419")
# Deinitialize camera
cam.DeInit()

print("422")
except PySpin.SpinnakerException as ex:
print("424-exception")
print('Error: %s' % ex)
result = False


return result

Expand Down Expand Up @@ -459,13 +463,14 @@ def picture(cam):
print('Not enough cameras!')
print("Closing camera instance...") #input('Done! Press Enter to exit...')
return False

print(cam)
# Run example on each camera
for i, cam in enumerate(cam_list):

print('Running example for camera %d...' % i)

result &= run_single_camera(cam)

print("472-prefunction")
result &= run_single_camera(cam)
print('Camera %d example complete... \n' % i)

# Release reference to camera
Expand Down
21 changes: 20 additions & 1 deletion FLIR/FLIRcodev3.1/readme.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@
v1.0 was a failure based on the simplistic code of the manual. Scrapped.
v2.0 was a copy-paste of novatech code with all names and unique functions REMOVED
v3.0 is v2.0 but with the addition of the flir camera functions. Methods are working without the camera. Call "sipyco_rpctool ::1 3200 call picture" to get trigger picture.
v3.1 I dont want to ruin v3.0 stability when hardware testing. v3.1 is hardware testing.
v3.1 I dont want to ruin v3.0 stability when hardware testing. v3.1 is hardware testing.


Installation:
1. Install Spinnaker with python3.8
conda install python3.8
2. In Flircodevx.x directory, run:

conda install sipyco
conda install asyncserial
python setup.py build
python setup.py install

3. Change directories to flir and start server with:

python aqctl_flir.py

4. In another anaconda window, in the flir directory, take picture with:

sipyco_rpctool ::1 3200 call picture
Loading

0 comments on commit 0c35c66

Please sign in to comment.