Skip to content

Commit 4d68d6f

Browse files
committed
Merge branch 'master'
2 parents 36ff4e1 + 0f066ed commit 4d68d6f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+683
-509
lines changed

.github/workflows/ubuntu.yml

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,11 @@ jobs:
2424
uses: actions/setup-python@v1
2525
with:
2626
python-version: ${{ matrix.python-version }}
27-
- name: Install CUDA
28-
env:
29-
cuda: "11.2"
30-
run: |
31-
source ./scripts/actions/install_cuda_ubuntu.sh
32-
sudo ln -s /usr/local/cuda-${cuda}/ /usr/local/cuda
33-
if [[ $? -eq 0 ]]; then
34-
# Set paths for subsequent steps, using ${CUDA_PATH}
35-
echo "Adding CUDA to CUDA_PATH, PATH and LD_LIBRARY_PATH"
36-
echo "CUDA_PATH=${CUDA_PATH}" >> $GITHUB_ENV
37-
echo "${CUDA_PATH}/bin" >> $GITHUB_PATH
38-
echo "LD_LIBRARY_PATH=${CUDA_PATH}/lib:${LD_LIBRARY_PATH}" >> $GITHUB_ENV
39-
fi
40-
shell: bash
27+
- name: Install CUDA
28+
uses: Jimver/[email protected]
29+
id: cuda-toolkit
30+
with:
31+
cuda: '11.7.0'
4132
- name: Install dependencies
4233
run: |
4334
./scripts/actions/install_deps_ubuntu.sh

.github/workflows/windows.yml

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -47,20 +47,11 @@ jobs:
4747
run: pip install -U conan
4848

4949
- name: Install CUDA
50-
env:
51-
cuda: ${{ matrix.cuda }}
52-
visual_studio: ${{ matrix.visual_studio }}
53-
shell: powershell
54-
run: |
55-
# Install CUDA via a powershell script
56-
.\scripts\actions\install_cuda_windows.ps1
57-
if ($?) {
58-
# Set paths for subsequent steps, using $env:CUDA_PATH
59-
echo "Adding CUDA to CUDA_PATH, CUDA_PATH_X_Y and PATH"
60-
echo "CUDA_PATH=$env:CUDA_PATH" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
61-
echo "$env:CUDA_PATH_VX_Y=$env:CUDA_PATH" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
62-
echo "$env:CUDA_PATH/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
63-
}
50+
uses: Jimver/[email protected]
51+
id: cuda-toolkit
52+
with:
53+
cuda: '11.7.0'
54+
6455
- name: nvcc check
6556
shell: powershell
6657
run: |

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ if(NOT DEFINED CMAKE_CUDA_ARCHITECTURES)
136136
# Newer but not listed GPUs will JIT compile on launch.
137137
set(CMAKE_CUDA_ARCHITECTURES 61)
138138
endif()
139-
target_compile_features(cupoch_flags INTERFACE cxx_std_14 $<BUILD_INTERFACE:cuda_std_14>)
139+
target_compile_features(cupoch_flags INTERFACE cxx_std_17 $<BUILD_INTERFACE:cuda_std_17>)
140140
target_compile_options(cupoch_flags INTERFACE
141141
"$<$<COMPILE_LANGUAGE:CUDA>:--expt-relaxed-constexpr>"
142142
"$<$<COMPILE_LANGUAGE:CUDA>:--expt-extended-lambda>"

README.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ This repository is based on [Open3D](https://github.com/intel-isl/Open3D).
5858

5959
## Installation
6060

61-
This library is packaged under 64 Bit Ubuntu Linux 20.04 and CUDA 11.2.
61+
This library is packaged under 64 Bit Ubuntu Linux 20.04 and CUDA 11.7.
6262
You can install cupoch using pip.
6363

6464
```
@@ -87,17 +87,16 @@ sudo apt-get install libxinerama-dev libxcursor-dev libglu1-mesa-dev
8787
pip3 install cupoch
8888
```
8989

90-
Or you can compile it from source.
91-
Update your version of cmake if necessary.
90+
Or you can compile it from source. Update your version of cmake if necessary.
9291

9392
```
94-
wget https://github.com/Kitware/CMake/releases/download/v3.16.3/cmake-3.16.3.tar.gz
95-
tar zxvf cmake-3.16.3.tar.gz
96-
cd cmake-3.16.3
93+
wget https://github.com/Kitware/CMake/releases/download/v3.18.4/cmake-3.18.4.tar.gz
94+
tar zxvf cmake-3.18.4.tar.gz
95+
cd cmake-3.18.4
9796
./bootstrap -- -DCMAKE_USE_OPENSSL=OFF
9897
make && sudo make install
9998
cd ..
100-
git clone https://github.com/neka-nat/cupoch.git --recurse
99+
git clone -b jetson_nano https://github.com/neka-nat/cupoch.git --recurse
101100
cd cupoch/
102101
mkdir build
103102
cd build/

conanfile.py

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

1111
class CupochConan(ConanFile):
1212
name = "cupoch"
13-
version = "0.2.6"
13+
version = "0.2.7.2"
1414
package_type = "library"
1515

1616
license = "MIT"
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import cupoch as cph
2+
import numpy as np
3+
4+
5+
if __name__ == "__main__":
6+
# From point cloud demo
7+
pcd = cph.io.read_point_cloud("../../testdata/fragment.ply")
8+
laserscan = cph.geometry.LaserScanBuffer.create_from_point_cloud(pcd, 0.01, 0, 10)
9+
print(laserscan.num_scans)
10+
converted_pcd = cph.geometry.PointCloud.create_from_laserscanbuffer(laserscan, 0.0, 1000.0)
11+
cph.visualization.draw_geometries([pcd, converted_pcd])
12+
13+
# From depth image demo
14+
pinhole_camera_intrinsic = cph.io.read_pinhole_camera_intrinsic("../../testdata/camera_primesense.json")
15+
print(pinhole_camera_intrinsic.intrinsic_matrix)
16+
image = cph.io.read_image("../../testdata/rgbd/depth/00000.png")
17+
pcd = cph.geometry.PointCloud.create_from_depth_image(image, pinhole_camera_intrinsic, depth_scale=1000)
18+
laserscan = cph.geometry.LaserScanBuffer.create_from_depth_image(image, pinhole_camera_intrinsic, 0.01, 0, 10, depth_scale=1000)
19+
converted_pcd = cph.geometry.PointCloud.create_from_laserscanbuffer(laserscan, 0.0, 1000.0)
20+
cph.visualization.draw_geometries([pcd, converted_pcd])

examples/python/ros/laserscan.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import numpy as np
22
import cupoch as cph
33
import rosbag
4-
import tf.transformations as tftrans
4+
import transformations as tftrans
55

66
bagfile = "../../testdata/Mapping1.bag"
77
bag = rosbag.Bag(bagfile)
@@ -30,8 +30,12 @@
3030
if not initialize:
3131
scan = cph.geometry.LaserScanBuffer(len(msg.ranges), n_buf, msg.angle_min, msg.angle_max)
3232
initialize = True
33-
if not scan is None:
34-
scan.add_ranges(cph.utility.FloatVector(msg.ranges), trans, cph.utility.FloatVector(msg.intensities))
33+
if scan is not None:
34+
scan.add_host_ranges(
35+
cph.utility.HostFloatVector(msg.ranges),
36+
trans,
37+
cph.utility.HostFloatVector(msg.intensities),
38+
)
3539

3640
if initialize and frame % n_buf == 0:
3741
temp = cph.geometry.PointCloud.create_from_laserscanbuffer(scan, 0.0, 10.0)
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import numpy as np
2+
import cupoch as cph
3+
import rosbag
4+
from sensor_msgs.msg import LaserScan
5+
import transformations as tftrans
6+
7+
8+
bagfile = "../../testdata/Mapping1.bag"
9+
bag = rosbag.Bag(bagfile)
10+
initialize = False
11+
scan = None
12+
trans = np.identity(4)
13+
frame = 0
14+
n_buf = 50
15+
for topic, msg, t in bag.read_messages():
16+
if topic == "/base_pose_ground_truth":
17+
trans = tftrans.quaternion_matrix(
18+
[
19+
msg.pose.pose.orientation.x,
20+
msg.pose.pose.orientation.y,
21+
msg.pose.pose.orientation.z,
22+
msg.pose.pose.orientation.w,
23+
]
24+
)
25+
trans[0:3, 3] = [msg.pose.pose.position.x, msg.pose.pose.position.y, msg.pose.pose.position.z]
26+
frame += 1
27+
28+
if topic == "/base_scan":
29+
if not initialize:
30+
scan = cph.geometry.LaserScanBuffer(len(msg.ranges), n_buf, msg.angle_min, msg.angle_max)
31+
initialize = True
32+
if scan is not None:
33+
scan.add_host_ranges(
34+
cph.utility.HostFloatVector(msg.ranges),
35+
trans,
36+
cph.utility.HostFloatVector(msg.intensities),
37+
)
38+
39+
new_msg = LaserScan()
40+
new_msg.angle_min = scan.min_angle
41+
new_msg.angle_max = scan.max_angle
42+
new_msg.angle_increment = (scan.max_angle - scan.min_angle) / scan.num_steps
43+
new_msg.range_min = 0.0
44+
new_msg.range_max = 10000.0
45+
new_msg.ranges, new_msg.intensities = scan.pop_host_one_scan()
46+
print("------ Original laserscan ------ \n", msg)
47+
print("------ Converted laserscan ------\n", new_msg)

scripts/actions/install_cuda_ubuntu.sh

Lines changed: 0 additions & 196 deletions
This file was deleted.

0 commit comments

Comments
 (0)