Skip to content

Commit

Permalink
* Removing lvdemo.c. Only need to build the dll
Browse files Browse the repository at this point in the history
* Much improved error handling, better and cleaner VI's and wrapper functionality
* Now uses IMAQ for image processing. Much more extensive library for machine vision.

Signed-off-By: Ryan Gordon <rygordon4@gmail.com>
  • Loading branch information
RyanGordon authored and qdot committed Jan 23, 2011
1 parent 7feae2b commit 18252c9
Show file tree
Hide file tree
Showing 24 changed files with 21 additions and 40 deletions.
27 changes: 1 addition & 26 deletions wrappers/labview/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# C Labview Interface
######################################################################################
set_source_files_properties(libfreenect_lv.c PROPERTIES LANGUAGE CXX)
set_source_files_properties(lvdemo.c PROPERTIES LANGUAGE CXX)

add_library (freenect_lv SHARED libfreenect_lv.c)
set_target_properties (freenect_lv PROPERTIES
Expand All @@ -14,28 +13,4 @@ target_link_libraries (freenect_lv freenect freenect_sync)
install (TARGETS freenect_lv
DESTINATION "${PROJECT_LIBRARY_INSTALL_DIR}")
install (FILES "libfreenect_lv.h"
DESTINATION ${PROJECT_INCLUDE_INSTALL_DIR})

set(THREADS_USE_PTHREADS_WIN32 true)
find_package(Threads REQUIRED)

include_directories(${THREADS_PTHREADS_INCLUDE_DIR})

find_package(Threads REQUIRED)
find_package(OpenGL REQUIRED)
find_package(GLUT REQUIRED)

include_directories(${OPENGL_INCLUDE_DIRS} ${GLUT_INCLUDE_DIRS} ${USB_INCLUDE_DIRS})

if (WIN32)
set(MATH_LIB "")
else(WIN32)
set(MATH_LIB "m")
endif()

add_executable(lvdemo lvdemo.c)

target_link_libraries(lvdemo freenect freenect_sync freenect_lv ${OPENGL_LIBRARIES} ${GLUT_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} ${MATH_LIB})

install (TARGETS lvdemo
DESTINATION bin)
DESTINATION ${PROJECT_INCLUDE_INSTALL_DIR})
6 changes: 3 additions & 3 deletions wrappers/labview/README
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
General information:
These drivers are still very very experimental and while they work, they are not stable. I guarantee there will be problems we haven't discovered yet. Please keep this in mind!
These drivers are still very very experimental and while they work, they are not 100% stable. There will probably be problems we haven't discovered yet. Please keep this in mind!

Needed first before this works:
1) Windows machine with a (preferably) new version of LabVIEW (8.6+). Older versions untested.
2) inf files (driver files) Please see: http://openkinect.org/wiki/Getting_Started_Windows and follow the Driver Installation instructions. You don't need the dependencies or the other instructions unless you actually want to mess with and compile the code that makes up the dlls.

Known issues:
1) RGB image in example.vi isn't being color-converted correctly but works enough to provide as an example. To be diagnosed
1) Only 11Bit Depth Format and RGB Format work currently. Support for the others is being added soon.
2) It is IMPORTANT to make sure the Kinect is turned off (either by pressing the the "stop" button in example.vi or running "stop.vi" or manually removing physical power from the Kinect before working on the code. It's been seen that LabView will close without warning or explanation if these steps are not taken. If LabView crashes when you try and run it, unplug your Kinect physically, wait a few seconds, and plug it back in. Restarting your computer or LabVIEW may also help. Save your work often.

Information:
- The depth frame image in example.vi uses an arbitrary gray-scale false-color rendering. The raw resultant array can be accessed from the vi "get depth frame.vi" included in libfreenect.lvlib. Please see: http://openkinect.org/wiki/Protocol_Documentation for more information
- The RGB frame image in example.vi can be directly accessed from the raw resultant array in "get image frame.vi" included in libfreenect.lvlib. Please see: http://openkinect.org/wiki/Imaging_Information for more information
- The dlls in this project are 32bit compiled with MSVC 2010
- Only have tested 1 sychronous Kinect so far
- Only has been tested with 1 Kinect
- Timing is very important to frame rate speed. Please be considerate to cycles when developing algorithms on top of these drivers

If you have problems, email me at rygordon4@gmail.com or find me on irc.freenode.net #openkinect under the RyanGordon alias.
1 change: 0 additions & 1 deletion wrappers/labview/libfreenect_lv.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ EXPORT char *freenect_lv_get_image_frame(int index, freenect_video_format fmt)
{
return NULL;
}

return rgb;
}

Expand Down
Binary file modified wrappers/labview/lvlib/VIs/example.vi
Binary file not shown.
Binary file not shown.
Binary file modified wrappers/labview/lvlib/VIs/get depth frame.vi
Binary file not shown.
Binary file modified wrappers/labview/lvlib/VIs/get image frame.vi
Binary file not shown.
Binary file modified wrappers/labview/lvlib/VIs/get tilt state mks.vi
Binary file not shown.
Binary file modified wrappers/labview/lvlib/VIs/get tilt state.vi
Binary file not shown.
Binary file added wrappers/labview/lvlib/VIs/get_depth_imaq.vi
Binary file not shown.
Binary file added wrappers/labview/lvlib/VIs/get_image_imaq.vi
Binary file not shown.
Binary file modified wrappers/labview/lvlib/VIs/set led.vi
Binary file not shown.
Binary file modified wrappers/labview/lvlib/VIs/set tilt degs.vi
Binary file not shown.
Binary file modified wrappers/labview/lvlib/VIs/stop.vi
Binary file not shown.
Binary file modified wrappers/labview/lvlib/datatypes/freenect_depth_format.ctl
Binary file not shown.
Binary file modified wrappers/labview/lvlib/datatypes/freenect_led_options.ctl
Binary file not shown.
Binary file modified wrappers/labview/lvlib/datatypes/freenect_raw_tilt_state.ctl
Binary file not shown.
Binary file not shown.
Binary file modified wrappers/labview/lvlib/datatypes/freenect_tilt_status_code.ctl
Binary file not shown.
Binary file modified wrappers/labview/lvlib/datatypes/freenect_video_format.ctl
Binary file not shown.
Binary file modified wrappers/labview/lvlib/freenect.dll
Binary file not shown.
Binary file modified wrappers/labview/lvlib/freenect_lv.dll
Binary file not shown.
Binary file modified wrappers/labview/lvlib/freenect_sync.dll
Binary file not shown.
27 changes: 17 additions & 10 deletions wrappers/labview/lvlib/libfreenect.lvlib
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@
<?xml version='1.0' encoding='UTF-8'?>
<Library LVVersion="8608001">
<Property Name="NI.Lib.Icon" Type="Bin">#'#!!1!!!!)!"1!&amp;!!!-!%!!!@````]!!!!"!!%!!!+G!!!*Q(C=\:9\DB."%)&lt;`:4&gt;9E@E'S#*T7&amp;=Q#9%T3ZSALG#=L&lt;2#=LI3$EJ;2%$G!TCR%)(4CD&lt;X&amp;8S&amp;Y?NWYXWA(1M*"!(6LHH]V68VO;=^MF4N5LJ1&gt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#OV%PV$XY']9;@1=9RHL7!!!!!!</Property>
<Property Name="NI.Lib.Version" Type="Str">1.0.0.0</Property>
<Item Name="datatypes" Type="Folder">
<Item Name="freenect_depth_format.ctl" Type="VI" URL="../datatypes/freenect_depth_format.ctl"/>
<Item Name="freenect_led_options.ctl" Type="VI" URL="../datatypes/freenect_led_options.ctl"/>
<Item Name="freenect_raw_tilt_state.ctl" Type="VI" URL="../datatypes/freenect_raw_tilt_state.ctl"/>
<Item Name="freenect_tilt_status_code.ctl" Type="VI" URL="../datatypes/freenect_tilt_status_code.ctl"/>
<Item Name="freenect_video_format.ctl" Type="VI" URL="../datatypes/freenect_video_format.ctl"/>
<Item Name="freenect_rgb_24bit.ctl" Type="VI" URL="../datatypes/freenect_rgb_24bit.ctl"/>
</Item>
<Item Name="dll" Type="Folder">
<Item Name="freenect_lv.dll" Type="Document" URL="../freenect_lv.dll"/>
<Item Name="get depth frame.vi" Type="VI" URL="../VIs/get depth frame.vi"/>
<Item Name="get image frame.vi" Type="VI" URL="../VIs/get image frame.vi"/>
<Item Name="get tilt state.vi" Type="VI" URL="../VIs/get tilt state.vi"/>
<Item Name="get tilt state mks.vi" Type="VI" URL="../VIs/get tilt state mks.vi"/>
<Item Name="set led.vi" Type="VI" URL="../VIs/set led.vi"/>
<Item Name="set tilt degs.vi" Type="VI" URL="../VIs/set tilt degs.vi"/>
<Item Name="stop.vi" Type="VI" URL="../VIs/stop.vi"/>
</Item>
<Item Name="imaq" Type="Folder">
<Item Name="get_image_imaq.vi" Type="VI" URL="../VIs/get_image_imaq.vi"/>
<Item Name="get_depth_imaq.vi" Type="VI" URL="../VIs/get_depth_imaq.vi"/>
</Item>
<Item Name="freenect_lv.dll" Type="Document" URL="../freenect_lv.dll"/>
<Item Name="get depth frame.vi" Type="VI" URL="../VIs/get depth frame.vi"/>
<Item Name="get image frame.vi" Type="VI" URL="../VIs/get image frame.vi"/>
<Item Name="get tilt state.vi" Type="VI" URL="../VIs/get tilt state.vi"/>
<Item Name="get tilt state mks.vi" Type="VI" URL="../VIs/get tilt state mks.vi"/>
<Item Name="set led.vi" Type="VI" URL="../VIs/set led.vi"/>
<Item Name="set tilt degs.vi" Type="VI" URL="../VIs/set tilt degs.vi"/>
<Item Name="stop.vi" Type="VI" URL="../VIs/stop.vi"/>
<Item Name="example.vi" Type="VI" URL="../VIs/example.vi"/>
</Library>

0 comments on commit 18252c9

Please sign in to comment.