forked from neka-nat/cupoch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
50 changed files
with
683 additions
and
509 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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: | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.