Skip to content

Commit fc42a5e

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents c5911a3 + 0eb7d8b commit fc42a5e

30 files changed

+888
-205
lines changed

.github/workflows/ubuntu.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ jobs:
1212
runs-on: ubuntu-20.04
1313
strategy:
1414
matrix:
15-
python-version:
16-
# - "3.8"
17-
- "3.11"
15+
python-version: ["3.8", "3.9", "3.10", "3.11"]
1816

1917
steps:
2018
- name: Checkout source code
@@ -71,9 +69,8 @@ jobs:
7169
- name: Publish package
7270
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
7371
env:
74-
PYPI_USERNAME: ${{ secrets.pypi_username }}
75-
PYPI_PASSWORD: ${{ secrets.pypi_password }}
72+
PYPI_API_TOKEN: ${{ secrets.pypi_api_token }}
7673
run: |
7774
python -m pip install twine
7875
cd build/lib/python_package
79-
python -m twine upload -u ${PYPI_USERNAME} -p ${PYPI_PASSWORD} pip_package/*
76+
python -m twine upload -u "__token__" -p ${PYPI_API_TOKEN} pip_package/*

.github/workflows/windows.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,7 @@ jobs:
100100
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
101101
working-directory: ${{ env.build_dir }}/lib/python_package
102102
env:
103-
PYPI_USERNAME: ${{ secrets.pypi_username }}
104-
PYPI_PASSWORD: ${{ secrets.pypi_password }}
103+
PYPI_API_TOKEN: ${{ secrets.pypi_api_token }}
105104
run: |
106105
python -m pip install twine
107-
python -m twine upload -u $env:PYPI_USERNAME -p $env:PYPI_PASSWORD pip_package/*
106+
python -m twine upload -u "__token__" -p $env:PYPI_API_TOKEN pip_package/*

Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
FROM nvidia/cuda:11.4.0-devel-ubuntu20.04
2+
FROM nvidia/cuda:11.7.1-devel-ubuntu20.04
33

44
WORKDIR /work/cupoch
55

@@ -39,4 +39,5 @@ RUN mkdir build \
3939
COPY . .
4040
RUN cd build \
4141
&& cmake .. -DCMAKE_BUILD_TYPE=Release \
42-
&& make install-pip-package
42+
&& make pip-package \
43+
&& pip install lib/python_package/pip_package/*.whl

README.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ This repository is based on [Open3D](https://github.com/intel-isl/Open3D).
2626
* [flann](https://github.com/flann-lib/flann)
2727
* Point cloud registration
2828
* ICP
29+
* [Symmetric ICP](https://gfx.cs.princeton.edu/pubs/Rusinkiewicz_2019_ASO/symm_icp.pdf) (Implemented by [@eclipse0922](https://github.com/eclipse0922))
2930
* [Colored Point Cloud Registration](https://ieeexplore.ieee.org/document/8237287)
3031
* [Fast Global Registration](http://vladlen.info/papers/fast-global-registration.pdf)
3132
* [FilterReg](https://arxiv.org/abs/1811.10136)
@@ -83,7 +84,7 @@ You can also install cupoch using pip on Jetson Nano.
8384
Please set up Jetson using [jetpack](https://developer.nvidia.com/embedded/jetpack) and install some packages with apt.
8485

8586
```
86-
sudo apt-get install libxinerama-dev libxcursor-dev libglu1-mesa-dev
87+
sudo apt-get install xorg-dev libxinerama-dev libxcursor-dev libglu1-mesa-dev
8788
pip3 install cupoch
8889
```
8990

@@ -107,27 +108,6 @@ sudo make install-pip-package
107108

108109
### Use Docker
109110

110-
Setting default container runtime to nvidia-container-runtime.
111-
Edit or create the `/etc/docker/daemon.json`.
112-
113-
```sh
114-
{
115-
"runtimes": {
116-
"nvidia": {
117-
"path": "/usr/bin/nvidia-container-runtime",
118-
"runtimeArgs": []
119-
}
120-
},
121-
"default-runtime": "nvidia"
122-
}
123-
```
124-
125-
Restart docker daemon.
126-
127-
```sh
128-
sudo systemctl restart docker
129-
```
130-
131111
```sh
132112
docker-compose up -d
133113
# xhost +
@@ -147,11 +127,31 @@ The environment tested on has the following specs:
147127

148128
You can get the result by running the example script in your environment.
149129

150-
```
130+
```sh
151131
cd examples/python/basic
152132
python benchmarks.py
153133
```
154134

135+
If you get the following error when executing an example that includes 3D drawing, please start the program as follows.
136+
137+
```sh
138+
$ cd examples/basic
139+
$ python visualization.py
140+
Load a ply point cloud, print it, and render it
141+
MESA: warning: Driver does not support the 0xa7a0 PCI ID.
142+
libGL error: failed to create dri screen
143+
libGL error: failed to load driver: iris
144+
MESA: warning: Driver does not support the 0xa7a0 PCI ID.
145+
libGL error: failed to create dri screen
146+
libGL error: failed to load driver: iris
147+
Error: unknown error phong_shader.cu:330
148+
```
149+
150+
```sh
151+
__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia python visualization.py
152+
```
153+
154+
155155
![speedup](https://raw.githubusercontent.com/neka-nat/cupoch/master/docs/_static/speedup.png)
156156

157157
### Visual odometry with intel realsense D435

conanfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
class CupochConan(ConanFile):
2929
name = "cupoch"
30-
version = "0.2.8.1"
30+
version = "0.2.10.0"
3131
package_type = "library"
3232

3333
license = "MIT"

src/cupoch/geometry/boundingvolume.cu

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ struct check_within_oriented_bounding_box_functor {
4242
const std::array<Eigen::Vector3f, 8> box_points_;
4343
__device__ float test_plane(const Eigen::Vector3f &a,
4444
const Eigen::Vector3f &b,
45-
const Eigen::Vector3f c,
45+
const Eigen::Vector3f &c,
4646
const Eigen::Vector3f &x) const {
4747
Eigen::Matrix3f design;
4848
design << (b - a), (c - a), (x - a);
@@ -51,7 +51,7 @@ struct check_within_oriented_bounding_box_functor {
5151
__device__ bool operator()(
5252
const thrust::tuple<int, Eigen::Vector3f> &x) const {
5353
const Eigen::Vector3f &point = thrust::get<1>(x);
54-
return (test_plane(box_points_[0], box_points_[1], box_points_[3],
54+
return ((test_plane(box_points_[0], box_points_[1], box_points_[3],
5555
point) <= 0 &&
5656
test_plane(box_points_[0], box_points_[5], box_points_[3],
5757
point) >= 0 &&
@@ -62,7 +62,19 @@ struct check_within_oriented_bounding_box_functor {
6262
test_plane(box_points_[3], box_points_[4], box_points_[5],
6363
point) <= 0 &&
6464
test_plane(box_points_[0], box_points_[1], box_points_[7],
65-
point) >= 0);
65+
point) >= 0) ||
66+
(test_plane(box_points_[0], box_points_[1], box_points_[3],
67+
point) >= 0 &&
68+
test_plane(box_points_[0], box_points_[5], box_points_[3],
69+
point) <= 0 &&
70+
test_plane(box_points_[2], box_points_[5], box_points_[7],
71+
point) >= 0 &&
72+
test_plane(box_points_[1], box_points_[4], box_points_[7],
73+
point) <= 0 &&
74+
test_plane(box_points_[3], box_points_[4], box_points_[5],
75+
point) >= 0 &&
76+
test_plane(box_points_[0], box_points_[1], box_points_[7],
77+
point) <= 0));
6678
}
6779
};
6880

src/cupoch/geometry/laserscanbuffer.cu

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,11 @@ template LaserScanBuffer& LaserScanBuffer::AddRanges(
298298
const Eigen::Matrix4f& transformation,
299299
const utility::pinned_host_vector<float>& intensities);
300300

301+
template LaserScanBuffer& LaserScanBuffer::AddRanges(
302+
const thrust::host_vector<float>& ranges,
303+
const Eigen::Matrix4f& transformation,
304+
const thrust::host_vector<float>& intensities);
305+
301306

302307
class ContainerLikePtr {
303308
public:

src/cupoch/geometry/occupancygrid.cu

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,17 @@ OccupancyGrid& OccupancyGrid::Insert(
526526
return Insert(dev_points, viewpoint, max_range);
527527
}
528528

529+
OccupancyGrid& OccupancyGrid::Insert(
530+
const thrust::host_vector<Eigen::Vector3f>& points,
531+
const Eigen::Vector3f& viewpoint,
532+
float max_range) {
533+
utility::device_vector<Eigen::Vector3f> dev_points(points.size());
534+
cudaSafeCall(cudaMemcpy(
535+
thrust::raw_pointer_cast(dev_points.data()), thrust::raw_pointer_cast(points.data()),
536+
points.size() * sizeof(Eigen::Vector3f), cudaMemcpyHostToDevice));
537+
return Insert(dev_points, viewpoint, max_range);
538+
}
539+
529540
OccupancyGrid& OccupancyGrid::Insert(const geometry::PointCloud& pointcloud,
530541
const Eigen::Vector3f& viewpoint,
531542
float max_range) {

src/cupoch/geometry/occupancygrid.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,10 @@ class OccupancyGrid : public DenseGrid<OccupancyVoxel> {
108108
const utility::pinned_host_vector<Eigen::Vector3f>& points,
109109
const Eigen::Vector3f& viewpoint,
110110
float max_range = -1.0);
111+
OccupancyGrid& Insert(
112+
const thrust::host_vector<Eigen::Vector3f>& points,
113+
const Eigen::Vector3f& viewpoint,
114+
float max_range = -1.0);
111115
OccupancyGrid& Insert(const PointCloud& pointcloud,
112116
const Eigen::Vector3f& viewpoint,
113117
float max_range = -1.0);

src/cupoch/integration/scalable_tsdfvolume.cu

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,6 @@ __global__ void OpenVolumeUnitKernel(const Eigen::Vector3f *points,
125125
struct extract_pointcloud_functor {
126126
extract_pointcloud_functor(
127127
const VolumeUnitsMap &volume_units,
128-
const stdgpu::device_indexed_range<const VolumeUnitsMap::value_type>
129-
&range,
130128
int resolution,
131129
float voxel_length,
132130
float volume_unit_length,
@@ -135,7 +133,7 @@ struct extract_pointcloud_functor {
135133
Eigen::Vector3f *normals,
136134
Eigen::Vector3f *colors)
137135
: volume_units_(volume_units),
138-
range_(range),
136+
range_(volume_units.device_range()),
139137
resolution_(resolution),
140138
voxel_length_(voxel_length),
141139
half_voxel_length_(0.5 * voxel_length_),
@@ -363,7 +361,7 @@ std::shared_ptr<geometry::PointCloud> ScalableTSDFVolume::ExtractPointCloud() {
363361
pointcloud->normals_.resize(3 * n_total, nanvec);
364362
pointcloud->colors_.resize(3 * n_total, nanvec);
365363
extract_pointcloud_functor func(
366-
impl_->volume_units_, impl_->volume_units_.device_range(),
364+
impl_->volume_units_,
367365
resolution_, voxel_length_, volume_unit_length_, color_type_,
368366
thrust::raw_pointer_cast(pointcloud->points_.data()),
369367
thrust::raw_pointer_cast(pointcloud->normals_.data()),

0 commit comments

Comments
 (0)