Skip to content

Commit

Permalink
Merge branch 'master'
Browse files Browse the repository at this point in the history
  • Loading branch information
valgur committed Apr 30, 2023
2 parents 36ff4e1 + 0f066ed commit 4d68d6f
Show file tree
Hide file tree
Showing 50 changed files with 683 additions and 509 deletions.
19 changes: 5 additions & 14 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,11 @@ jobs:
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install CUDA
env:
cuda: "11.2"
run: |
source ./scripts/actions/install_cuda_ubuntu.sh
sudo ln -s /usr/local/cuda-${cuda}/ /usr/local/cuda
if [[ $? -eq 0 ]]; then
# Set paths for subsequent steps, using ${CUDA_PATH}
echo "Adding CUDA to CUDA_PATH, PATH and LD_LIBRARY_PATH"
echo "CUDA_PATH=${CUDA_PATH}" >> $GITHUB_ENV
echo "${CUDA_PATH}/bin" >> $GITHUB_PATH
echo "LD_LIBRARY_PATH=${CUDA_PATH}/lib:${LD_LIBRARY_PATH}" >> $GITHUB_ENV
fi
shell: bash
- name: Install CUDA
uses: Jimver/[email protected]
id: cuda-toolkit
with:
cuda: '11.7.0'
- name: Install dependencies
run: |
./scripts/actions/install_deps_ubuntu.sh
Expand Down
19 changes: 5 additions & 14 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,11 @@ jobs:
run: pip install -U conan

- name: Install CUDA
env:
cuda: ${{ matrix.cuda }}
visual_studio: ${{ matrix.visual_studio }}
shell: powershell
run: |
# Install CUDA via a powershell script
.\scripts\actions\install_cuda_windows.ps1
if ($?) {
# Set paths for subsequent steps, using $env:CUDA_PATH
echo "Adding CUDA to CUDA_PATH, CUDA_PATH_X_Y and PATH"
echo "CUDA_PATH=$env:CUDA_PATH" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "$env:CUDA_PATH_VX_Y=$env:CUDA_PATH" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "$env:CUDA_PATH/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
}
uses: Jimver/[email protected]
id: cuda-toolkit
with:
cuda: '11.7.0'

- name: nvcc check
shell: powershell
run: |
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ if(NOT DEFINED CMAKE_CUDA_ARCHITECTURES)
# Newer but not listed GPUs will JIT compile on launch.
set(CMAKE_CUDA_ARCHITECTURES 61)
endif()
target_compile_features(cupoch_flags INTERFACE cxx_std_14 $<BUILD_INTERFACE:cuda_std_14>)
target_compile_features(cupoch_flags INTERFACE cxx_std_17 $<BUILD_INTERFACE:cuda_std_17>)
target_compile_options(cupoch_flags INTERFACE
"$<$<COMPILE_LANGUAGE:CUDA>:--expt-relaxed-constexpr>"
"$<$<COMPILE_LANGUAGE:CUDA>:--expt-extended-lambda>"
Expand Down
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ This repository is based on [Open3D](https://github.com/intel-isl/Open3D).

## Installation

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

```
Expand Down Expand Up @@ -87,17 +87,16 @@ sudo apt-get install libxinerama-dev libxcursor-dev libglu1-mesa-dev
pip3 install cupoch
```

Or you can compile it from source.
Update your version of cmake if necessary.
Or you can compile it from source. Update your version of cmake if necessary.

```
wget https://github.com/Kitware/CMake/releases/download/v3.16.3/cmake-3.16.3.tar.gz
tar zxvf cmake-3.16.3.tar.gz
cd cmake-3.16.3
wget https://github.com/Kitware/CMake/releases/download/v3.18.4/cmake-3.18.4.tar.gz
tar zxvf cmake-3.18.4.tar.gz
cd cmake-3.18.4
./bootstrap -- -DCMAKE_USE_OPENSSL=OFF
make && sudo make install
cd ..
git clone https://github.com/neka-nat/cupoch.git --recurse
git clone -b jetson_nano https://github.com/neka-nat/cupoch.git --recurse
cd cupoch/
mkdir build
cd build/
Expand Down
2 changes: 1 addition & 1 deletion conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

class CupochConan(ConanFile):
name = "cupoch"
version = "0.2.6"
version = "0.2.7.2"
package_type = "library"

license = "MIT"
Expand Down
20 changes: 20 additions & 0 deletions examples/python/advanced/laserscan_convert.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import cupoch as cph
import numpy as np


if __name__ == "__main__":
# From point cloud demo
pcd = cph.io.read_point_cloud("../../testdata/fragment.ply")
laserscan = cph.geometry.LaserScanBuffer.create_from_point_cloud(pcd, 0.01, 0, 10)
print(laserscan.num_scans)
converted_pcd = cph.geometry.PointCloud.create_from_laserscanbuffer(laserscan, 0.0, 1000.0)
cph.visualization.draw_geometries([pcd, converted_pcd])

# From depth image demo
pinhole_camera_intrinsic = cph.io.read_pinhole_camera_intrinsic("../../testdata/camera_primesense.json")
print(pinhole_camera_intrinsic.intrinsic_matrix)
image = cph.io.read_image("../../testdata/rgbd/depth/00000.png")
pcd = cph.geometry.PointCloud.create_from_depth_image(image, pinhole_camera_intrinsic, depth_scale=1000)
laserscan = cph.geometry.LaserScanBuffer.create_from_depth_image(image, pinhole_camera_intrinsic, 0.01, 0, 10, depth_scale=1000)
converted_pcd = cph.geometry.PointCloud.create_from_laserscanbuffer(laserscan, 0.0, 1000.0)
cph.visualization.draw_geometries([pcd, converted_pcd])
10 changes: 7 additions & 3 deletions examples/python/ros/laserscan.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import numpy as np
import cupoch as cph
import rosbag
import tf.transformations as tftrans
import transformations as tftrans

bagfile = "../../testdata/Mapping1.bag"
bag = rosbag.Bag(bagfile)
Expand Down Expand Up @@ -30,8 +30,12 @@
if not initialize:
scan = cph.geometry.LaserScanBuffer(len(msg.ranges), n_buf, msg.angle_min, msg.angle_max)
initialize = True
if not scan is None:
scan.add_ranges(cph.utility.FloatVector(msg.ranges), trans, cph.utility.FloatVector(msg.intensities))
if scan is not None:
scan.add_host_ranges(
cph.utility.HostFloatVector(msg.ranges),
trans,
cph.utility.HostFloatVector(msg.intensities),
)

if initialize and frame % n_buf == 0:
temp = cph.geometry.PointCloud.create_from_laserscanbuffer(scan, 0.0, 10.0)
Expand Down
47 changes: 47 additions & 0 deletions examples/python/ros/laserscan_msg_convert.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import numpy as np
import cupoch as cph
import rosbag
from sensor_msgs.msg import LaserScan
import transformations as tftrans


bagfile = "../../testdata/Mapping1.bag"
bag = rosbag.Bag(bagfile)
initialize = False
scan = None
trans = np.identity(4)
frame = 0
n_buf = 50
for topic, msg, t in bag.read_messages():
if topic == "/base_pose_ground_truth":
trans = tftrans.quaternion_matrix(
[
msg.pose.pose.orientation.x,
msg.pose.pose.orientation.y,
msg.pose.pose.orientation.z,
msg.pose.pose.orientation.w,
]
)
trans[0:3, 3] = [msg.pose.pose.position.x, msg.pose.pose.position.y, msg.pose.pose.position.z]
frame += 1

if topic == "/base_scan":
if not initialize:
scan = cph.geometry.LaserScanBuffer(len(msg.ranges), n_buf, msg.angle_min, msg.angle_max)
initialize = True
if scan is not None:
scan.add_host_ranges(
cph.utility.HostFloatVector(msg.ranges),
trans,
cph.utility.HostFloatVector(msg.intensities),
)

new_msg = LaserScan()
new_msg.angle_min = scan.min_angle
new_msg.angle_max = scan.max_angle
new_msg.angle_increment = (scan.max_angle - scan.min_angle) / scan.num_steps
new_msg.range_min = 0.0
new_msg.range_max = 10000.0
new_msg.ranges, new_msg.intensities = scan.pop_host_one_scan()
print("------ Original laserscan ------ \n", msg)
print("------ Converted laserscan ------\n", new_msg)
196 changes: 0 additions & 196 deletions scripts/actions/install_cuda_ubuntu.sh

This file was deleted.

Loading

0 comments on commit 4d68d6f

Please sign in to comment.