diff --git a/3rd_party/libirimager-1.0.0-amd64.deb b/3rd_party/libirimager-1.0.0-amd64.deb deleted file mode 100644 index 1cfa444..0000000 Binary files a/3rd_party/libirimager-1.0.0-amd64.deb and /dev/null differ diff --git a/3rd_party/libirimager-1.0.0-armhf.deb b/3rd_party/libirimager-1.0.0-armhf.deb deleted file mode 100644 index b28029e..0000000 Binary files a/3rd_party/libirimager-1.0.0-armhf.deb and /dev/null differ diff --git a/3rd_party/libirimager-1.0.0-i386.deb b/3rd_party/libirimager-1.0.0-i386.deb deleted file mode 100644 index 9657c5c..0000000 Binary files a/3rd_party/libirimager-1.0.0-i386.deb and /dev/null differ diff --git a/88-optrisimager-usb.rules b/88-optrisimager-usb.rules deleted file mode 100644 index af38ec4..0000000 --- a/88-optrisimager-usb.rules +++ /dev/null @@ -1,2 +0,0 @@ -# make optris device mount with writing permissions (default is read only for unknown devices) -ATTRS{idProduct}=="de37",ATTRS{idVendor}=="0403",MODE="666",GROUP="video" diff --git a/CMakeLists.txt b/CMakeLists.txt index 09289bf..0975906 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,108 +1,25 @@ -cmake_minimum_required(VERSION 2.8.3) -project(optris_drivers) +cmake_minimum_required(VERSION 2.4.6) +include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake) -## Find catkin macros and libraries -## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz) -## is used, also find other catkin packages -find_package(catkin REQUIRED COMPONENTS - roscpp - std_msgs - std_srvs - sensor_msgs - image_transport - message_generation -) +# Set the build type. Options are: +# Coverage : w/ debug symbols, w/o optimization, w/ code-coverage +# Debug : w/ debug symbols, w/o optimization +# Release : w/o debug symbols, w/ optimization +# RelWithDebInfo : w/ debug symbols, w/ optimization +# MinSizeRel : w/o debug symbols, w/ optimization, stripped binaries +#set(ROS_BUILD_TYPE RelWithDebInfo) -## System dependencies are found with CMake's conventions -find_package(Boost REQUIRED COMPONENTS thread) +rosbuild_init() -####################################### -## Declare ROS messages and services ## -####################################### +set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin) +set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib) -## Generate services in the 'srv' folder -add_service_files( - DIRECTORY - srv - FILES - AutoFlag.srv - ForceFlag.srv -) +#rosbuild_genmsg() +rosbuild_gensrv() -## Generate added messages and services with any dependencies listed here -generate_messages( - DEPENDENCIES - std_srvs -) - -################################### -## catkin specific configuration ## -################################### -## The catkin_package macro generates cmake config files for your package -## Declare things to be passed to dependent projects -## INCLUDE_DIRS: uncomment this if you package contains header files -## LIBRARIES: libraries you create in this project that dependent projects also need -## CATKIN_DEPENDS: catkin_packages dependent projects also need -## DEPENDS: system dependencies of this project that dependent projects also need -catkin_package( - INCLUDE_DIRS -# LIBRARIES - CATKIN_DEPENDS - roscpp - std_msgs - std_srvs - sensor_msgs - image_transport - message_runtime - DEPENDS - libudev-dev - Boost -) - -########### -## Build ## -########### - -## Declare a cpp executable -add_executable(optris_imager_node src/optris_imager_node.cpp) -add_executable(optris_colorconvert_node src/optris_colorconvert_node.cpp) - -## make sure msg/srvs are generated before building the targets -## also, the libs must be copied before trying to build the other files -add_dependencies(optris_imager_node irimager irimageprocessing) -add_dependencies(optris_colorconvert_node irimager irimageprocessing) - - -## Specify libraries to link a library or executable target against -target_link_libraries(optris_imager_node - ${catkin_LIBRARIES} - ${Boost_LIBRARIES} - irimager - irimageprocessing - udev - pthread -) - -target_link_libraries(optris_colorconvert_node - ${catkin_LIBRARIES} - ${Boost_LIBRARIES} - irimager - irimageprocessing - udev -) - - -############# -## Install ## -############# - -# all install targets should use catkin DESTINATION variables -# See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html - -## Mark executables and/or libraries for installation -install(TARGETS optris_colorconvert_node optris_imager_node - ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} - LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} - RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} -) +INCLUDE_DIRECTORIES(/usr/include/libirimager) +LINK_DIRECTORIES(/usr/lib) +LINK_LIBRARIES(irimager irimageprocessing udev) +rosbuild_add_executable(optris_imager_node src/optris_imager_node.cpp) +rosbuild_add_executable(optris_colorconvert_node src/optris_colorconvert_node.cpp) diff --git a/Formats.def b/Formats.def deleted file mode 100644 index 7e93a49..0000000 --- a/Formats.def +++ /dev/null @@ -1,146 +0,0 @@ -# This file must not be changed - -[ImgProc format definition file] -Version = 1 - -# ----------------------------------------------------------------------------- -# PI -# ----------------------------------------------------------------------------- -[Format] -Guid = {7A9AAE14-E7AE-485f-B73A-946F94C061AB} -Name = "PI 160x120 @ 100Hz" -Channels = 1 -In = 164 120 100 -Out = 160 120 100 -SFrames = 1 -Def = (0 1 m:2)(0 1 s:3 d:160 s:5 d:160)(328 59 s:2 d:160 s:5 d:160 s:1) -[Format end] -# ----------------------------------------------------------------------------- -# PI160 -# ----------------------------------------------------------------------------- -[Format] -Guid = {7A9AAE14-E7AE-485f-B73A-946F94C06100} -Name = "PI160 160x120 @ 120Hz" -Channels = 1 -In = 160 121 120 -Out = 160 120 120 -SFrames = 1 -Def = (0 120 d:160)(19200 1 m:160) -[Format end] -# ----------------------------------------------------------------------------- -# PI200 -# ----------------------------------------------------------------------------- -[Format] -Guid = {80DDA89F-3967-4e88-951E-466A912A3C57} -Name = "PI200 IR=160x120@96Hz, Vis=640x480@32Hz" -Channels = 2 -In = 764 480 32 -#IR: -Out = 160 120 96 -SFrames = 3 -Def = ( 0 160 s:640 d:120 s:4)(305600 13 s:763 m:1 s:764) -Def = (122240 160 s:640 d:120 s:4)(325464 13 s:763 m:1 s:764) -Def = (244480 160 s:640 d:120 s:4)(345328 13 s:763 m:1 s:764) -#Vis: -Out = 640 480 32 -SFrames = 1 -Def = (0 480 d:640 s:124)(305600 13 s:763 m:1 s:764) -[Format end] -# ----------------------------------------------------------------------------- -#[Format] -#Guid = {12CF11ED-0190-457e-AEBF-4C1863E98D3B} -#Name = "PI200 IR=160x120@128Hz, Vis=596x480@32Hz" -#Channels = 2 -#In = 760 480 32 -##IR: -#Out = 160 120 128 -#SFrames = 4 -#Def = ( 0 120 s:596 d:160 s:4)(284240 13 s:759 m:1 s:760) -#Def = ( 91200 120 s:596 d:160 s:4)(304000 13 s:759 m:1 s:760) -#Def = (182400 120 s:596 d:160 s:4)(323760 13 s:759 m:1 s:760) -#Def = (273600 120 s:596 d:160 s:4)(343520 13 s:759 m:1 s:760) -##Vis: -#Out = 596 480 32 -#SFrames = 1 -#Def = (0 480 d:596 s:164)(284240 13 s:759 m:1 s:760) -#[Format end] -# ----------------------------------------------------------------------------- -[Format] -Guid = {12CF11ED-0190-457e-AEBF-4C1863E98D3C} -Name = "PI200 IR=160x120@128Hz, Vis=596x447@32Hz" -Channels = 2 -In = 760 480 32 -#IR: -Out = 160 120 128 -SFrames = 4 -Def = ( 0 120 s:596 d:160 s:4)(284240 13 s:759 m:1 s:760) -Def = ( 91200 120 s:596 d:160 s:4)(304000 13 s:759 m:1 s:760) -Def = (182400 120 s:596 d:160 s:4)(323760 13 s:759 m:1 s:760) -Def = (273600 120 s:596 d:160 s:4)(343520 13 s:759 m:1 s:760) -#Vis: -Out = 596 447 32 -SFrames = 1 -Def = (12160 447 d:596 s:164)(284240 13 s:759 m:1 s:760) -[Format end] -# ----------------------------------------------------------------------------- -[Format] -Guid = {D5847288-6F9E-428d-8E9A-6D3C415E8BF4} -Name = "PI200 160x120 @ 128Hz" -Channels = 1 -In = 164 120 128 -Out = 160 120 128 -SFrames = 1 -Def = (0 120 d:160 s:4)(15088 13 s:163 m:1 s:164) -[Format end] -# ----------------------------------------------------------------------------- -# PI400 -# ----------------------------------------------------------------------------- -[Format] -Guid = {A6160508-8450-4c25-B80F-976B2BF06E91} -Name = "PI400 382x288 @ 40Hz" -Channels = 1 -In = 384 288 40 -Out = 382 288 40 -SFrames = 1 -Def = (0 250 d:382 s:2)(96000 12 d:382 m:1 s:1 d:382 s:2 d:382 s:2)(109824 1 d:382 m:1 s:1 d:382 s:2) -[Format end] -# ----------------------------------------------------------------------------- -[Format] -Guid = {A6160508-8450-4c25-B80F-976B2BF06E92} -Name = "PI400 382x288 @ 80Hz" -Channels = 1 -In = 384 288 80 -Out = 382 288 80 -SFrames = 1 -Def = (0 250 d:382 s:2)(96000 12 d:382 m:1 s:1 d:382 s:2 d:382 s:2)(109824 1 d:382 m:1 s:1 d:382 s:2) -[Format end] -# ----------------------------------------------------------------------------- - -# Description: - -# [ImgProc format definition file] First Line that signalizes it is our file -# Version = x x = Version of the format of this file - -# [Format] Format tag -# [Format end] Format end tag -# Guid = {x} x = a unique identifier in curly brackets -# Name = "x" x = a userfriendly name in quote signes -# Channels = x x = number of output channels (1 = IR only, 2 = IR+Visible) -# according to this number the format is defined x-times (starting with the Out parameter) -# In = x y Input resolution (x = width, y = height) -# Out = x y Output resolution of this output channel (x = width, y = height) -# SFrames = 1 x = Number of subframes of this output channel -# Def = (offs n f0:x0 f1:x1 ... fn:xn) -# Definition of a subframe -# offs = pixel offset in the input frame -# n = number of repitions of the following sequence that must be read from the input frame -# f0 = format of the first x0 bytes read from the input frame -# s = Skip, data from the input buffer that has to be skipped -# d = data, data from the input buffer that is image data -# m = metadata, data from the input buffer that is meta data -# ... -# fn = format of the last xn bytes read from the input frame (according to n) -# Def = (offs1 n ... fn:xn)(offs2 m ... fm:xm) -# The Def parameter can also contain more than one block -# In this case the second offset is also relative to pixel 0 in the input buffer - diff --git a/config/14080045.xml b/config/14080045.xml index 0742788..bda1ce6 100644 --- a/config/14080045.xml +++ b/config/14080045.xml @@ -1,8 +1,6 @@ 14080045 - 0 - /usr/share/libirimager/cali 33 -20 diff --git a/manifest.xml b/manifest.xml new file mode 100644 index 0000000..8edf1dd --- /dev/null +++ b/manifest.xml @@ -0,0 +1,17 @@ + + + + optris_drivers + + + Stefan May + BSD + + http://ros.org/wiki/optris_drivers + + + + + + + diff --git a/optris_drivers.launch b/optris_drivers.launch index 97e3002..495527f 100644 --- a/optris_drivers.launch +++ b/optris_drivers.launch @@ -2,7 +2,7 @@ - + diff --git a/package.xml b/package.xml index 33ee0ee..11d38be 100644 --- a/package.xml +++ b/package.xml @@ -1,13 +1,13 @@ optris_drivers - 0.0.0 + 1.0.0 ROS nodes wrapping the binary driver for Optris thermal imager devices. - Stefan May(Nuremberg Institute of Technology Georg Simon Ohm - www.th-nuernberg.de) + Stefan May(Nuremberg Institute of Technology Georg Simon Ohm - www.th-nuernberg.de) BSD @@ -33,8 +33,8 @@ sensor_msgs image_transport message_generation - libudev-dev + libirimager roscpp @@ -43,8 +43,6 @@ sensor_msgs image_transport message_runtime - - libudev-dev - + diff --git a/src/optris_colorconvert_node.cpp b/src/optris_colorconvert_node.cpp index b537c14..99a5197 100644 --- a/src/optris_colorconvert_node.cpp +++ b/src/optris_colorconvert_node.cpp @@ -1,7 +1,7 @@ /********************************************************************* * Software License Agreement (BSD License) * - * Copyright (c) 2012/2013 + * Copyright (c) 2012-2015 * Nuremberg Institute of Technology Georg Simon Ohm * All rights reserved. * diff --git a/src/optris_imager_node.cpp b/src/optris_imager_node.cpp index aee346a..5151abf 100644 --- a/src/optris_imager_node.cpp +++ b/src/optris_imager_node.cpp @@ -1,7 +1,7 @@ /********************************************************************* * Software License Agreement (BSD License) * - * Copyright (c) 2012/2013 + * Copyright (c) 2012-2015 * Nuremberg Institute of Technology Georg Simon Ohm * All rights reserved. * @@ -43,7 +43,7 @@ #include "optris_drivers/AutoFlag.h" #include "libirimager/IRImager.h" -#include "libirimager/ImageBuilder.h" +#include "ImageBuilder.h" #include using namespace std; @@ -67,8 +67,10 @@ optris::IRImager* _imager; * @param[in] image thermal image in unsigned short format, i.e., float temperature = ((float)image[i] -1000.f)/10.f) * @param[in] w image width * @param[in] h image height + * @param[in] timestamp the frame's timestamp + * @param[in] arg argument passed to process method */ -void onThermalFrame(unsigned short* image, unsigned int w, unsigned int h, long long timestamp) +void onThermalFrame(unsigned short* image, unsigned int w, unsigned int h, long long timestamp, void* arg) { memcpy(&_thermal_image.data[0], image, w * h * sizeof(*image)); @@ -84,7 +86,15 @@ void onThermalFrame(unsigned short* image, unsigned int w, unsigned int h, long _chip_pub.publish(_chip_temperature); } -void onVisibleFrame(unsigned char* image, unsigned int w, unsigned int h) +/** + * Callback method from image processing library (called at configured frame rate in xml file) + * @param[in] image RGB image, if BISPECTRAL technology is available + * @param[in] w image width + * @param[in] h image height + * @param[in] timestamp the frame's timestamp + * @param[in] arg argument passed to process method + */ +void onVisibleFrame(unsigned char* image, unsigned int w, unsigned int h, long long timestamp, void* arg) { memcpy(&_visible_image.data[0], image, 2 * w * h * sizeof(*image));