Closed uchuuengineer closed 3 years ago
Hi,
I've taken some time to try rtabmap_ros on Windows. I tested so far without VTK, so without UI. For this example, this commit (rtabmap) and this one (rtabmap_ros) are required.
$ cd rtabmap/build
$ cmake -DWITH_QT=OFF -DCMAKE_INSTALL_PREFIX=C:\opt\rosdeps\x64 ..
$ cmake --build . --config Release --target install
I install rtabmap in default rosdep binaries path for convenience.
Open Issues:
I see that you've built rtabmap with VTK support, is the standalone RTABMap.exe generated by the rtabmap library (not rtabmap_ros) working? I tried VTK6.3 but the Qt5 version installed with ROS is missing some libraries. I may try VTK8 as you, but I want to know if RTABMap.exe is not crashing at start. Not sure to which VTK version the pcl_visualization library is linked on. We should use the same one, otherwise rtabmap GUI would crash (and rtabmapviz on ROS).
The Library limit of 65535 objects exceeded
is fixed by the second commit I referred. As you did, we should add /bigobj
compilation flag, and for rtabmap_sync
, I needed to reduce the number of functions compiled with the two new build options (both default to false on Windows).
demo_mapping.bag is not working on Windows, because images in the bag are compressedDepth
format. It seems that the ROS windows binaries don't contain the ... actually it does have the plugin by default, but it is failing the conversion because the rosbag send a slightly different format than expected (maybe the bag is too old). compressedDepth
plugin
"compressedDepth png"
to "compressedDepth"
and rebuild. The mapping demo using rviz should now work as expected:
$ roslaunch rtabmap_ros demo_robot_mapping.launch rviz:=true rtabmapviz:=false
$ rosbag play --clock demo_mapping.bag
I didn't test with a camera (like Kinect), as there are no prebuilt binaries for cameras in ROS for windows. We would have to build from source openni2_launch, openni_launch or freenect_launch to try a Kinect camera for example. Not sure about realsense package on ROS if they work on Windows.
Hi matlabbe, thank you so much for all your help. This is the first time I managed to build rtabmap_ros, but not without issues. I followed your installation instructions and rtabmap_ros finally built to 100%. I also modified line 81 in codec.cpp in the image_transport_plugins package as you recommended and rebuilt. However, running the first roslaunch command launched RViz with four error messages (OpenNI2.dll, g2o_core.dll, g2o_types_slam2d.dll, g2o_types_slam3d.dll not found).
I am not very good with C++ editing and building code, but I hope I will be able to answer your questions somewhat. Most of the rtabmap_ros builds I attempted to used an RTABMap binary for its dependencies that I obtained from here. If my memory is correct, I think I managed to built RTABMap from source once (and failed all the other times), but I had the same error as when I used the binary for dependencies, so I deleted the version I built from source. The already built RTABMap.exe was able to detect my ZED stereo camera, however it would crash upon calibration. I would get generate(?) errors saying VTKConfig.cmake could not be located so I manually tried to build with two versions of VTK on separate build attempts: the newest VTK version (8.2) on VTK's official site as well as the 6.3 version under the Installation for Windows section here.
If I understand correctly from your explanation, I should build OpenNI2 from source (and I guess also g2o) while pointing to it either when building RTABMap or RTABMap_ROS. I will try that and see how it works.
EDIT: I got demo_mapping.bag working in rtabmap_ros. I had to move the dll files to the devel\bin folder and roslaunch started working after that.
I installed rtabmap binaries in C:\opt\rosdeps\x64
, which is the default path for ros to find the dlls. If rtabmap is installed anywhere else, we need to add to PATH the bin directory, or copy dlls like you did (in a directory contained in the PATH).
The rtabmap standalone binaries may not be built with same PCL and opencv versions used in ROS. This may cause crashes for rtabmap_ros
when mixing up libraries with different versions. Well, at least you managed to run the demo example. I suggest to continue using RVIZ for visualization under ROS, to avoid all building issues with VTK. The resulting database could still be opened with RTAB-Map standalone binaries afterwards.
cheers, Mathieu
I am trying to build RTABMap ROS for ROS Melodic on Windows, but a library limit error seems to be the cause of my problems. I think I managed to make this error go away temporarily by adding /bigobj flags in CmakeLists.txt, but then I just run into a problem when I'm 89% done with compilation that says "don't know how to make 'C:\ws\rtabmap_ros\devel\lib\rtabmap_sync.lib'." I suspect it is because I was improperly dealing with this library limit error and after trying for about two weeks, I can't seem to fix it. I linked the original library limit error I got below. I appreciate any help you can give me.