How to use libueye_api.so version 4.91 with ROS Melodic?

asked 2019-05-15 07:45:31 -0500

Timo.Loomets gravatar image

updated 2019-05-16 09:15:23 -0500

I am using ROS Melodic and ueye api version 4.91.1 Using catkin build the build succeeds without warnings.

I am writing a simple camera listening node for a SICK camera in C++. I am getting a runtime error whenever the is_InitCamera(&hCam) command is present somewhere in the code. When I remove that command from code then there is no runtime error. The error is not raised by this command, but by the ros::init(argc, argv, "my_camera_handler"); command.

gdb gives the following output:

(gdb) where
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1  0x00007ffff6459801 in __GI_abort () at abort.c:79
#2  0x00007ffff64a2897 in __libc_message (action=action@entry=do_abort, fmt=fmt@entry=0x7ffff65cfb9a "%s\n") at ../sysdeps/posix/libc_fatal.c:181
#3  0x00007ffff64a990a in malloc_printerr (str=str@entry=0x7ffff65d17a8 "munmap_chunk(): invalid pointer") at malloc.c:5350
#4  0x00007ffff64b0ecc in munmap_chunk (p=0x555555772ce0) at malloc.c:2846
#5  __GI___libc_free (mem=0x555555772cf0) at malloc.c:3117
#6  0x00007ffff6eb4440 in ros::file_log::init(std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > const&) () from /opt/ros/melodic/lib/libroscpp.so
#7  0x00007ffff6edc141 in ros::init(std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int) () from /opt/ros/melodic/lib/libroscpp.so
#8  0x00007ffff6edea8c in ros::init(int&, char**, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int) () from /opt/ros/melodic/lib/libroscpp.so
#9  0x00005555555568a0 in main (argc=1, argv=0x7fffffffdc28) at /home/timo/ros/catkin_ws/src/driverless-system-v2/cameras/camera_test/src/main.cpp:6

I have tried using the 4.80.2 version of the ueye library and that worked fine, but since I am developing for a 64 bit ARM system which only has a 4.91 version available then I can't use the older version outside of development.

The library commands themselves are working, but the problem is with ros::init command. Changing the order of the commands hasn't changed the result.

main.cpp

#include "ros/ros.h"
#include "ueye.h"

int main(int argc, char **argv)
{
    ros::init(argc, argv, "my_camera_handler");
    ros::NodeHandle n;

    HIDS hCam = 1;
    INT nRet = is_InitCamera(&hCam, NULL);

    return 0;
}

CMakeLists.txt

cmake_minimum_required(VERSION 2.8.3)
project(camera_test)

if(MSVC)  
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zi")  
else()  
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")  
endif()

add_compile_options(-std=c++11)

find_package ...
(more)
edit retag flag offensive close merge delete

Comments

I am getting a runtime error [..]. [..] then there is no runtime error. [..] The error is not raised by this command [..]

which error specifically? You never show it.

gvdhoorn gravatar imagegvdhoorn ( 2019-05-15 08:09:19 -0500 )edit

re: edit: this could be a ABI incompatibility between the ueye library and some library linked in by your ROS node.

Does the ueye library use a different version of Boost fi (strong candidate)?

gvdhoorn gravatar imagegvdhoorn ( 2019-05-15 09:25:36 -0500 )edit