Git Product home page Git Product logo

Comments (9)

kohrt avatar kohrt commented on August 21, 2024

Have you tried gcc 4.7? I think I used that one on Hydro.
If it is a dedicated machine that runs the Kinect 2, you could try to run Indigo.

from iai_kinect2.

kohrt avatar kohrt commented on August 21, 2024

With commit b58979e I added code that should make it possible to run kinect2_bridge even if libfreenect2 is not compiled with CXX11. So it should work with gcc 4.6.

from iai_kinect2.

BrettHemes avatar BrettHemes commented on August 21, 2024

I tried with gcc 4.7 and am getting the same boost errors. I can try sans CXX11 support and see what I get but I am thinking I might also just make the jump to Indigo at this point and possibly try to use the indigo development branch for all of the ROS Industrial stuff... might be esasier that way and then I'll be totally ready for when ROS-I releases in Indigo.

from iai_kinect2.

BrettHemes avatar BrettHemes commented on August 21, 2024

OK, so I rebuilt everything using gcc 4.6 using your modified fork of libfreenect2 (still have to make the revision in issue #29 to libfreenect2 CMakeLists.txt) and the devel branch of iai_kinect2. Everything builds but FYI the output of rosdep install -r --from-paths . is now

ERROR: the following packages/stacks could not have their rosdep keys resolved
to system dependencies:
registration_viewer: Cannot locate rosdep definition for [kinect2_bridge]
kinect2_calibration: Cannot locate rosdep definition for [kinect2_bridge]
kinect2_bridge: Cannot locate rosdep definition for [depth_registration]
Continuing to install resolvable dependencies...
#All required rosdeps installed successfully

The protonect executable runs but when I run rosrun kinect2_bridge kinect2_bridge I get a segfault with the following output:

hemes@jake:~/ros_ws/src/iai_kinect2$ rosrun kinect2_bridge kinect2_bridge 
[DepthRegistration::New] OpenCL registration method not available!
[DepthRegistration::New] OpenCL registration method not available!
[OpenGLContext] failed to initialize glew for the current context!
Segmentation fault (core dumped)

Here is the backtrace:

(gdb) bt
#0  0x0000000000000000 in ?? ()
#1  0x00007ffff6264e1b in bindToUnit (unit=33984, this=<optimized out>)
    at /home/hemes/src/libfreenect2/examples/protonect/src/opengl_depth_packet_processor.cpp:216
#2  allocate (new_height=4240, new_width=352, this=0x67ede8)
    at /home/hemes/src/libfreenect2/examples/protonect/src/opengl_depth_packet_processor.cpp:228
#3  libfreenect2::OpenGLDepthPacketProcessorImpl::initialize (this=0x67ec90)
    at /home/hemes/src/libfreenect2/examples/protonect/src/opengl_depth_packet_processor.cpp:375
#4  0x00007ffff62638b9 in libfreenect2::OpenGLDepthPacketProcessor::OpenGLDepthPacketProcessor (this=0x689a80, parent_opengl_context_ptr=<optimized out>, 
    debug=false)
    at /home/hemes/src/libfreenect2/examples/protonect/src/opengl_depth_packet_processor.cpp:683
#5  0x00007ffff62527cc in libfreenect2::OpenGLPacketPipeline::createDepthPacketProcessor (this=0x679ea0)
    at /home/hemes/src/libfreenect2/examples/protonect/src/packet_pipeline.cpp:108
#6  0x00007ffff62528f1 in libfreenect2::BasePacketPipeline::initialize (
    this=0x679ea0)
    at /home/hemes/src/libfreenect2/examples/protonect/src/packet_pipeline.cpp:43
#7  0x00007ffff6252aaf in libfreenect2::OpenGLPacketPipeline::OpenGLPacketPipeline (this=0x679ea0, debug=<optimized out>)
    at /home/hemes/src/libfreenect2/examples/protonect/src/packet_pipeline.cpp:101
#8  0x0000000000410551 in Kinect2Bridge::Kinect2Bridge(double, bool, int, int)
    ()
#9  0x0000000000407a13 in main ()

I am going to start working on an Indigo build but will keep my Hydro install around in case you care to see this through...

Thanks,
Brett

from iai_kinect2.

BrettHemes avatar BrettHemes commented on August 21, 2024

I am getting this same last error with my Indigo build:

hemes@cake:~/ros_ws/build/iai_kinect2$ rosrun kinect2_bridge kinect2_bridge
[DepthRegistration::New] OpenCL registration method not available!
[DepthRegistration::New] OpenCL registration method not available!
[OpenGLContext] failed to initialize glew for the current context!
Segmentation fault (core dumped)

It seems that the OpenCL depth registraion method is getting called despite me haveing Eigen. The catkin_make output looks OK...

hemes@cake:~/ros_ws$ catkin_make -DCMAKE_BUILD_TYPE="Release"
Base path: /home/hemes/ros_ws
Source space: /home/hemes/ros_ws/src
Build space: /home/hemes/ros_ws/build
Devel space: /home/hemes/ros_ws/devel
Install space: /home/hemes/ros_ws/install
####
#### Running command: "make cmake_check_build_system" in "/home/hemes/ros_ws/build"
####
-- Using CATKIN_DEVEL_PREFIX: /home/hemes/ros_ws/devel
-- Using CMAKE_PREFIX_PATH: /home/hemes/ros_ws/devel;/opt/ros/indigo
-- This workspace overlays: /home/hemes/ros_ws/devel;/opt/ros/indigo
-- Using PYTHON_EXECUTABLE: /usr/bin/python
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/hemes/ros_ws/build/test_results
-- Found gtest sources under '/usr/src/gtest': gtests will be built
-- Using Python nosetests: /usr/bin/nosetests-2.7
-- catkin 0.6.11
-- BUILD_SHARED_LIBS is on
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~  traversing 5 packages in topological order:
-- ~~  - iai_kinect2 (metapackage)
-- ~~  - depth_registration
-- ~~  - kinect2_bridge
-- ~~  - kinect2_calibration
-- ~~  - registration_viewer
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin metapackage: 'iai_kinect2'
-- ==> add_subdirectory(iai_kinect2/iai_kinect2)
-- +++ processing catkin package: 'depth_registration'
-- ==> add_subdirectory(iai_kinect2/depth_registration)
-- Eigen found (include: /usr/include/eigen3)
-- Could NOT find OpenCL (missing:  OPENCL_LIBRARIES OPENCL_INCLUDE_DIRS) 
-- CPU based depth registration enabled
-- OpenCL based depth registration disabled
-- +++ processing catkin package: 'kinect2_bridge'
-- ==> add_subdirectory(iai_kinect2/kinect2_bridge)
-- Using these message generators: gencpp;genlisp;genpy
-- +++ processing catkin package: 'kinect2_calibration'
-- ==> add_subdirectory(iai_kinect2/kinect2_calibration)
-- Using these message generators: gencpp;genlisp;genpy
-- +++ processing catkin package: 'registration_viewer'
-- ==> add_subdirectory(iai_kinect2/registration_viewer)
-- Using these message generators: gencpp;genlisp;genpy
-- Boost version: 1.54.0
-- Found the following Boost libraries:
--   system
--   filesystem
--   thread
--   date_time
--   iostreams
--   serialization
-- checking for module 'openni-dev'
--   package 'openni-dev' not found
-- checking for module 'openni-dev'
--   package 'openni-dev' not found
-- checking for module 'openni-dev'
--   package 'openni-dev' not found
-- looking for PCL_COMMON
-- looking for PCL_KDTREE
-- looking for PCL_OCTREE
-- looking for PCL_SEARCH
-- looking for PCL_SURFACE
-- looking for PCL_GEOMETRY
-- looking for PCL_SAMPLE_CONSENSUS
-- looking for PCL_FILTERS
-- looking for PCL_FEATURES
-- looking for PCL_SEGMENTATION
-- looking for PCL_IO
-- looking for PCL_REGISTRATION
-- looking for PCL_KEYPOINTS
-- looking for PCL_RECOGNITION
-- looking for PCL_VISUALIZATION
-- looking for PCL_PEOPLE
-- looking for PCL_OUTOFCORE
-- looking for PCL_TRACKING
-- looking for PCL_APPS
-- Configuring done
-- Generating done
-- Build files have been written to: /home/hemes/ros_ws/build
####
#### Running command: "make -j12 -l12" in "/home/hemes/ros_ws/build"
####
Scanning dependencies of target kinect2_calibration
Scanning dependencies of target depth_registration
Scanning dependencies of target viewer
[ 20%] Building CXX object iai_kinect2/kinect2_calibration/CMakeFiles/kinect2_calibration.dir/src/kinect2_calibration.cpp.o
[ 40%] [ 60%] Building CXX object iai_kinect2/depth_registration/CMakeFiles/depth_registration.dir/src/depth_registration.cpp.o
Building CXX object iai_kinect2/depth_registration/CMakeFiles/depth_registration.dir/src/depth_registration_cpu.cpp.o
[ 80%] Building CXX object iai_kinect2/registration_viewer/CMakeFiles/viewer.dir/src/viewer.cpp.o
In file included from /usr/include/eigen3/Eigen/Core:328:0,
                 from /usr/include/eigen3/Eigen/Geometry:4,
                 from /home/hemes/ros_ws/src/iai_kinect2/depth_registration/src/depth_registration_cpu.h:22,
                 from /home/hemes/ros_ws/src/iai_kinect2/depth_registration/src/depth_registration_cpu.cpp:18:
/usr/include/eigen3/Eigen/src/Core/products/CoeffBasedProduct.h: In instantiation of ‘struct Eigen::internal::traits<Eigen::CoeffBasedProduct<const Eigen::Matrix<double, 4, 4>&, const Eigen::Matrix<double, 4, 1>&, 6> >’:
/usr/include/eigen3/Eigen/src/Core/DenseBase.h:41:34:   required from ‘class Eigen::DenseBase<Eigen::CoeffBasedProduct<const Eigen::Matrix<double, 4, 4>&, const Eigen::Matrix<double, 4, 1>&, 6> >’
/usr/include/eigen3/Eigen/src/Core/MatrixBase.h:48:34:   required from ‘class Eigen::MatrixBase<Eigen::CoeffBasedProduct<const Eigen::Matrix<double, 4, 4>&, const Eigen::Matrix<double, 4, 1>&, 6> >’
/usr/include/eigen3/Eigen/src/Core/products/CoeffBasedProduct.h:113:7:   required from ‘class Eigen::CoeffBasedProduct<const Eigen::Matrix<double, 4, 4>&, const Eigen::Matrix<double, 4, 1>&, 6>’
/home/hemes/ros_ws/src/iai_kinect2/depth_registration/src/depth_registration_cpu.cpp:155:39:   required from here
/usr/include/eigen3/Eigen/src/Core/products/CoeffBasedProduct.h:67:37: warning: logical ‘and’ applied to non-boolean constant [-Wlogical-op]
       CanVectorizeRhs = RhsRowMajor && (RhsFlags & PacketAccessBit)
                                     ^
In file included from /usr/include/eigen3/Eigen/Core:284:0,
                 from /usr/include/eigen3/Eigen/Geometry:4,
                 from /home/hemes/ros_ws/src/iai_kinect2/depth_registration/src/depth_registration_cpu.h:22,
                 from /home/hemes/ros_ws/src/iai_kinect2/depth_registration/src/depth_registration_cpu.cpp:18:
/usr/include/eigen3/Eigen/src/Core/Assign.h: In instantiation of ‘struct Eigen::internal::assign_traits<Eigen::Matrix<double, 4, 1>, Eigen::CoeffBasedProduct<const Eigen::Matrix<double, 4, 4>&, const Eigen::Matrix<double, 4, 1>&, 6> >’:
/usr/include/eigen3/Eigen/src/Core/Assign.h:500:111:   required from ‘Derived& Eigen::DenseBase<Derived>::lazyAssign(const Eigen::DenseBase<OtherDerived>&) [with OtherDerived = Eigen::CoeffBasedProduct<const Eigen::Matrix<double, 4, 4>&, const Eigen::Matrix<double, 4, 1>&, 6>; Derived = Eigen::Matrix<double, 4, 1>]’
/usr/include/eigen3/Eigen/src/Core/PlainObjectBase.h:411:46:   required from ‘Derived& Eigen::PlainObjectBase<Derived>::lazyAssign(const Eigen::DenseBase<OtherDerived>&) [with OtherDerived = Eigen::CoeffBasedProduct<const Eigen::Matrix<double, 4, 4>&, const Eigen::Matrix<double, 4, 1>&, 6>; Derived = Eigen::Matrix<double, 4, 1>]’
/usr/include/eigen3/Eigen/src/Core/products/CoeffBasedProduct.h:196:7:   required from ‘Eigen::CoeffBasedProduct<Lhs, Rhs, NestingFlags>::operator const PlainObject&() const [with LhsNested = const Eigen::Matrix<double, 4, 4>&; RhsNested = const Eigen::Matrix<double, 4, 1>&; int NestingFlags = 6; Eigen::CoeffBasedProduct<Lhs, Rhs, NestingFlags>::PlainObject = Eigen::Matrix<double, 4, 1>]’
/home/hemes/ros_ws/src/iai_kinect2/depth_registration/src/depth_registration_cpu.cpp:155:39:   required from here
/usr/include/eigen3/Eigen/src/Core/Assign.h:49:19: warning: logical ‘and’ applied to non-boolean constant [-Wlogical-op]
                   && (int(Derived::Flags) & int(OtherDerived::Flags) & ActualPacketAccessBit),
                   ^
/usr/include/eigen3/Eigen/src/Core/Assign.h: In instantiation of ‘struct Eigen::internal::assign_traits<Eigen::Matrix<double, 4, 1>, Eigen::Matrix<double, 4, 1> >’:
/usr/include/eigen3/Eigen/src/Core/Assign.h:500:111:   required from ‘Derived& Eigen::DenseBase<Derived>::lazyAssign(const Eigen::DenseBase<OtherDerived>&) [with OtherDerived = Eigen::Matrix<double, 4, 1>; Derived = Eigen::Matrix<double, 4, 1>]’
/usr/include/eigen3/Eigen/src/Core/PlainObjectBase.h:411:46:   required from ‘Derived& Eigen::PlainObjectBase<Derived>::lazyAssign(const Eigen::DenseBase<OtherDerived>&) [with OtherDerived = Eigen::Matrix<double, 4, 1>; Derived = Eigen::Matrix<double, 4, 1>]’
/usr/include/eigen3/Eigen/src/Core/Assign.h:520:123:   required from ‘static Derived& Eigen::internal::assign_selector<Derived, OtherDerived, false, false>::run(Derived&, const OtherDerived&) [with Derived = Eigen::Matrix<double, 4, 1>; OtherDerived = Eigen::Matrix<double, 4, 1>]’
/usr/include/eigen3/Eigen/src/Core/PlainObjectBase.h:618:105:   required from ‘Derived& Eigen::PlainObjectBase<Derived>::_set_noalias(const Eigen::DenseBase<OtherDerived>&) [with OtherDerived = Eigen::Matrix<double, 4, 1>; Derived = Eigen::Matrix<double, 4, 1>]’
/usr/include/eigen3/Eigen/src/Core/Matrix.h:288:31:   required from ‘Eigen::Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>::Matrix(const Eigen::Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>&) [with _Scalar = double; int _Rows = 4; int _Cols = 1; int _Options = 0; int _MaxRows = 4; int _MaxCols = 1]’
/home/hemes/ros_ws/src/iai_kinect2/depth_registration/src/depth_registration_cpu.cpp:155:39:   required from here
/usr/include/eigen3/Eigen/src/Core/Assign.h:49:19: warning: logical ‘and’ applied to non-boolean constant [-Wlogical-op]
Linking CXX shared library /home/hemes/ros_ws/devel/lib/libdepth_registration.so
[ 80%] Built target depth_registration
Scanning dependencies of target kinect2_bridge
[100%] Building CXX object iai_kinect2/kinect2_bridge/CMakeFiles/kinect2_bridge.dir/src/kinect2_bridge.cpp.o
In file included from /usr/include/pcl-1.7/pcl/visualization/pcl_visualizer.h:52:0,
                 from /usr/include/pcl-1.7/pcl/visualization/cloud_viewer.h:39,
                 from /home/hemes/ros_ws/src/iai_kinect2/registration_viewer/src/viewer.cpp:32:
/usr/include/pcl-1.7/pcl/visualization/area_picking_event.h: In member function ‘bool pcl::visualization::AreaPickingEvent::getPointsIndices(std::vector<int>&) const’:
/usr/include/pcl-1.7/pcl/visualization/area_picking_event.h:64:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
           if (nb_points_ == -1)
                              ^
Linking CXX executable /home/hemes/ros_ws/devel/lib/kinect2_bridge/kinect2_bridge
Linking CXX executable /home/hemes/ros_ws/devel/lib/kinect2_calibration/kinect2_calibration
[100%] Built target kinect2_bridge
[100%] Built target kinect2_calibration
Linking CXX executable /home/hemes/ros_ws/devel/lib/registration_viewer/viewer
[100%] Built target viewer

I am out of time for today, otherwise I would have dug a bit more. Hope this at least gives you an idea of what is going wrong.

from iai_kinect2.

kohrt avatar kohrt commented on August 21, 2024

The segfault comes from the OpenGL processor, but in Protonect it is working. I will try it on my system later.
And the other problem is that the OpenCL registration is used even if it is not enabled in depth_registration. I will look at this too.

from iai_kinect2.

kohrt avatar kohrt commented on August 21, 2024

I found out why glewInit() is not initializing. glfwInit() has to be called before glewInit(). This is done in Protonect but not in libfreenect2.
The depth_registration problem should be fixed with 999b30c.
@christiankerl: should is be like this, that the caller has to execute glfwInit() before using libfreenect2, or should the opengl_depth_packet_processor / pipeline instantiation be responsible for this?

from iai_kinect2.

BrettHemes avatar BrettHemes commented on August 21, 2024

Indeed 999b30c fixes the depth_registration problem.

As for the glfwInit issue, I went ahead and added a glfwInit() call in kinect2_bridge.cpp (right before the first libfreenect2 calls) just to try and test the original Hydro issues I was having and everything ended up working. I am able to run the bridge, viewer, and calibration in both Hydro and Indigo.

So in conclusion it seems b58979e solves the original 12.04+Hydro / no CXX11 issue when the distro-default gcc 4.6 is used.

Feel free to close or rename this issue however you see fit depending on how you end up handling the remaining glfwInit issue.

Thanks so much for your work; this package will be very useful for my purposes.
Brett

from iai_kinect2.

kohrt avatar kohrt commented on August 21, 2024

In the devel branch in commit efd2679 I added glfwInit() to kinect2_bridge.

from iai_kinect2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.