Skip to content

Commit d05a2c5

Browse files
authored
Merge pull request #53 from csiro-robotics/merge_mains
Merge csiro-internal and csiro-robotics mains
2 parents e830704 + d8dea7d commit d05a2c5

22 files changed

Lines changed: 220 additions & 137 deletions

.devcontainer/Dockerfile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ RUN apt-get update && apt-get upgrade -y && \
2929
# Clone, build and clean up LASzip (3.x supports LAS 1.4 via laszip_api.h C API)
3030
RUN git clone https://github.com/LASzip/LASzip.git && \
3131
cd LASzip && \
32-
git checkout tags/3.4.4 && \
3332
mkdir build && cd build && \
3433
cmake .. -DCMAKE_BUILD_TYPE=Release && \
3534
make -j$(nproc) && \
@@ -39,7 +38,6 @@ RUN git clone https://github.com/LASzip/LASzip.git && \
3938
# Clone, build and clean up Qhull
4039
RUN git clone https://github.com/qhull/qhull.git && \
4140
cd qhull && \
42-
git checkout tags/v7.3.2 && \
4341
cd build && \
4442
cmake .. -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=true && \
4543
make -j$(nproc) && \
@@ -49,7 +47,6 @@ RUN git clone https://github.com/qhull/qhull.git && \
4947
# Clone, build and clean up libnabo
5048
RUN git clone https://github.com/ethz-asl/libnabo.git && \
5149
cd libnabo && \
52-
git checkout tags/1.0.7 && \
5350
mkdir build && cd build && \
5451
cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo && \
5552
make -j$(nproc) && \
@@ -67,4 +64,4 @@ RUN chmod +x /usr/local/bin/compile_install.sh
6764
WORKDIR /workspaces/raycloudtools
6865

6966
# Set the default shell to bash
70-
SHELL ["/bin/bash", "-c"]
67+
SHELL ["/bin/bash", "-c"]

.devcontainer/commands/compile_install.sh

100644100755
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ set -e
55
echo "Building RayCloudTools..."
66
cd /workspaces/raycloudtools
77
mkdir -p build
8-
cd build
8+
cd build
99

1010
# Construct the cmake command
1111
cmake .. \
@@ -41,4 +41,4 @@ make -j"$(nproc)"
4141
make install
4242
ldconfig /usr/local/lib
4343

44-
echo "Build process completed successfully."
44+
echo "Build process completed successfully."

.devcontainer/devcontainer.json

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,30 @@
11
{
2-
"name": "RayCloudTools Development",
3-
"build": {
4-
"dockerfile": "Dockerfile",
5-
"context": ".."
6-
},
7-
"customizations": {
8-
"vscode": {
9-
"extensions": [
10-
"ms-vscode.cpptools",
11-
"ms-vscode.cmake-tools",
12-
"twxs.cmake",
13-
"ms-vscode.cpptools-extension-pack"
14-
]
15-
}
16-
},
17-
"remoteUser": "root",
18-
"forwardPorts": [],
19-
"postCreateCommand": "compile_install.sh",
20-
"runArgs": ["--security-opt", "label=disable"]
21-
}
2+
"name": "RayCloudTools Development",
3+
"build": {
4+
"dockerfile": "Dockerfile",
5+
"context": "..",
6+
"options": [
7+
"--progress=plain"
8+
]
9+
},
10+
"customizations": {
11+
"vscode": {
12+
"extensions": [
13+
"ms-vscode.cpptools",
14+
"ms-vscode.cmake-tools",
15+
"ms-vscode.cpptools-extension-pack"
16+
]
17+
}
18+
},
19+
"mounts": [
20+
"type=bind,source=${localWorkspaceFolder}/.devcontainer/commands/compile_install.sh,target=/usr/local/bin/compile_install.sh",
21+
],
22+
"remoteUser": "root",
23+
"forwardPorts": [],
24+
"postCreateCommand": "compile_install.sh",
25+
"runArgs": [
26+
"--security-opt=label=disable"
27+
],
28+
"workspaceFolder": "/workspaces/raycloudtools",
29+
"workspaceMount": "type=bind,source=${localWorkspaceFolder},target=/workspaces/raycloudtools"
30+
}

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.vscode/
21
.idea/
32
build*/
43
cmake-build*/
4+
treetools/

.vscode/settings.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"editor.formatOnSave": true,
3+
"editor.rulers": [
4+
120
5+
],
6+
"files.trimFinalNewlines": true,
7+
"files.insertFinalNewline": true,
8+
"files.trimTrailingWhitespace": true,
9+
"C_Cpp.default.cppStandard": "c++20",
10+
"C_Cpp.default.cStandard": "c99",
11+
"C_Cpp.default.compileCommands": "${workspaceFolder}/build/compile_commands.json",
12+
"C_Cpp.files.exclude": {
13+
"**/.vscode": true,
14+
"build/**": true,
15+
},
16+
"C_Cpp.exclusionPolicy": "checkFolders",
17+
"[cpp]": {
18+
"editor.defaultFormatter": "ms-vscode.cpptools",
19+
"editor.tabSize": 2
20+
}
21+
}

docker/Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ RUN mkdir -p /deps && \
3434
# Clone, build and clean up LASzip (3.x supports LAS 1.4 via laszip_api.h C API)
3535
RUN git clone https://github.com/LASzip/LASzip.git && \
3636
cd LASzip && \
37-
git checkout tags/3.4.4 && \
3837
mkdir build && cd build && \
3938
cmake .. -DCMAKE_BUILD_TYPE=Release && \
4039
make -j$(nproc) && \
@@ -97,7 +96,7 @@ RUN git clone https://github.com/csiro-robotics/treetools.git && \
9796
make install && \
9897
cd ../.. && \
9998
rm -rf treetools
100-
99+
101100
# Update ldconfig
102101
RUN ldconfig /usr/local/lib
103102

raycloudtools/raydiff/raydiff.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
void usage(int exit_code = 1)
1818
{
1919
// clang-format off
20-
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;
20+
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;
2121
std::cout << "usage (--view / -v to view results):" << std::endl;
2222
std::cout << "raydiff cloud1.ply cloud2.ply" << std::endl;
2323
std::cout << " --distance 0 - optional threshold in m for colouring differences. Default auto-detects distribution shoulder" << std::endl;

raycloudtools/rayimport/rayimport.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,4 +240,4 @@ int main(int argc, char *argv[])
240240
if (save_file != "")
241241
ray::viewFile(save_file);
242242
return res;
243-
}
243+
}

raycloudtools/rayinfo/rayinfo.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ int rayInfo(int argc, char *argv[])
7474
double min_ray_length = std::numeric_limits<double>::max();
7575
double max_ray_length = std::numeric_limits<double>::lowest();
7676
double max_bounded_ray_length = std::numeric_limits<double>::lowest();
77+
double mean_bounded_ray_length = 0.0;
78+
int mean_count = 0;
7779
ray::RGBA min_col(255, 255, 255, 255), max_col(0, 0, 0, 0);
7880
int num_pixels_covered = 0;
7981
const double voxel_width = 0.5;
@@ -125,6 +127,8 @@ int rayInfo(int argc, char *argv[])
125127
if (colours[i].alpha > 0)
126128
{
127129
max_bounded_ray_length = std::max(max_bounded_ray_length, ray_length);
130+
mean_bounded_ray_length += ray_length;
131+
mean_count++;
128132

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

149154
// print the results to screen
150155
std::cout << std::endl;
@@ -196,7 +201,7 @@ int rayInfo(int argc, char *argv[])
196201
std::cout << num_minutes << " mins ";
197202
std::cout << seconds << " s \t(in seconds: " << path_period << ")" << std::endl;
198203
}
199-
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;
204+
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;
200205
std::cout << " colour range (RGBA): \t" << (int)min_col.red << "," << (int)min_col.green << "," << (int)min_col.blue << "," << (int)min_col.alpha << " to " <<
201206
(int)max_col.red << "," << (int)max_col.green << "," << (int)max_col.blue << "," << (int)max_col.alpha << std::endl;
202207

raylib/extraction/rayforest_watershed.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <iostream>
1212
#include <queue>
1313
#include "../rayply.h"
14+
#include "../rayrandom.h"
1415

1516
namespace ray
1617
{
@@ -39,9 +40,9 @@ void Forest::renderWatershed(const std::string &cloud_name_stub, std::vector<Tre
3940
continue;
4041
}
4142
srand(1 + ind);
42-
colour.red = (uint8_t)(rand() % 256);
43-
colour.green = (uint8_t)(rand() % 256);
44-
colour.blue = (uint8_t)(rand() % 256);
43+
colour.red = (uint8_t)(::ray::rand() % 256);
44+
colour.green = (uint8_t)(::ray::rand() % 256);
45+
colour.blue = (uint8_t)(::ray::rand() % 256);
4546
Eigen::Vector3d pos =
4647
min_bounds_ + voxel_width_ * Eigen::Vector3d(0.5 + static_cast<double>(x), 0.5 + static_cast<double>(y), 0);
4748
pos[2] = original_heightfield_(x, y);
@@ -54,10 +55,10 @@ void Forest::renderWatershed(const std::string &cloud_name_stub, std::vector<Tre
5455
for (auto &ind : indices)
5556
{
5657
Eigen::Vector3d tip;
57-
srand(1 + ind);
58-
colour.red = (uint8_t)(rand() % 256);
59-
colour.green = (uint8_t)(rand() % 256);
60-
colour.blue = (uint8_t)(rand() % 256);
58+
::ray::srand(1 + ind);
59+
colour.red = (uint8_t)(::ray::rand() % 256);
60+
colour.green = (uint8_t)(::ray::rand() % 256);
61+
colour.blue = (uint8_t)(::ray::rand() % 256);
6162
if (trees[ind].area < min_area_)
6263
{
6364
continue;

0 commit comments

Comments
 (0)