├── CONTRIBUTING.md
├── LICENSE
├── 3rdparty
└── occmap
│ ├── install.sh
│ ├── proto
│ ├── range_data.proto
│ ├── CMakeLists.txt
│ └── transform.proto
│ ├── example
│ └── CMakeLists.txt
│ ├── data
│ ├── gridmap_node.yaml
│ └── pointcloud
│ │ ├── 637938961441429120.txt
│ │ ├── 637938961424666520.txt
│ │ ├── 637938961434452240.txt
│ │ ├── 637938961421656600.txt
│ │ ├── 637938961420679170.txt
│ │ ├── 637938961422718080.txt
│ │ ├── 637938961448127250.txt
│ │ ├── 637938961429517620.txt
│ │ ├── 637938961425590080.txt
│ │ ├── 637938961431477380.txt
│ │ ├── 637938961447204670.txt
│ │ ├── 637938961419796480.txt
│ │ ├── 637938961442249670.txt
│ │ ├── 637938961427609610.txt
│ │ ├── 637938961430518770.txt
│ │ ├── 637938961428542520.txt
│ │ ├── 637938961452064660.txt
│ │ ├── 637938961423664550.txt
│ │ ├── 637938961426565080.txt
│ │ ├── 637938961432490890.txt
│ │ ├── 637938961435387190.txt
│ │ ├── 637938961440422950.txt
│ │ ├── 637938961451071210.txt
│ │ ├── 637938961417809560.txt
│ │ ├── 637938961418776790.txt
│ │ ├── 637938961437406860.txt
│ │ ├── 637938961443236900.txt
│ │ ├── 637938961445176480.txt
│ │ ├── 637938961439343830.txt
│ │ ├── 637938961446202730.txt
│ │ ├── 637938961438408070.txt
│ │ ├── 637938961433492250.txt
│ │ ├── 637938961455068180.txt
│ │ ├── 637938961444249670.txt
│ │ ├── 637938961449188000.txt
│ │ └── 637938961436418060.txt
│ ├── include
│ ├── occ_gridmap
│ │ ├── tic_toc.hpp
│ │ ├── proto_io.hpp
│ │ ├── param.hpp
│ │ ├── map_beauti.hpp
│ │ ├── common.hpp
│ │ └── sensor.hpp
│ ├── map2d
│ │ ├── ray_to_pixel_mask.hpp
│ │ ├── value_conversion_tables.hpp
│ │ ├── grid_inserter_2d.hpp
│ │ ├── submaps.hpp
│ │ ├── image.hpp
│ │ ├── xy_index.hpp
│ │ ├── map_limits.hpp
│ │ └── submap_2d.hpp
│ └── scan_matching
│ │ ├── occupied_space_cost_function_2d.hpp
│ │ ├── rotation_delta_cost_function_2d.hpp
│ │ ├── ceres_scan_matching_2d.hpp
│ │ └── translation_delta_cost_functor_2d.hpp
│ ├── CMakeLists.txt
│ └── src
│ ├── value_conversion_tables.cpp
│ ├── rigid_transform.cpp
│ ├── ceres_scan_matching_2d.cpp
│ ├── image.cpp
│ └── submap_2d.cpp
├── .github
└── ISSUE_TEMPLATE
│ ├── custom.md
│ ├── feature_request.md
│ └── bug_report.md
├── package.xml
├── README.md
├── launch
└── create_gridmap_node.launch.py
└── param
└── gridmap_node.yaml
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | cyberdog_occmap is released under a Apache License.
2 | Please see README.md for a list of all included code and library dependencies which are not property of the authors of cyberdog_occmap.
--------------------------------------------------------------------------------
/3rdparty/occmap/install.sh:
--------------------------------------------------------------------------------
1 | rm -rf install
2 | if [ ! -d "build" ]; then
3 | mkdir build
4 | fi
5 | cd build && rm -rf CMakeCache.txt
6 | cmake .. && make -j4 && make install
7 | cd ../ && rm -rf build
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/custom.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Custom issue template
3 | about: Describe this issue template's purpose here.
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 |
11 |
--------------------------------------------------------------------------------
/3rdparty/occmap/proto/range_data.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package proto;
4 |
5 | import "transform.proto";
6 |
7 | message PointCloud {
8 | repeated Vector2d returns_points = 1;
9 | Rigid2d local_pose = 2;
10 | int64 time_stamp = 3;
11 | }
12 |
13 | message RangeData {
14 | int64 time_stamp = 4;
15 | repeated PointCloud point_clouds = 5;
16 | Rigid2d submap_pose = 6;
17 | }
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for this project
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Is your feature request related to a problem? Please describe.**
11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12 |
13 | **Describe the solution you'd like**
14 | A clear and concise description of what you want to happen.
15 |
16 | **Describe alternatives you've considered**
17 | A clear and concise description of any alternative solutions or features you've considered.
18 |
19 | **Additional context**
20 | Add any other context or screenshots about the feature request here.
21 |
--------------------------------------------------------------------------------
/3rdparty/occmap/proto/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | find_package(Protobuf REQUIRED)
2 |
3 | file(GLOB PROTO_FILES "${CMAKE_CURRENT_SOURCE_DIR}/*.proto")
4 | message(STATUS ${PROTO_FILES})
5 |
6 | protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS ${PROTO_FILES})
7 | message("-- PROTO_SRCS = ${PROTO_SRCS}")
8 | message("-- PROTO_HDRS = ${PROTO_HDRS}")
9 |
10 | add_library(proto STATIC ${PROTO_SRCS} ${PROTO_HDRS})
11 |
12 | target_link_libraries(proto ${Protobuf_LIBRARIES})
13 | message("-- Found protobuf libraries: " ${Protobuf_LIBRARIES})
14 | message("-- Found protobuf include: " ${PROTOBUF_INCLUDE_DIRS})
15 | target_include_directories(proto
16 | PUBLIC ${CMAKE_CURRENT_BINARY_DIR}
17 | PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
18 | PUBLIC ${PROTOBUF_INCLUDE_DIRS}
19 | PUBLIC "/usr/local/include")
20 |
21 | install(TARGETS
22 | proto
23 | LIBRARY DESTINATION lib)
--------------------------------------------------------------------------------
/package.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | cyberdog_occmap
5 | 0.0.0
6 | occ map with mivins
7 | root
8 | Apache License, Version 2.0
9 |
10 | ament_cmake
11 |
12 | rclcpp
13 | geometry_msgs
14 | nav_msgs
15 | sensor_msgs
16 | std_msgs
17 | std_srvs
18 | cyberdog_visions_interfaces
19 | cyberdog_common
20 | ros2launch
21 |
22 | ament_lint_auto
23 | ament_lint_common
24 |
25 |
26 | ament_cmake
27 |
28 |
29 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Describe the bug**
11 | A clear and concise description of what the bug is.
12 |
13 | **To Reproduce**
14 | Steps to reproduce the behavior:
15 | 1. Go to '...'
16 | 2. Click on '....'
17 | 3. Scroll down to '....'
18 | 4. See error
19 |
20 | **Expected behavior**
21 | A clear and concise description of what you expected to happen.
22 |
23 | **Screenshots**
24 | If applicable, add screenshots to help explain your problem.
25 |
26 | **Desktop (please complete the following information):**
27 | - OS: [e.g. iOS]
28 | - Browser [e.g. chrome, safari]
29 | - Version [e.g. 22]
30 |
31 | **Smartphone (please complete the following information):**
32 | - Device: [e.g. iPhone6]
33 | - OS: [e.g. iOS8.1]
34 | - Browser [e.g. stock browser, safari]
35 | - Version [e.g. 22]
36 |
37 | **Additional context**
38 | Add any other context about the problem here.
39 |
--------------------------------------------------------------------------------
/3rdparty/occmap/example/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.8)
2 | project(example)
3 |
4 | set(CMAKE_CXX_FLAGS "-std=c++14 -march=native -O3")
5 | set(CMAKE_BUILD_TYPE "Release")
6 |
7 | find_package(Eigen3 REQUIRED)
8 | find_package(yaml-cpp REQUIRED)
9 | find_package(OpenCV REQUIRED)
10 | set(BOOST_COMPONENTS iostreams filesystem)
11 | find_package(Boost REQUIRED COMPONENTS ${BOOST_COMPONENTS})
12 | find_package(Ceres REQUIRED)
13 | find_package(Protobuf REQUIRED)
14 |
15 | include_directories(
16 | ${EIGEN3_INCLUDE_DIR}
17 | ${YAML_CPP_INCLUDE_DIRS}
18 | ${OPENCV_INCLUDE_DIRS}
19 | ${CMAKE_SOURCE_DIR}/../install/include
20 | ${CMAKE_BINARY_DIR}
21 | ${Boost_INCLUDE_DIRS}
22 | ${CERES_INCLUDE_DIRS}
23 | )
24 |
25 | add_executable(demo demo.cpp)
26 | target_link_libraries(demo
27 | glog
28 | ${YAML_CPP_LIBRARIES}
29 | ${OpenCV_LIBS}
30 | ${CMAKE_SOURCE_DIR}/../install/lib/liboccmap.a
31 | ${CMAKE_SOURCE_DIR}/../install/lib/libproto.a
32 | ${Boost_LIBRARIES}
33 | ${CMAKE_THREAD_LIBS_INIT}
34 | ${CERES_LIBRARIES}
35 | ${Protobuf_LIBRARIES}
36 | )
--------------------------------------------------------------------------------
/3rdparty/occmap/data/gridmap_node.yaml:
--------------------------------------------------------------------------------
1 | create_gridmap_node:
2 | create_map_path: /home/hpf/mapping/
3 | probability_param:
4 | p_free: 0.45
5 | p_occ: 0.65
6 | p_prior: 0.5
7 | laser_to_baselink:
8 | position:
9 | - 0.179
10 | - 0.0
11 | - 0.0837
12 | quaternion:
13 | - 0.0
14 | - 0.0
15 | - 0.0
16 | - 1.0
17 | sub_map:
18 | resolution: 0.05
19 | initx: 50
20 | inity: 50
21 | max_range: 15.0
22 | min_range: 0.2
23 | missing_data_ray_length: 5.0
24 | num_accumulated: 35
25 | sizex: 100
26 | sizey: 100
27 | filter_param:
28 | # motion filter
29 | max_time_seconds: 160 # ms
30 | max_distance_meters: 0.2 # m
31 | max_angle_radians: 0.0175 # rad
32 | # voxel filter
33 | min_num_points: 200
34 | max_length: 0.05 # m
35 | voxel_filter_size: 0.025
36 | ceres_param:
37 | use_nonmonotonic_steps: false
38 | max_num_iterations: 20
39 | num_threads: 1
40 | occupied_space_weight: 10.0
41 | translation_weight: 20.0
42 | rotation_weight: 40.0
43 | mapbeauti:
44 | use_map_beauti: false
45 | side_fill_thresh: 10.
46 | approx_poly_thresh: 3.
47 | dilate_kernel_size: 3
48 | noise_removal_thresh: 2
--------------------------------------------------------------------------------
/3rdparty/occmap/proto/transform.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package proto;
4 |
5 | // All coordinates are expressed in the right-handed Cartesian coordinate system
6 | // used by Cartographer (x forward, y left, z up). Message names are chosen to
7 | // mirror those used in the Eigen library.
8 |
9 | message Vector2d {
10 | double x = 1;
11 | double y = 2;
12 | }
13 |
14 | message Vector2f {
15 | float x = 1;
16 | float y = 2;
17 | }
18 |
19 | message Vector3d {
20 | double x = 1;
21 | double y = 2;
22 | double z = 3;
23 | }
24 |
25 | message Vector3f {
26 | float x = 1;
27 | float y = 2;
28 | float z = 3;
29 | }
30 |
31 | message Vector4f {
32 | float x = 1;
33 | float y = 2;
34 | float z = 3;
35 | float t = 4;
36 | }
37 |
38 | message Quaterniond {
39 | double x = 1;
40 | double y = 2;
41 | double z = 3;
42 | double w = 4;
43 | }
44 |
45 | message Quaternionf {
46 | float x = 1;
47 | float y = 2;
48 | float z = 3;
49 | float w = 4;
50 | }
51 |
52 | message Rigid2d {
53 | Vector2d translation = 1;
54 | double rotation = 2;
55 | }
56 |
57 | message Rigid2f {
58 | Vector2f translation = 1;
59 | float rotation = 2;
60 | }
61 |
62 | message Rigid3d {
63 | Vector3d translation = 1;
64 | Quaterniond rotation = 2;
65 | }
66 |
67 | message Rigid3f {
68 | Vector3f translation = 1;
69 | Quaternionf rotation = 2;
70 | }
--------------------------------------------------------------------------------
/3rdparty/occmap/include/occ_gridmap/tic_toc.hpp:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2023 Beijing Xiaomi Mobile Software Co., Ltd. All rights reserved.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #ifndef OCC_GRIDMAP__TIC_TOC_HPP_
16 | #define OCC_GRIDMAP__TIC_TOC_HPP_
17 |
18 | #include
19 | #include
20 | #include
21 |
22 | class TicToc
23 | {
24 | public:
25 | TicToc()
26 | {
27 | tic();
28 | }
29 |
30 | void tic()
31 | {
32 | start = std::chrono::system_clock::now();
33 | }
34 |
35 | double toc()
36 | {
37 | end = std::chrono::system_clock::now();
38 | std::chrono::duration elapsed_seconds = end - start;
39 | return elapsed_seconds.count() * 1000;
40 | }
41 |
42 | private:
43 | std::chrono::time_point start, end;
44 | };
45 |
46 | #endif // OCC_GRIDMAP__TIC_TOC_HPP_
47 |
--------------------------------------------------------------------------------
/3rdparty/occmap/include/map2d/ray_to_pixel_mask.hpp:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2023 Beijing Xiaomi Mobile Software Co., Ltd. All rights reserved.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #ifndef MAP2D__RAY_TO_PIXEL_MASK_HPP_
16 | #define MAP2D__RAY_TO_PIXEL_MASK_HPP_
17 |
18 | #include
19 |
20 | #include
21 |
22 | #include
23 |
24 | namespace mapping
25 | {
26 |
27 | // Compute all pixels that contain some part of the line segment connecting
28 | // 'scaled_begin' and 'scaled_end'. 'scaled_begin' and 'scaled_end' are scaled
29 | // by 'subpixel_scale'. 'scaled_begin' and 'scaled_end' are expected to be
30 | // greater than zero. Return values are in pixels and not scaled.
31 | std::vector RayToPixelMask(
32 | const Eigen::Array2i & scaled_begin,
33 | const Eigen::Array2i & scaled_end,
34 | int subpixel_scale);
35 |
36 | } // namespace mapping
37 |
38 | #endif // MAP2D__RAY_TO_PIXEL_MASK_HPP_
39 |
--------------------------------------------------------------------------------
/3rdparty/occmap/include/scan_matching/occupied_space_cost_function_2d.hpp:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2023 Beijing Xiaomi Mobile Software Co., Ltd. All rights reserved.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #ifndef SCAN_MATCHING__OCCUPIED_SPACE_COST_FUNCTION_2D_HPP_
16 | #define SCAN_MATCHING__OCCUPIED_SPACE_COST_FUNCTION_2D_HPP_
17 |
18 | #include
19 |
20 | #include "occ_gridmap/sensor.hpp"
21 | #include "map2d/grid_2d.hpp"
22 |
23 | namespace mapping
24 | {
25 |
26 | // Creates a cost function for matching the 'point_cloud' to the 'grid' with
27 | // a 'pose'. The cost increases with poorer correspondence of the grid and the
28 | // point observation (e.g. points falling into less occupied space).
29 | ceres::CostFunction * CreateOccupiedSpaceCostFunction2D(
30 | const double scaling_factor, const sensor::PointCloudCarto & point_cloud_carto,
31 | const Grid2D & grid);
32 |
33 | } // namespace mapping
34 |
35 | #endif // SCAN_MATCHING__OCCUPIED_SPACE_COST_FUNCTION_2D_HPP_
36 |
--------------------------------------------------------------------------------
/3rdparty/occmap/include/map2d/value_conversion_tables.hpp:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2023 Beijing Xiaomi Mobile Software Co., Ltd. All rights reserved.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #ifndef MAP2D__VALUE_CONVERSION_TABLES_HPP_
16 | #define MAP2D__VALUE_CONVERSION_TABLES_HPP_
17 |
18 | #include