Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
5c31be1
improved density_rgb to be less extreme in brightness
thomas-lowe Apr 24, 2026
f8cdd44
attempt to make rayrender rgb_density comparible between scans
thomas-lowe May 8, 2026
ab4d45a
support unsigned int ply properties
thomas-lowe May 10, 2026
e9ef09c
Merge remote-tracking branch 'refs/remotes/origin/main'
thomas-lowe May 10, 2026
25aa672
improved raydiff
thomas-lowe May 25, 2026
adeae59
improved raydiff
thomas-lowe May 25, 2026
56e59be
seems to be working
thomas-lowe May 26, 2026
fd029de
tweaked raydiff to produce a combined cloud by default, and exclude i…
thomas-lowe May 26, 2026
4297958
stage 1 complete
thomas-lowe May 26, 2026
09fd885
good
thomas-lowe May 27, 2026
631d63c
working nicely as a proper library function now
thomas-lowe May 27, 2026
a557b57
minor improvements to raydiff
thomas-lowe May 27, 2026
d23ad31
one other
thomas-lowe May 27, 2026
7706cf3
slight colour change to raydiff
thomas-lowe May 27, 2026
539d1e8
made an optional flag across all commands to view the output immediat…
thomas-lowe Jun 5, 2026
cfe625b
improved readme file
thomas-lowe Jun 5, 2026
c2b8bc9
fixed --view not opening on rayimport
thomas-lowe Jun 5, 2026
a470a08
fixed build option bug
thomas-lowe Jun 7, 2026
21a1f10
Merge pull request #57 from csiro-internal/feature/view_all_results
thomas-lowe Jun 8, 2026
c40b753
fixed vis tool bug
thomas-lowe Jun 8, 2026
6e2c312
tweak so raysplit file distance works on trunk-only files
thomas-lowe Jun 8, 2026
f2f2264
Migrate LAS/LAZ I/O from libLAS to LASzip C API
tim-devereux Apr 17, 2026
8594347
Update docs and Docker for LASzip 3.x migration
tim-devereux Apr 17, 2026
6b16e32
fixing weird merge conflicts on git pull
thomas-lowe Jun 11, 2026
83935ec
added mean ray range in rayinfo
thomas-lowe Jun 11, 2026
ce76d4d
Git stores unix permissions.
rodericktaylor Feb 19, 2026
37a1d82
twxs.cmake is deprecated.
rodericktaylor Feb 19, 2026
87d1786
Update changed forest moments in tests.
rodericktaylor Feb 19, 2026
d4acc52
No more std::rand.
rodericktaylor Feb 19, 2026
6cf7fbe
Fix compiler warnings.
rodericktaylor Feb 19, 2026
f0c8531
Auto format on save on vscode.
rodericktaylor Feb 19, 2026
4069049
CMake not happy with old CMake.
rodericktaylor May 29, 2026
3171c06
Suppress more warnings.
rodericktaylor Jun 1, 2026
bedc516
Add treetools to gitignore.
rodericktaylor Jun 1, 2026
15ab968
Unpin some dependency revisions.
rodericktaylor Jun 1, 2026
8237372
Warn if system call in raydiffer fails.
rodericktaylor Jun 1, 2026
5940f54
.devcontainer: Made workspace mount name explicit so that it can be d…
tomniac Jun 12, 2026
968e9e4
Restored changes that were lost when resolving merge conflicts: Copy …
tomniac Jun 12, 2026
d7acc2c
Merge pull request #55 from csiro-internal/bugfix/compiler-warnings
thomas-lowe Jun 12, 2026
f23d0bf
changed raydiff colour to be more different than natural colours
thomas-lowe Jun 16, 2026
d8dea7d
Merge remote-tracking branch 'robotics/main' into merge_mains
tomniac Jul 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ RUN apt-get update && apt-get upgrade -y && \
# Clone, build and clean up LASzip (3.x supports LAS 1.4 via laszip_api.h C API)
RUN git clone https://github.com/LASzip/LASzip.git && \
cd LASzip && \
git checkout tags/3.4.4 && \
mkdir build && cd build && \
cmake .. -DCMAKE_BUILD_TYPE=Release && \
make -j$(nproc) && \
Expand All @@ -39,7 +38,6 @@ RUN git clone https://github.com/LASzip/LASzip.git && \
# Clone, build and clean up Qhull
RUN git clone https://github.com/qhull/qhull.git && \
cd qhull && \
git checkout tags/v7.3.2 && \
cd build && \
cmake .. -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=true && \
make -j$(nproc) && \
Expand All @@ -49,7 +47,6 @@ RUN git clone https://github.com/qhull/qhull.git && \
# Clone, build and clean up libnabo
RUN git clone https://github.com/ethz-asl/libnabo.git && \
cd libnabo && \
git checkout tags/1.0.7 && \
mkdir build && cd build && \
cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo && \
make -j$(nproc) && \
Expand All @@ -67,4 +64,4 @@ RUN chmod +x /usr/local/bin/compile_install.sh
WORKDIR /workspaces/raycloudtools

# Set the default shell to bash
SHELL ["/bin/bash", "-c"]
SHELL ["/bin/bash", "-c"]
4 changes: 2 additions & 2 deletions .devcontainer/commands/compile_install.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -e
echo "Building RayCloudTools..."
cd /workspaces/raycloudtools
mkdir -p build
cd build
cd build

# Construct the cmake command
cmake .. \
Expand Down Expand Up @@ -41,4 +41,4 @@ make -j"$(nproc)"
make install
ldconfig /usr/local/lib

echo "Build process completed successfully."
echo "Build process completed successfully."
49 changes: 29 additions & 20 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,30 @@
{
"name": "RayCloudTools Development",
"build": {
"dockerfile": "Dockerfile",
"context": ".."
},
"customizations": {
"vscode": {
"extensions": [
"ms-vscode.cpptools",
"ms-vscode.cmake-tools",
"twxs.cmake",
"ms-vscode.cpptools-extension-pack"
]
}
},
"remoteUser": "root",
"forwardPorts": [],
"postCreateCommand": "compile_install.sh",
"runArgs": ["--security-opt", "label=disable"]
}
"name": "RayCloudTools Development",
"build": {
"dockerfile": "Dockerfile",
"context": "..",
"options": [
"--progress=plain"
]
},
"customizations": {
"vscode": {
"extensions": [
"ms-vscode.cpptools",
"ms-vscode.cmake-tools",
"ms-vscode.cpptools-extension-pack"
]
}
},
"mounts": [
"type=bind,source=${localWorkspaceFolder}/.devcontainer/commands/compile_install.sh,target=/usr/local/bin/compile_install.sh",
],
"remoteUser": "root",
"forwardPorts": [],
"postCreateCommand": "compile_install.sh",
"runArgs": [
"--security-opt=label=disable"
],
"workspaceFolder": "/workspaces/raycloudtools",
"workspaceMount": "type=bind,source=${localWorkspaceFolder},target=/workspaces/raycloudtools"
}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.vscode/
.idea/
build*/
cmake-build*/
treetools/
21 changes: 21 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"editor.formatOnSave": true,
"editor.rulers": [
120
],
"files.trimFinalNewlines": true,
"files.insertFinalNewline": true,
"files.trimTrailingWhitespace": true,
"C_Cpp.default.cppStandard": "c++20",
"C_Cpp.default.cStandard": "c99",
"C_Cpp.default.compileCommands": "${workspaceFolder}/build/compile_commands.json",
"C_Cpp.files.exclude": {
"**/.vscode": true,
"build/**": true,
},
"C_Cpp.exclusionPolicy": "checkFolders",
"[cpp]": {
"editor.defaultFormatter": "ms-vscode.cpptools",
"editor.tabSize": 2
}
}
3 changes: 1 addition & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ RUN mkdir -p /deps && \
# Clone, build and clean up LASzip (3.x supports LAS 1.4 via laszip_api.h C API)
RUN git clone https://github.com/LASzip/LASzip.git && \
cd LASzip && \
git checkout tags/3.4.4 && \
mkdir build && cd build && \
cmake .. -DCMAKE_BUILD_TYPE=Release && \
make -j$(nproc) && \
Expand Down Expand Up @@ -97,7 +96,7 @@ RUN git clone https://github.com/csiro-robotics/treetools.git && \
make install && \
cd ../.. && \
rm -rf treetools

# Update ldconfig
RUN ldconfig /usr/local/lib

Expand Down
2 changes: 1 addition & 1 deletion raycloudtools/raydiff/raydiff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
void usage(int exit_code = 1)
{
// clang-format off
std::cout << "Difference between two ray clouds output a coloured cloud, cloud1 differences in red, cloud2 differences in green, and similarity printed to screen." << std::endl;
std::cout << "Difference between two ray clouds output a coloured cloud, cloud1 differences in scarlet, cloud2 differences in green/cyan, and similarity printed to screen." << std::endl;
std::cout << "usage (--view / -v to view results):" << std::endl;
std::cout << "raydiff cloud1.ply cloud2.ply" << std::endl;
std::cout << " --distance 0 - optional threshold in m for colouring differences. Default auto-detects distribution shoulder" << std::endl;
Expand Down
2 changes: 1 addition & 1 deletion raycloudtools/rayimport/rayimport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,4 +240,4 @@ int main(int argc, char *argv[])
if (save_file != "")
ray::viewFile(save_file);
return res;
}
}
7 changes: 6 additions & 1 deletion raycloudtools/rayinfo/rayinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ int rayInfo(int argc, char *argv[])
double min_ray_length = std::numeric_limits<double>::max();
double max_ray_length = std::numeric_limits<double>::lowest();
double max_bounded_ray_length = std::numeric_limits<double>::lowest();
double mean_bounded_ray_length = 0.0;
int mean_count = 0;
ray::RGBA min_col(255, 255, 255, 255), max_col(0, 0, 0, 0);
int num_pixels_covered = 0;
const double voxel_width = 0.5;
Expand Down Expand Up @@ -125,6 +127,8 @@ int rayInfo(int argc, char *argv[])
if (colours[i].alpha > 0)
{
max_bounded_ray_length = std::max(max_bounded_ray_length, ray_length);
mean_bounded_ray_length += ray_length;
mean_count++;

min_col.red = std::min(min_col.red, colours[i].red);
min_col.green = std::min(min_col.green, colours[i].green);
Expand All @@ -145,6 +149,7 @@ int rayInfo(int argc, char *argv[])
{
usage();
}
mean_bounded_ray_length /= (double)mean_count;

// print the results to screen
std::cout << std::endl;
Expand Down Expand Up @@ -196,7 +201,7 @@ int rayInfo(int argc, char *argv[])
std::cout << num_minutes << " mins ";
std::cout << seconds << " s \t(in seconds: " << path_period << ")" << std::endl;
}
std::cout << " ray length: \t\t" << min_ray_length << " to " << max_ray_length << " m, max end point ray length: " << max_bounded_ray_length << " m" << std::endl;
std::cout << " ray length: \t\t" << min_ray_length << " to " << max_ray_length << " m, max end point ray length: " << max_bounded_ray_length << " m, mean: " << mean_bounded_ray_length << std::endl;
std::cout << " colour range (RGBA): \t" << (int)min_col.red << "," << (int)min_col.green << "," << (int)min_col.blue << "," << (int)min_col.alpha << " to " <<
(int)max_col.red << "," << (int)max_col.green << "," << (int)max_col.blue << "," << (int)max_col.alpha << std::endl;

Expand Down
15 changes: 8 additions & 7 deletions raylib/extraction/rayforest_watershed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <iostream>
#include <queue>
#include "../rayply.h"
#include "../rayrandom.h"

namespace ray
{
Expand Down Expand Up @@ -39,9 +40,9 @@ void Forest::renderWatershed(const std::string &cloud_name_stub, std::vector<Tre
continue;
}
srand(1 + ind);
colour.red = (uint8_t)(rand() % 256);
colour.green = (uint8_t)(rand() % 256);
colour.blue = (uint8_t)(rand() % 256);
colour.red = (uint8_t)(::ray::rand() % 256);
colour.green = (uint8_t)(::ray::rand() % 256);
colour.blue = (uint8_t)(::ray::rand() % 256);
Eigen::Vector3d pos =
min_bounds_ + voxel_width_ * Eigen::Vector3d(0.5 + static_cast<double>(x), 0.5 + static_cast<double>(y), 0);
pos[2] = original_heightfield_(x, y);
Expand All @@ -54,10 +55,10 @@ void Forest::renderWatershed(const std::string &cloud_name_stub, std::vector<Tre
for (auto &ind : indices)
{
Eigen::Vector3d tip;
srand(1 + ind);
colour.red = (uint8_t)(rand() % 256);
colour.green = (uint8_t)(rand() % 256);
colour.blue = (uint8_t)(rand() % 256);
::ray::srand(1 + ind);
colour.red = (uint8_t)(::ray::rand() % 256);
colour.green = (uint8_t)(::ray::rand() % 256);
colour.blue = (uint8_t)(::ray::rand() % 256);
if (trees[ind].area < min_area_)
{
continue;
Expand Down
2 changes: 1 addition & 1 deletion raylib/extraction/raygrid2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ void RayIndexGrid2D::init(const Eigen::Vector3d &min_bound, const Eigen::Vector3
<< std::endl;

pixels_.resize(dims_[0] * dims_[1]);
memset(&pixels_[0], 0, sizeof(Pixel) * pixels_.size());
std::fill(pixels_.begin(), pixels_.end(), Pixel{});
}

void RayIndexGrid2D::fillRays(const Cloud &cloud)
Expand Down
7 changes: 4 additions & 3 deletions raylib/extraction/rayleaves.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "../rayply.h"
#include "../raymesh.h"
#include "../rayforeststructure.h"
#include "../rayrandom.h"
#define STB_IMAGE_IMPLEMENTATION
#include "raylib/imageread.h"

Expand Down Expand Up @@ -144,10 +145,10 @@ bool generateLeaves(const std::string &cloud_stub, const std::string &trees_file
};
std::vector<Leaf> leaves;
std::vector<double> leaf_counter(grid.voxels().size());
std::srand(1);
::ray::srand(1);
for (size_t i = 0; i<grid.voxels().size(); i++)
{
leaf_counter[i] = (double)(std::rand()%10000) / 10000.0; // a random start stops regions of low density have 0 leaves
leaf_counter[i] = (double)(::ray::rand()%10000) / 10000.0; // a random start stops regions of low density have 0 leaves
}


Expand All @@ -170,7 +171,7 @@ bool generateLeaves(const std::string &cloud_stub, const std::string &trees_file
double num_leaves_d = desired_leaf_area / leaf_area;
double num_points = (double)voxel.numHits();
double &count = leaf_counter[index];
count += num_leaves_d / num_points;
count += num_leaves_d / num_points;
bool add_leaf = false;
if (count >= 1.0)
{
Expand Down
33 changes: 26 additions & 7 deletions raylib/extraction/rayterrain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "../rayply.h"
#include "../rayprogress.h"
#include "../rayprogressthread.h"
#include "../rayrandom.h"

#if RAYLIB_WITH_TBB
#include <tbb/enumerable_thread_specific.h>
Expand Down Expand Up @@ -49,8 +50,8 @@ struct Node
{
num_visits++;
// This checks in a cone rather than just the corner of a cube shape that you would get
// from a raw Pareto front calculation
#define CONE_CHECK
// from a raw Pareto front calculation
#define CONE_CHECK
Vector4d dif = corner - pos;
if (dif == Vector4d(0, 0, 0, 0))
{
Expand Down Expand Up @@ -123,7 +124,7 @@ void constructOctalSpacePartition(std::vector<Node> &nodes, std::vector<Vector4d
int i = 0;
while (points.size() > 0)
{
const int ind = rand() % static_cast<int>(points.size());
const int ind = ::ray::rand() % static_cast<int>(points.size());
nodes[i++].pos = points[ind];
points[ind] = points.back();
points.pop_back();
Expand Down Expand Up @@ -177,7 +178,7 @@ void Terrain::getParetoFront(const std::vector<Vector4d> &points, std::vector<Ve
#if RAYLIB_WITH_TBB
tbb::parallel_for<size_t>(0, nodes.size(), process_rays);
#else
#pragma omp parallel for
#pragma omp parallel for
for (size_t n = 0; n < nodes.size(); n++)
{
process_rays(n);
Expand All @@ -200,7 +201,7 @@ void Terrain::getParetoFront(const std::vector<Vector4d> &points, std::vector<Ve
void Terrain::growUpwards(const std::vector<Eigen::Vector3d> &positions, double gradient)
{
#if RAYLIB_WITH_QHULL
// The idea behind ground extraction is to tilt the upwards vector to the (1,1,1) direction then
// The idea behind ground extraction is to tilt the upwards vector to the (1,1,1) direction then
// find the Pareto front in the three principle axes. https://en.wikipedia.org/wiki/Pareto_front
//
// Efficient Pareto front calculation is based on: Algorithms and Analyses for Maximal Vector Computation. Godfrey
Expand Down Expand Up @@ -255,6 +256,10 @@ void Terrain::growUpwards(const std::vector<Eigen::Vector3d> &positions, double

mesh_.indexList() = hull.mesh().indexList();
mesh_.vertices() = vecs;
#else
RAYLIB_UNUSED(positions);
RAYLIB_UNUSED(gradient);
std::cerr << "growUpwards: extracting terrain requires QHull, see README instructions for installation" << std::endl;
#endif
}

Expand Down Expand Up @@ -349,11 +354,20 @@ void Terrain::growUpwardsFast(const std::vector<Eigen::Vector3d> &ends, double p
std::cout << "size before: " << ends.size() << ", size after: " << points.size() << std::endl;

growUpwards(points, gradient);
#else
RAYLIB_UNUSED(ends);
RAYLIB_UNUSED(pixel_width);
RAYLIB_UNUSED(min_bound);
RAYLIB_UNUSED(max_bound);
RAYLIB_UNUSED(gradient);
std::cerr << "growUpwardsFast: extracting terrain requires QHull, see README instructions for installation"
<< std::endl;
#endif
}

// Convert the @c cloud input to the mesh_ member variable.
void Terrain::extract(const Cloud &cloud, const Eigen::Vector3d &offset, const std::string &file_prefix, double gradient, bool verbose)
// Convert the @c cloud input to the mesh_ member variable.
void Terrain::extract(const Cloud &cloud, const Eigen::Vector3d &offset, const std::string &file_prefix,
double gradient, bool verbose)
{
#if RAYLIB_WITH_QHULL
// preprocessing to make the cloud smaller.
Expand Down Expand Up @@ -386,6 +400,11 @@ void Terrain::extract(const Cloud &cloud, const Eigen::Vector3d &offset, const s
local_cloud.save(file_prefix + "_terrain.ply");
}
#else
RAYLIB_UNUSED(cloud);
RAYLIB_UNUSED(offset);
RAYLIB_UNUSED(file_prefix);
RAYLIB_UNUSED(gradient);
RAYLIB_UNUSED(verbose);
std::cerr << "Error: extracting terrain requires QHull, see README instructions for installation" << std::endl;
#endif
}
Expand Down
8 changes: 5 additions & 3 deletions raylib/extraction/raytrunks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "../raycuboid.h"
#include "../raygrid.h"
#include "../rayply.h"
#include "../rayrandom.h"
#include "raygrid2d.h"

namespace ray
Expand Down Expand Up @@ -652,9 +653,9 @@ void Trunks::saveDebugTrunks(const std::string &filename, bool verbose, const st
for (auto &id : lowest_trunk_ids)
{
const Trunk &trunk = trunks[id];
colour.red = uint8_t(rand() % 255);
colour.green = uint8_t(rand() % 255);
colour.blue = uint8_t(rand() % 255);
colour.red = uint8_t(::ray::rand() % 255);
colour.green = uint8_t(::ray::rand() % 255);
colour.blue = uint8_t(::ray::rand() % 255);

const Eigen::Vector3d side1 = trunk.dir.cross(Eigen::Vector3d(1, 2, 3)).normalized();
const Eigen::Vector3d side2 = side1.cross(trunk.dir);
Expand Down Expand Up @@ -725,6 +726,7 @@ std::vector<std::pair<Eigen::Vector3d, double>> Trunks::load(const std::string &
if (i < 3)
{
base[i] = std::stod(token.c_str());
radius = 0.0;
}
else
{
Expand Down
Loading
Loading