Triclops library for Bumblebee 2: runtime error on Ubuntu 16.04
I'm trying to run a node which captures stereo images and calculates disparity map from Bumblebee-2-08S2C on Ubuntu 16.04, ROS Kinetic. My code follows the style from there. Everything is compiled fine, but I bump into the runtime error Illegal instruction (core dumped)
. After eliminating most lines of code, I figure out the issue lies in the libtriclops4.so. If I remove that shared library, everything works just fine. I make use of FlyCapture 2.13.3.31 SDK and Triclops 4.0.3.4 SDK. My mainboard is P5GC-MX/1333, chip Intel Pentium E2160.
This is my minimalized code for searching errors:
#include <triclops.h>
#include <fc2triclops.h>
#include <pcl/point_types.h>
#include <ros/ros.h>
#include <pcl_ros/point_cloud.h>
#include <pcl_conversions/pcl_conversions.h>
#include <sensor_msgs/PointCloud2.h>
int main(int argc, char** argv)
{
ros::init(argc, argv, "generate_pointcloud");
ros::NodeHandle nh;
ros::Publisher pub = nh.advertise<sensor_msgs::PointCloud2>("/camera/points2_2", 1);
ros::Rate loop_rate(10);
while (ros::ok())
{
ROS_INFO("Nothing");
ros::spinOnce();
loop_rate.sleep();
}
}
And this is my CMakeLists.txt file:
cmake_minimum_required(VERSION 2.8.3)
project(pointcloud_generation)
set(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}")
find_package(catkin REQUIRED
COMPONENTS
roscpp
sensor_msgs
pcl_ros
pcl_conversions
)
catkin_package()
include_directories(${catkin_INCLUDE_DIRS})
include_directories(/usr/include/triclops4)
include_directories(/usr/include/flycapture)
add_executable(generate_pointcloud src/generate_pointcloud.cpp)
target_link_libraries(generate_pointcloud ${catkin_LIBRARIES})
target_link_libraries(generate_pointcloud /usr/lib/x86_64-linux-gnu/libtriclops4.so
/usr/lib/libflycapture.so
/usr/lib/x86_64-linux-gnu/libflycapture2bridge4.so)
Asked by megoxza on 2019-08-13 02:21:29 UTC
Answers
It's been quite a while since I've worked with triclops, but I seem to recall that it has internal static linkage to a different version of Boost from what ROS and Ubuntu 16.04 uses. You should be able to use the nm
command to see if there are conflicting symbols linked in the library.
If that is the case, this ends up being a situation where you are going to have a very difficult time making the library and ROS coexist. You could potentially separate it into two executables, one responsible for communicating with the triclops library, and a second for sending it over ROS, and then using shared memory or named pipes to do the communication between the executables.
Alternatively, you may be able to get a version from PointGrey that doesn't have the static linking, but that's probably a longer shot.
Asked by mjcarroll on 2019-08-28 12:01:19 UTC
Comments
Wow, it's seen so hard for me to make such incredible adaptation. Anyway, I manage to get it working by running the executable on a computer embedded with Intel Core i3-3220. I think the problem can be resolved on Pentium if we make some flexible tuning, taking ISA-specific dissimilarities (optimization flags, etc) into account, in CMakeLists.txt but I haven't tried it yet. Thanks for your contribution!
Asked by megoxza on 2019-09-04 03:18:36 UTC
Comments