samuelpowell / Spinnaker.jl

A Julia interface to the FLIR/PointGrey Spinnaker SDK
MIT License
15 stars 7 forks source link

Error showing value of type CameraList #19

Closed IanButterworth closed 5 years ago

IanButterworth commented 5 years ago

I'm getting this on master on ubuntu 18.04.

The camera that's attached (grasshopper 3) can be detected by spinview

julia> using Spinnaker
julia> camlist = CameraList()
CameraList with 1 enumerated devices:
ID  Serial No.  Description
Error showing value of type CameraList:
ERROR: Spinnaker SDK error: SPINNAKER_ERR_INVALID_HANDLE(-1006)
Stacktrace:
 [1] checkerror at /home/parallels/.julia/packages/Spinnaker/56eG7/src/Spinnaker.jl:30 [inlined]
 [2] spinNodeIsAvailable at /home/parallels/.julia/packages/Spinnaker/56eG7/src/wrapper/spin_api.jl:807 [inlined]
 [3] available at /home/parallels/.julia/packages/Spinnaker/56eG7/src/Nodes.jl:9 [inlined]
 [4] readable(::Base.RefValue{Ptr{Nothing}}) at /home/parallels/.julia/packages/Spinnaker/56eG7/src/Nodes.jl:14
 [5] set!(::Spinnaker.SpinEnumNode, ::String) at /home/parallels/.julia/packages/Spinnaker/56eG7/src/Nodes.jl:179
 [6] Camera(::Ptr{Nothing}) at /home/parallels/.julia/packages/Spinnaker/56eG7/src/Camera.jl:41
 [7] getindex(::CameraList, ::Int64) at /home/parallels/.julia/packages/Spinnaker/56eG7/src/CameraList.jl:85
 [8] show(::IOContext{REPL.Terminals.TTYTerminal}, ::CameraList) at /home/parallels/.julia/packages/Spinnaker/56eG7/src/CameraList.jl:65
 [9] show(::IOContext{REPL.Terminals.TTYTerminal}, ::MIME{Symbol("text/plain")}, ::CameraList) at ./sysimg.jl:194
 [10] display(::REPL.REPLDisplay, ::MIME{Symbol("text/plain")}, ::Any) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/REPL/src/REPL.jl:131
 [11] display(::REPL.REPLDisplay, ::Any) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/REPL/src/REPL.jl:135
 [12] display(::Any) at ./multimedia.jl:287
 [13] #invokelatest#1 at ./essentials.jl:742 [inlined]
 [14] invokelatest at ./essentials.jl:741 [inlined]
 [15] print_response(::IO, ::Any, ::Any, ::Bool, ::Bool, ::Any) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/REPL/src/REPL.jl:155
 [16] print_response(::REPL.AbstractREPL, ::Any, ::Any, ::Bool, ::Bool) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/REPL/src/REPL.jl:140
 [17] (::getfield(REPL, Symbol("#do_respond#38")){Bool,getfield(REPL, Symbol("##48#57")){REPL.LineEditREPL,REPL.REPLHistoryProvider},REPL.LineEditREPL,REPL.LineEdit.Prompt})(::Any, ::Any, ::Any) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/REPL/src/REPL.jl:714
 [18] #invokelatest#1 at ./essentials.jl:742 [inlined]
 [19] invokelatest at ./essentials.jl:741 [inlined]
 [20] run_interface(::REPL.Terminals.TextTerminal, ::REPL.LineEdit.ModalInterface, ::REPL.LineEdit.MIState) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/REPL/src/LineEdit.jl:2273
 [21] run_frontend(::REPL.LineEditREPL, ::REPL.REPLBackendRef) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/REPL/src/REPL.jl:1035
 [22] run_repl(::REPL.AbstractREPL, ::Any) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/REPL/src/REPL.jl:192
 [23] (::getfield(Base, Symbol("##734#736")){Bool,Bool,Bool,Bool})(::Module) at ./client.jl:362
 [24] #invokelatest#1 at ./essentials.jl:742 [inlined]
 [25] invokelatest at ./essentials.jl:741 [inlined]
 [26] run_main_repl(::Bool, ::Bool, ::Bool, ::Bool, ::Bool) at ./client.jl:346
 [27] exec_options(::Base.JLOptions) at ./client.jl:284
 [28] _start() at ./client.jl:436

Also

julia> camlist = CameraList();
julia> cam = camlist[0];
ERROR: Spinnaker SDK error: SPINNAKER_ERR_INVALID_HANDLE(-1006)
Stacktrace:
 [1] checkerror at /home/parallels/.julia/packages/Spinnaker/56eG7/src/Spinnaker.jl:30 [inlined]
 [2] spinNodeIsAvailable at /home/parallels/.julia/packages/Spinnaker/56eG7/src/wrapper/spin_api.jl:807 [inlined]
 [3] available at /home/parallels/.julia/packages/Spinnaker/56eG7/src/Nodes.jl:9 [inlined]
 [4] readable(::Base.RefValue{Ptr{Nothing}}) at /home/parallels/.julia/packages/Spinnaker/56eG7/src/Nodes.jl:14
 [5] set!(::Spinnaker.SpinEnumNode, ::String) at /home/parallels/.julia/packages/Spinnaker/56eG7/src/Nodes.jl:179
 [6] Camera(::Ptr{Nothing}) at /home/parallels/.julia/packages/Spinnaker/56eG7/src/Camera.jl:41
 [7] getindex(::CameraList, ::Int64) at /home/parallels/.julia/packages/Spinnaker/56eG7/src/CameraList.jl:85
 [8] top-level scope at none:0
IanButterworth commented 5 years ago

It looks like this broke in https://github.com/samuelpowell/Spinnaker.jl/commit/0f032fcb028113462b6ea5a328855a29050b12d8

samuelpowell commented 5 years ago

Hmmmm okay will look into it

IanButterworth commented 5 years ago

I've not got any further with this. You got any hunches?

samuelpowell commented 5 years ago

@ianshmean I cannot reproduce:

julia> camlist = CameraList()
CameraList with 1 enumerated devices:
ID  Serial No.  Description
0   XXXXXXXX    FLIR Blackfly S BFS-U3-16S2M

Are you definitely using the latest released version of Spinnaker.jl, or master?

samuelpowell commented 5 years ago

@ianshmean what happens if you try using examples/enumeration.jl, this script only uses the low level Spinnaker library calls and is essentially a implementation of the C level enumeration demonstration.

IanButterworth commented 5 years ago

examples/wrapper/enumeration.jl gives:

julia> include(joinpath(dirname(pathof(Spinnaker)),"..","examples/wrapper/enumeration.jl"))
[ Info: Spinnaker library version: 1.20.0, build 14
[ Info: Discovered 3 interfaces
[ Info: Discovered 1 cameras
[ Info: GEV Interface 0
[ Info: No cameras detected
[ Info: GEV Interface 1
[ Info: No cameras detected
[ Info: USB Interface 0
[ Info: Point Grey Research
[ Info: Grasshopper3 GS3-U3-32S4M
samuelpowell commented 5 years ago

Okay I'll try and see what's different between the two...

IanButterworth commented 5 years ago

For reference, rolling back to https://github.com/samuelpowell/Spinnaker.jl/commit/7585748e3d87b08ec435f4a54f9786f662444176 works and gives:

julia> CameraList()
CameraList with 1 enumerated devices:
ID  Serial No.  Description
0   17198xxx    Point Grey Research Grasshopper3 GS3-U3-32S4M
samuelpowell commented 5 years ago

@ianshmean what happens if get your camera and do:

get(SpinEnumNode(cam, "ChunkSelector"))

IanButterworth commented 5 years ago

@samuelpowell I think you're in the right area.. my camera doesn't seem to support the Timestamp chunk, and maybe has renamed FrameID? https://github.com/samuelpowell/Spinnaker.jl/blob/71dcd901c63addc7871377162ee0c335241e41d8/src/Camera.jl#L40-L43

From https://www.ptgrey.com/support/downloads/10125/ page 158: image

samuelpowell commented 5 years ago

Yes.... try PR #27

IanButterworth commented 5 years ago

Great.

julia> camlist = CameraList()
CameraList with 1 enumerated devices:
ID  Serial No.  Description
┌ Warning: Unable to enable FrameID chunk, image metadata may be incorrect
└ @ Spinnaker ~/.julia/packages/Spinnaker/nGAnR/src/Camera.jl:45
0   17198035    Point Grey Research Grasshopper3 GS3-U3-32S4M

It's not very helpful that they've got multiple names for the frame counter. Perhaps a try with alternatives approach??

samuelpowell commented 5 years ago

I will open an issue to fix it, PR welcome. Timestamp not critical but frame ID useful.

IanButterworth commented 5 years ago

Oddly I'm not getting an error for Timestamp.. perhaps it's a hidden chunk option

samuelpowell commented 5 years ago

Partial fix in #27, pending resolution in #28