robosavvy / vive_ros

ROS package for publishing HTV VIVE device locations.
BSD 3-Clause "New" or "Revised" License
98 stars 73 forks source link

Compilation failure with latest Steam/ SteamVR-4-linux Ubuntu 16.04 #11

Closed eric-schleicher closed 5 years ago

eric-schleicher commented 7 years ago

I thought I was making good progress on getting this library working with my robot, but not just yet... working, as I'm very excited about using lighthouse tracked objects in ROS.

I've followed the instructions on installation and believe that I've satisfied all of the prereqs correctly OS: Ubuntu 16.04 ROS: Kinetic (though i don't believe it matter so much in this case [yet])

I've cloned the most recent master of the Valve OpenVR commit 7fa6470f2972970859f2395f1390f6d87d4b0fc3

...And compiled it successfully per this Repos Install instructions. Note: This repo's install.md instructions point to a depricated (per that repo owner; image shown below). So I cloned the more recent upstream OpenVR.

image

I've cloned this repo into my ROS workspace and run 'catkin_make'

the process succeed on all of my prior dependencies but fails compiling the vive_ros components with the following error(s)

Pasted [link]

inline log
/home/rosuser/catkin_ws/src/vive_ros/src/vr_interface.cpp:26:5: error: ‘ChaperoneCalibrationState_Error_BaseStationUninitalized’ is not a member of ‘vr’
   { vr::ChaperoneCalibrationState_Error_BaseStationUninitalized, "Tracking center hasn't be calibrated for at least one of the base stations" },
     ^
/home/rosuser/catkin_ws/src/vive_ros/src/vr_interface.cpp:30:1: error: no matching function for call to ‘std::map<vr::ChaperoneCalibrationState, std::__cxx11::basic_string<char> >::map(<brace-enclosed initializer list>)’
 };
 ^
In file included from /usr/include/c++/5/map:61:0,
                 from /home/rosuser/catkin_ws/src/vive_ros/src/vr_interface.cpp:3:
/usr/include/c++/5/bits/stl_map.h:273:9: note: candidate: template<class _InputIterator> std::map<_Key, _Tp, _Compare, _Alloc>::map(_InputIterator, _InputIterator, const _Compare&, const allocator_type&)
         map(_InputIterator __first, _InputIterator __last,
         ^
/usr/include/c++/5/bits/stl_map.h:273:9: note:   template argument deduction/substitution failed:
/home/rosuser/catkin_ws/src/vive_ros/src/vr_interface.cpp:30:1: note:   cannot convert ‘{ChaperoneCalibrationState_Warning_BaseStationMayHaveMoved, "A base station thinks that it might have moved"}’ (type ‘<brace-enclosed initializer list>’) to type ‘const std::less<vr::ChaperoneCalibrationState>&’
 };
 ^
In file included from /usr/include/c++/5/map:61:0,
                 from /home/rosuser/catkin_ws/src/vive_ros/src/vr_interface.cpp:3:
/usr/include/c++/5/bits/stl_map.h:256:9: note: candidate: template<class _InputIterator> std::map<_Key, _Tp, _Compare, _Alloc>::map(_InputIterator, _InputIterator)
         map(_InputIterator __first, _InputIterator __last)
         ^
/usr/include/c++/5/bits/stl_map.h:256:9: note:   template argument deduction/substitution failed:
/home/rosuser/catkin_ws/src/vive_ros/src/vr_interface.cpp:30:1: note:   candidate expects 2 arguments, 10 provided
 };
 ^
In file included from /usr/include/c++/5/map:61:0,
                 from /home/rosuser/catkin_ws/src/vive_ros/src/vr_interface.cpp:3:
/usr/include/c++/5/bits/stl_map.h:239:9: note: candidate: template<class _InputIterator> std::map<_Key, _Tp, _Compare, _Alloc>::map(_InputIterator, _InputIterator, const allocator_type&)
         map(_InputIterator __first, _InputIterator __last,
         ^
/usr/include/c++/5/bits/stl_map.h:239:9: note:   template argument deduction/substitution failed:
/home/rosuser/catkin_ws/src/vive_ros/src/vr_interface.cpp:30:1: note:   cannot convert ‘{ChaperoneCalibrationState_Warning_BaseStationMayHaveMoved, "A base station thinks that it might have moved"}’ (type ‘<brace-enclosed initializer list>’) to type ‘const allocator_type& {aka const std::allocator<std::pair<const vr::ChaperoneCalibrationState, std::__cxx11::basic_string<char> > >&}’
 };
 ^
In file included from /usr/include/c++/5/map:61:0,
                 from /home/rosuser/catkin_ws/src/vive_ros/src/vr_interface.cpp:3:
/usr/include/c++/5/bits/stl_map.h:233:7: note: candidate: std::map<_Key, _Tp, _Compare, _Alloc>::map(std::initializer_list<std::pair<const _Key, _Tp> >, const allocator_type&) [with _Key = vr::ChaperoneCalibrationState; _Tp = std::__cxx11::basic_string<char>; _Compare = std::less<vr::ChaperoneCalibrationState>; _Alloc = std::allocator<std::pair<const vr::ChaperoneCalibrationState, std::__cxx11::basic_string<char> > >; std::map<_Key, _Tp, _Compare, _Alloc>::allocator_type = std::allocator<std::pair<const vr::ChaperoneCalibrationState, std::__cxx11::basic_string<char> > >]
       map(initializer_list<value_type> __l, const allocator_type& __a)
       ^
/usr/include/c++/5/bits/stl_map.h:233:7: note:   candidate expects 2 arguments, 10 provided
/usr/include/c++/5/bits/stl_map.h:227:7: note: candidate: std::map<_Key, _Tp, _Compare, _Alloc>::map(std::map<_Key, _Tp, _Compare, _Alloc>&&, const allocator_type&) [with _Key = vr::ChaperoneCalibrationState; _Tp = std::__cxx11::basic_string<char>; _Compare = std::less<vr::ChaperoneCalibrationState>; _Alloc = std::allocator<std::pair<const vr::ChaperoneCalibrationState, std::__cxx11::basic_string<char> > >; std::map<_Key, _Tp, _Compare, _Alloc>::allocator_type = std::allocator<std::pair<const vr::ChaperoneCalibrationState, std::__cxx11::basic_string<char> > >]
       map(map&& __m, const allocator_type& __a)
       ^
/usr/include/c++/5/bits/stl_map.h:227:7: note:   candidate expects 2 arguments, 10 provided
/usr/include/c++/5/bits/stl_map.h:223:7: note: candidate: std::map<_Key, _Tp, _Compare, _Alloc>::map(const std::map<_Key, _Tp, _Compare, _Alloc>&, const allocator_type&) [with _Key = vr::ChaperoneCalibrationState; _Tp = std::__cxx11::basic_string<char>; _Compare = std::less<vr::ChaperoneCalibrationState>; _Alloc = std::allocator<std::pair<const vr::ChaperoneCalibrationState, std::__cxx11::basic_string<char> > >; std::map<_Key, _Tp, _Compare, _Alloc>::allocator_type = std::allocator<std::pair<const vr::ChaperoneCalibrationState, std::__cxx11::basic_string<char> > >]
       map(const map& __m, const allocator_type& __a)
       ^
/usr/include/c++/5/bits/stl_map.h:223:7: note:   candidate expects 2 arguments, 10 provided
/usr/include/c++/5/bits/stl_map.h:219:7: note: candidate: std::map<_Key, _Tp, _Compare, _Alloc>::map(const allocator_type&) [with _Key = vr::ChaperoneCalibrationState; _Tp = std::__cxx11::basic_string<char>; _Compare = std::less<vr::ChaperoneCalibrationState>; _Alloc = std::allocator<std::pair<const vr::ChaperoneCalibrationState, std::__cxx11::basic_string<char> > >; std::map<_Key, _Tp, _Compare, _Alloc>::allocator_type = std::allocator<std::pair<const vr::ChaperoneCalibrationState, std::__cxx11::basic_string<char> > >]
       map(const allocator_type& __a)
       ^
/usr/include/c++/5/bits/stl_map.h:219:7: note:   candidate expects 1 argument, 10 provided
/usr/include/c++/5/bits/stl_map.h:211:7: note: candidate: std::map<_Key, _Tp, _Compare, _Alloc>::map(std::initializer_list<std::pair<const _Key, _Tp> >, const _Compare&, const allocator_type&) [with _Key = vr::ChaperoneCalibrationState; _Tp = std::__cxx11::basic_string<char>; _Compare = std::less<vr::ChaperoneCalibrationState>; _Alloc = std::allocator<std::pair<const vr::ChaperoneCalibrationState, std::__cxx11::basic_string<char> > >; std::map<_Key, _Tp, _Compare, _Alloc>::allocator_type = std::allocator<std::pair<const vr::ChaperoneCalibrationState, std::__cxx11::basic_string<char> > >]
       map(initializer_list<value_type> __l,
       ^
/usr/include/c++/5/bits/stl_map.h:211:7: note:   candidate expects 3 arguments, 10 provided
/usr/include/c++/5/bits/stl_map.h:196:7: note: candidate: std::map<_Key, _Tp, _Compare, _Alloc>::map(std::map<_Key, _Tp, _Compare, _Alloc>&&) [with _Key = vr::ChaperoneCalibrationState; _Tp = std::__cxx11::basic_string<char>; _Compare = std::less<vr::ChaperoneCalibrationState>; _Alloc = std::allocator<std::pair<const vr::ChaperoneCalibrationState, std::__cxx11::basic_string<char> > >]
       map(map&& __x)
       ^
/usr/include/c++/5/bits/stl_map.h:196:7: note:   candidate expects 1 argument, 10 provided
/usr/include/c++/5/bits/stl_map.h:185:7: note: candidate: std::map<_Key, _Tp, _Compare, _Alloc>::map(const std::map<_Key, _Tp, _Compare, _Alloc>&) [with _Key = vr::ChaperoneCalibrationState; _Tp = std::__cxx11::basic_string<char>; _Compare = std::less<vr::ChaperoneCalibrationState>; _Alloc = std::allocator<std::pair<const vr::ChaperoneCalibrationState, std::__cxx11::basic_string<char> > >]
       map(const map& __x)
       ^
/usr/include/c++/5/bits/stl_map.h:185:7: note:   candidate expects 1 argument, 10 provided
/usr/include/c++/5/bits/stl_map.h:174:7: note: candidate: std::map<_Key, _Tp, _Compare, _Alloc>::map(const _Compare&, const allocator_type&) [with _Key = vr::ChaperoneCalibrationState; _Tp = std::__cxx11::basic_string<char>; _Compare = std::less<vr::ChaperoneCalibrationState>; _Alloc = std::allocator<std::pair<const vr::ChaperoneCalibrationState, std::__cxx11::basic_string<char> > >; std::map<_Key, _Tp, _Compare, _Alloc>::allocator_type = std::allocator<std::pair<const vr::ChaperoneCalibrationState, std::__cxx11::basic_string<char> > >]
       map(const _Compare& __comp,
       ^
/usr/include/c++/5/bits/stl_map.h:174:7: note:   candidate expects 2 arguments, 10 provided
/usr/include/c++/5/bits/stl_map.h:162:7: note: candidate: std::map<_Key, _Tp, _Compare, _Alloc>::map() [with _Key = vr::ChaperoneCalibrationState; _Tp = std::__cxx11::basic_string<char>; _Compare = std::less<vr::ChaperoneCalibrationState>; _Alloc = std::allocator<std::pair<const vr::ChaperoneCalibrationState, std::__cxx11::basic_string<char> > >]
       map()
       ^
/usr/include/c++/5/bits/stl_map.h:162:7: note:   candidate expects 0 arguments, 10 provided
vive_ros/CMakeFiles/vive_node.dir/build.make:86: recipe for target 'vive_ros/CMakeFiles/vive_node.dir/src/vr_interface.cpp.o' failed
make[2]: *** [vive_ros/CMakeFiles/vive_node.dir/src/vr_interface.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
CMakeFiles/Makefile2:2966: recipe for target 'vive_ros/CMakeFiles/vive_node.dir/all' failed
make[1]: *** [vive_ros/CMakeFiles/vive_node.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j12 -l12" failed

Any help/pointers much apprecaited

awesomebytes commented 7 years ago

In my debugging branch: https://github.com/awesomebytes/vive_ros/tree/debugging I got over that compilation error (the structure used for getting text version of errors does not exist in that form anymore). I just commented out some lines. The branch is based in some extra debugging info I added. You can give it a try although it crashes with a segmentation fault. :(

musamarcusso commented 7 years ago

That seems to be a typo, I replaced vr::ChaperoneCalibrationState_Error_BaseStationUninitalized for vr::ChaperoneCalibrationState_Error_BaseStationUninitialized and it worked. But I also get the segmentation fault when starting the vrserver.

kubelvla commented 7 years ago

Hi, I've been trying to make this thing work again as well. Look at my post in the openvr repo: openvr/issues/232

With the latest openvr, Ubuntu 16.04 and ros kinetic, I get to the point when the catkin_make actually compiles the code (with the typo @musamarcusso mentions and the vr::VRApplication_Background setting @awesomebytes proposed).

When run with the original runtime settings from @robosavvy, I get the 102 error when calling the VR_Init. So there has been some change, the original libraries from the launch script are these:

/home/robot/.local/share/Steam/ubuntu12_32/steam-runtime/i386/lib/i386-linux-gnu: /home/robot/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/lib/x86_64-linux-gnu: /home/robot/.local/share/Steam/steamapps/common/SteamVR/bin/linux32: /home/robot/.local/share/Steam/steamapps/common/SteamVR/bin/linux64: /home/robot/.local/share/Steam/steamapps/common/SteamVR/drivers/lighthouse/bin/linux32: /home/robot/.local/share/Steam/steamapps/common/SteamVR/drivers/lighthouse/bin/linux64: /home/robot/libraries/openvr/lib/linux32: /home/robot/libraries/openvr/lib/linux64

And the libraries set by Steam's run.sh script are these:

/home/robot/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/lib/x86_64-linux-gnu: /home/robot/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/lib: /home/robot/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/usr/lib/x86_64-linux-gnu: /home/robot/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/usr/lib: /home/robot/.local/share/Steam/ubuntu12_32/steam-runtime/i386/lib/i386-linux-gnu: /home/robot/.local/share/Steam/ubuntu12_32/steam-runtime/i386/lib: /home/robot/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu: /home/robot/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib: /home/robot/catkin_ws/devel/lib: /opt/ros/kinetic/lib: /home/robot/libraries/openvr/lib/linux64/

The problem I run into when launching the tracker node from within the current runtime is that there is something wrong with their libstdc++.so.6.0.21 and I get this dynamic linking error:

robot@asimov:~$ .local/share/Steam/ubuntu12_32/steam-runtime/run.sh /home/robot/catkin_ws/devel/lib/vive_ros/vive_node /home/robot/catkin_ws/devel/lib/vive_ros/vive_node: relocation error: /usr/lib/x86_64-linux-gnu/liblog4cxx.so.10: symbol _ZTTNSt7__cxx1119basic_ostringstreamIwSt11char_traitsIwESaIwEEE, version GLIBCXX_3.4.21 not defined in file libstdc++.so.6 with link time reference

So I've done something really nasty: Backed up their libstdc++.so.6.0.21 file and copied there my system one, the one which the catkin_make compiles against. And success :)

musamarcusso commented 7 years ago

Another option is to make a ROS node using pyopenvr instead.

kubelvla commented 7 years ago

Oh, that looks too good to be true :D Have you tried it, does it work? It's definitely worth rewriting this node to python if we can avoid this c++ linking hell. Does it still need the "server" part running?

musamarcusso commented 7 years ago

Hi, I have been trying it out and so far it works for the most part. The only issue is that somehow the information about the buttons are not being updated but the frames for the headset and controllers can be read without a problem. It does need the server part, but you don't need to start it separately, it does it in the application already (see this example to track the HMD). You still need to setup the paths to the libraries, but at least it is only one launch file and one node that you need to start.

kubelvla commented 7 years ago

Great, thanks :)

musamarcusso commented 7 years ago

If you try it out and suddenly pyopenvr complains that it can't find libopenvr_api_64.so, try adding also this path to LD_LIBRARY_PATH:

/usr/local/lib/python2.7/dist-packages/openvr-1.0.801-py2.7.egg/openvr

(or something similar depending on which version of pyopenvr it is right now) I don't know if this is the correct way to do it, but it worked for me.

eric-schleicher commented 7 years ago

I was able to create a ros node using pyopen VR. @musamarcusso did you convert the coordinate space to z up? I'm struggling with that at the moment.

lcluz commented 5 years ago

The current state of this repo is working with latest openvr release(from Valve's repo), ubuntu 16.04 and ROS Kinetic. Closing this issue.