### Install ROS Dependencies (Kinetic Example) Source: https://github.com/hku-mars/r3live/blob/master/README.md Example command for installing ROS packages for the Kinetic distribution. ```bash sudo apt-get install ros-kinetic-cv-bridge ros-kinetic-tf ros-kinetic-message-filters ros-kinetic-image-transport* ``` -------------------------------- ### Install CGAL and PCL Viewer Source: https://github.com/hku-mars/r3live/blob/master/README.md Installs optional but recommended libraries for 3D mesh processing. ```bash sudo apt-get install libcgal-dev pcl-tools ``` -------------------------------- ### Run R3LIVE Example Source: https://github.com/hku-mars/r3live/blob/master/README.md Launches the R3LIVE package and plays a downloaded rosbag file for demonstration. ```bash roslaunch r3live r3live_bag.launch rosbag play YOUR_DOWNLOADED.bag ``` -------------------------------- ### Install PCL Viewer and MeshLab Source: https://github.com/hku-mars/r3live/blob/master/README.md Installs tools for visualizing point cloud maps and reconstructed meshes. ```bash sudo apt-get install pcl-tools meshlab ``` -------------------------------- ### Install Common Library and Headers Source: https://github.com/hku-mars/r3live/blob/master/r3live/src/meshing/MVS/Common/CMakeLists.txt Configures installation rules for the 'Common' target, including runtime, library, archive, and public header files. ```cmake SET_TARGET_PROPERTIES(Common PROPERTIES PUBLIC_HEADER "${LIBRARY_FILES_H}") INSTALL(TARGETS Common EXPORT OpenMVSTargets RUNTIME DESTINATION "${INSTALL_BIN_DIR}" COMPONENT bin LIBRARY DESTINATION "${INSTALL_LIB_DIR}" COMPONENT shlib ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" COMPONENT lib PUBLIC_HEADER DESTINATION "${INSTALL_INCLUDE_DIR}/Common" COMPONENT dev) ``` -------------------------------- ### Install ROS Dependencies Source: https://github.com/hku-mars/r3live/blob/master/README.md Installs essential ROS packages required for R3LIVE. Replace 'XXX' with your ROS distribution. ```bash sudo apt-get install ros-XXX-cv-bridge ros-XXX-tf ros-XXX-message-filters ros-XXX-image-transport ros-XXX-image-transport* ``` -------------------------------- ### Launch Mesh Reconstruction Utility Source: https://github.com/hku-mars/r3live/blob/master/README.md Starts the utility to reconstruct and texture meshes from saved offline maps. ```bash roslaunch r3live r3live_reconstruct_mesh.launch ``` -------------------------------- ### Launch R3LIVE with Ouster OS2-64 Bag File Source: https://github.com/hku-mars/r3live/blob/master/README.md Launches the R3LIVE system using a pre-recorded ROS bag file from an Ouster OS2-64 LiDAR. The VIO subsystem is manually disabled for this example due to missing calibration files. ```bash roslaunch r3live r3live_bag_ouster.launch rosbag play ouster_example_for_LIO_test.bag ``` -------------------------------- ### Check OpenCV Version Source: https://github.com/hku-mars/r3live/blob/master/README.md Verifies the installed OpenCV version. A version of 3.3 or higher is recommended. ```bash pkg-config --modversion opencv ``` -------------------------------- ### Build R3LIVE with Catkin Make Source: https://github.com/hku-mars/r3live/blob/master/README.md Clones the R3LIVE repository and builds the package within a ROS workspace. ```bash cd ~/catkin_ws/src git clone https://github.com/hku-mars/r3live.git cd ../ catkin_make source ~/catkin_ws/devel/setup.bash ``` -------------------------------- ### Visualize Offline Point Cloud Map Source: https://github.com/hku-mars/r3live/blob/master/README.md Opens a saved point cloud map file (*.pcd) using pcl_viewer. ```bash cd ${HOME}/r3live_output pcl_viewer rgb_pt.pcd ``` -------------------------------- ### Create CXX Library Source: https://github.com/hku-mars/r3live/blob/master/r3live/src/meshing/MVS/Common/CMakeLists.txt Defines a static CXX library named 'Common' with specified source files and default C++ standard. ```cmake cxx_library_with_type_no_pch(Common "Libs" "STATIC" "${cxx_default}" ${LIBRARY_FILES_C} ${LIBRARY_FILES_H} ) ``` -------------------------------- ### Import Filter Load Mask Usage Source: https://github.com/hku-mars/r3live/blob/master/r3live/src/meshing/vcg/wrap/io_trimesh/how_to_write_an_io_filter.txt Explains the use of the loadmask parameter in the Open method. This output-only bitmask indicates the data found in the file (e.g., vertex colors, texture coordinates). It should reflect the mesh's capabilities, not selectively load attributes. ```cpp if(cb && (j%1000)==0) cb(j*50/vertex_number,"Vertex Loading"); ``` -------------------------------- ### Visualize Reconstructed Mesh Source: https://github.com/hku-mars/r3live/blob/master/README.md Opens a saved textured mesh file (*.ply) using MeshLab. ```bash cd ${HOME}/r3live_output meshlab textured_mesh.ply ``` -------------------------------- ### Link Dependencies Source: https://github.com/hku-mars/r3live/blob/master/r3live/src/meshing/MVS/Common/CMakeLists.txt Links the 'Common' library against Boost and OpenCV libraries. ```cmake TARGET_LINK_LIBRARIES(Common ${Boost_LIBRARIES} ${OpenCV_LIBS}) ``` -------------------------------- ### Glob Source Files Source: https://github.com/hku-mars/r3live/blob/master/r3live/src/meshing/MVS/Common/CMakeLists.txt Uses CMake's GLOB command to find all .cpp files for the PCH and library source files. ```cmake FILE(GLOB PCH_C "Common.cpp") FILE(GLOB LIBRARY_FILES_C "*.cpp") FILE(GLOB LIBRARY_FILES_H "*.h" "*.inl") ``` -------------------------------- ### Import Filter Class Structure Source: https://github.com/hku-mars/r3live/blob/master/r3live/src/meshing/vcg/wrap/io_trimesh/how_to_write_an_io_filter.txt Defines the required class structure and methods for an import filter. The class must be templated on the mesh type and named vcg::tri::io::ImporterXXX, where XXX is the file extension. It requires Open methods for mesh loading and an ErrorMsg method for translating error codes. ```cpp class vcg::tri::io::ImporterXXX { public: static int Open(MESH_TYPE &mesh, const char *filename, CallBackPos *cb=0); static int Open(MESH_TYPE &mesh, const char *filename, int & loadmask, CallBackPos *cb =0); static const char *ErrorMsg(int error); }; ``` -------------------------------- ### Order Library Files for PCH Source: https://github.com/hku-mars/r3live/blob/master/r3live/src/meshing/MVS/Common/CMakeLists.txt Removes the PCH file from the general library files list and prepends it to ensure it's processed first by cotire. ```cmake LIST(REMOVE_ITEM LIBRARY_FILES_C ${PCH_C}) SET(LIBRARY_FILES_C "${PCH_C};${LIBRARY_FILES_C}") ``` -------------------------------- ### Set Precompiled Header Source: https://github.com/hku-mars/r3live/blob/master/r3live/src/meshing/MVS/Common/CMakeLists.txt Manually sets 'Common.h' as the precompiled header for the 'Common' target. ```cmake set_target_pch(Common Common.h) ``` -------------------------------- ### Export Filter Class Structure Source: https://github.com/hku-mars/r3live/blob/master/r3live/src/meshing/vcg/wrap/io_trimesh/how_to_write_an_io_filter.txt Defines the required class structure and methods for an export filter. The class must be templated on the mesh type and named vcg::tri::io::ExporterXXX, where XXX is the file extension. It requires Save methods for mesh exporting, an ErrorMsg method, and GetExportMaskCapability to report supported data types. ```cpp class vcg::tri::io::ExporterDOH { public: static int Save(MESH_TYPE &mesh, const char *filename, CallBackPos *cb=0); static int Save(MESH_TYPE &mesh, const char *filename, int & savemask, CallBackPos *cb =0); static const char *ErrorMsg(int error); static int GetExportMaskCapability(); }; ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.