Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
40 changes: 10 additions & 30 deletions CMakeLists.txt → Bonxai/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,40 +50,20 @@ find_package(ament_cmake QUIET)

if ( ament_cmake_FOUND )

project(bonxai_ros)
message(STATUS "Building with colcon")

# Add colcon-specific configuration here
message(STATUS "Building with colcon")
set(dependencies
PCL
octomap
Eigen3
)

find_package(ament_cmake_auto REQUIRED)
ament_auto_find_build_dependencies()

include_directories(bonxai_ros/include 3rdparty)

ament_auto_add_library(bonxai_server SHARED
bonxai_ros/src/bonxai_server.cpp
)

target_link_libraries(bonxai_server
bonxai_map
${PCL_LIBRARIES}
)

rclcpp_components_register_node(bonxai_server
PLUGIN "bonxai_server::BonxaiServer"
EXECUTABLE bonxai_server_node
)


ament_auto_package(
INSTALL_TO_SHARE
bonxai_ros/launch
bonxai_ros/rviz
bonxai_ros/params
)
ament_export_targets(export_${PROJECT_NAME} HAS_LIBRARY_TARGET)
ament_export_dependencies(${dependencies})
ament_package()

else()

message(STATUS "Building with cmake")

endif()
endif()
15 changes: 14 additions & 1 deletion bonxai_core/CMakeLists.txt → Bonxai/bonxai_core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,21 @@ target_include_directories(bonxai_core PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)

install(
DIRECTORY include/
DESTINATION include/
)

install(
TARGETS bonxai_core
EXPORT export_${PROJECT_NAME}
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
RUNTIME DESTINATION bin
)


if(benchmark_FOUND)
add_subdirectory(benchmark)
endif()


16 changes: 15 additions & 1 deletion bonxai_map/CMakeLists.txt → Bonxai/bonxai_map/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,22 @@ target_link_libraries(bonxai_map PUBLIC
bonxai_core
${PCL_LIBRARIES})

install(
DIRECTORY include/
DESTINATION include/
)

install(
TARGETS bonxai_map
EXPORT export_${PROJECT_NAME}
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
RUNTIME DESTINATION bin
)


####################################################

if(benchmark_FOUND AND octomap_FOUND)
add_subdirectory(benchmark)
endif()
endif()
File renamed without changes.
File renamed without changes.
7 changes: 7 additions & 0 deletions examples/CMakeLists.txt → Bonxai/examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,10 @@ add_executable(test_serialization test_serialization.cpp)

target_link_libraries(test_serialization PUBLIC
bonxai_core)

install(
TARGETS
bonxai_map_playground
test_serialization
RUNTIME DESTINATION lib/${PROJECT_NAME}
)
File renamed without changes.
19 changes: 19 additions & 0 deletions Bonxai/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<package format="3">
<name>Bonxai</name>
<version>3.0.1</version>
<description>Core Bonxai functionality as a ros package</description>
<maintainer email="enrique.aleman1998@gmail.com">enrique</maintainer>
<license>MPL-2.0</license>

<buildtool_depend>ament_cmake</buildtool_depend>

<build_depend>eigen3</build_depend>
<build_depend>libpcl-dev</build_depend>
<build_depend>lz4</build_depend>
<build_depend>octomap</build_depend>

<export>
<build_type>ament_cmake</build_type>
</export>

</package>
File renamed without changes.
7 changes: 7 additions & 0 deletions Bonxai_ros/bonxai_ros/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
cmake_minimum_required(VERSION 3.10.2)

project(bonxai_ros)

find_package(ament_cmake REQUIRED)

ament_package()
16 changes: 16 additions & 0 deletions Bonxai_ros/bonxai_ros/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<package format="3">
<name>bonxai_ros</name>
<version>3.0.1</version>
<description>Metapackage for bonxai ros packages</description>
<maintainer email="enrique.aleman1998@gmail.com">enrique</maintainer>
<license>MPL-2.0</license>

<buildtool_depend>ament_cmake</buildtool_depend>

<exec_depend>bonxai_server</exec_depend>

<export>
<build_type>ament_cmake</build_type>
</export>

</package>
49 changes: 49 additions & 0 deletions Bonxai_ros/bonxai_server/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
cmake_minimum_required(VERSION 3.10)
project(bonxai_server)

if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)

message(STATUS "Setting build type to 'RelWithDebInfo' as none was specified.")

set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE
STRING "Choose the type of build." FORCE)
# Set the possible values of build type for cmake-gui
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
"Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_FLAGS "-fno-omit-frame-pointer -g")

#---- Use Address sanitizer if compiled in Debug mode ----
option(BONXAI_SANITIZE "Add address sanitizer when compiling in Debug mode" ON)

if(BONXAI_SANITIZE)
set (CMAKE_CXX_DEBUG_FLAGS "${CMAKE_CXX_DEBUG_FLAGS} -fsanitize=address")
set (CMAKE_LINKER_DEBUG_FLAGS "${CMAKE_LINKER_DEBUG_FLAGS} -fsanitize=address")
endif()


if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic -fno-omit-frame-pointer)
endif()

find_package(ament_cmake REQUIRED)
find_package(ament_cmake_auto REQUIRED)
ament_auto_find_build_dependencies()

ament_auto_add_library(bonxai_server SHARED
src/bonxai_server.cpp
)

rclcpp_components_register_node(bonxai_server
PLUGIN "bonxai_server::BonxaiServer"
EXECUTABLE bonxai_server_node
)

ament_auto_package(
INSTALL_TO_SHARE
launch
rviz
params
)
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
def generate_launch_description():

# Current Package Name
package = "bonxai_ros"
package = "bonxai_server"

bonxai_params = os.path.join(
get_package_share_directory(package),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<launch>
<node pkg="bonxai_ros" exec="bonxai_server_node" name="bonxai_server">
<node pkg="bonxai_server" exec="bonxai_server_node" name="bonxai_server">

<!-- fVoxelGrid Resolution -->
<param name="resolution" value="0.02" />
Expand Down
8 changes: 4 additions & 4 deletions package.xml → Bonxai_ros/bonxai_server/package.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>bonxai_ros</name>
<name>bonxai_server</name>
<version>0.0.0</version>
<description>TODO: Package description</description>
<description>3D Probabilistic grid mapping server using Bonxai for the grid</description>
<maintainer email="enrique.aleman1998@gmail.com">enrique</maintainer>
<license>TODO: License declaration</license>
<license>MPL-2.0</license>

<!-- <buildtool_depend>ament_cmake</buildtool_depend> -->
<buildtool_depend>ament_cmake_auto</buildtool_depend>

<depend>Bonxai</depend>
<depend>rclcpp</depend>
<depend>rclcpp_components</depend>
<depend>pcl_conversions</depend>
Expand Down
File renamed without changes.
File renamed without changes
31 changes: 30 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,36 @@ Octomap_IterateAllCells 698 us
- **Update** means modifying the value of an already allocated VoxelGrid.
- **IterateAllCells** will get the value and the coordinates of all the existing cells.

# How to build it

## Copy-paste

If your goal is just to use the bonxai data structure in your project, you could copy `Bonxai/Bonxai/bonxai_core/include/bonxai.hpp` into your project. And then build your project normally.

## Cmake Users

If you want the functionality in bonxai_core and bonxai_map, and you want to run the examples and benchmarks, you can perform a cmake build.

clone this repository.

cd into Bonxai/Bonxai

Do the cmake dance:

mkdir build
cmake ..
make -j4

## ROS2 / Colcon Users

clone this repository into your ros_ws

colcon build --symlink-install

source the install/setup.bash in your workspace

This will give access to the bonxai data structure via the Bonxai package as well as all the packages in Bonxai_ros.

# How to use it

The core of **Bonxai** is a header-only library that you can simply copy into your project
Expand Down Expand Up @@ -158,4 +188,3 @@ It is... complicated.
If you need to store very sparse point clouds, you should expect Bonxai to use more memory (20-40% more).
If the point cloud is relatively dense, Bonxai might use less memory than Octomap (less than half).