OctoMap / octomap

An Efficient Probabilistic 3D Mapping Framework Based on Octrees. Contains the main OctoMap library, the viewer octovis, and dynamicEDT3D.
http://octomap.github.io
1.95k stars 660 forks source link

Multiple errors from latest pull #201

Open garethzeta opened 6 years ago

garethzeta commented 6 years ago

occupancyoctreebase.hxx, line 823, 805, 787 "error assignment within conditional expression", I think missing an extra = on each conditional?

occupancyoctreebase.hxx, line 824, 806, 788 "potential divide by 0", not sure if there are more wasn't sure how to fix

hopefully this helps, unless somehow I downloaded an old copy

ahornung commented 6 years ago

Are these errors from a code analysis tool?

The messages relate to functionality introduced with PR #48 / #49. Any ideas @fmder?

It should be mostly OK, although it could be clearer. I think the assignment in the conditional is a "hidden" test for lineDotNormal==0. That could be made more verbose, and should also be more robust when using an epsilon threshold instead.

garethzeta commented 6 years ago

Hi, Thank you for the quick reply, yeah I can see that it wasn't an error sorry! I just dont know how to get around it, I am using Microsoft visual studio and once i try to build my project I get this output: 1>------ Build started: Project: UE4, Configuration: BuiltWithUnrealBuildTool Win32 ------ 2>------ Build started: Project: AerialRf, Configuration: Development_Editor x64 ------ 2> Compiling game modules for hot reload 2> Parsing headers for AerialRfEditor 2> Running UnrealHeaderTool "C:\Users-----\Documents\Unreal Projects\AerialRf\AerialRf.uproject" "C:\Users-----\Documents\Unreal Projects\AerialRf\Intermediate\Build\Win64\AerialRfEditor\Development\AerialRfEditor.uhtmanifest" -LogCmds="loginit warning, logexit warning, logdatabase error" -Unattended -WarningsAsErrors -installed 2> Reflection code generated for AerialRfEditor in 106.2788616 seconds 2> Performing 3 actions (2 in parallel) 2> RF_Drone.cpp 2>c:\users----\documents\unreal projects\aerialrf\source\octomap\octomap\include\octomap\occupancyoctreebase.hxx(787): error C4706: assignment within conditional expression 2>c:\users----\documents\unreal projects\aerialrf\source\octomap\octomap\include\octomap\occupancyoctreebase.hxx(805): error C4706: assignment within conditional expression 2>c:\users----\documents\unreal projects\aerialrf\source\octomap\octomap\include\octomap\occupancyoctreebase.hxx(823): error C4706: assignment within conditional expression 2>ERROR : UBT error : Failed to produce item: C:\Users----\Documents\Unreal Projects\AerialRf\Binaries\Win64\UE4Editor-AerialRf-8043.dll 2> Total build time: 377.85 seconds (Local executor: 0.00 seconds) 2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets(41,5): error MSB3075: The command ""C:\Program Files (x86)\Epic Games\UE_4.17\Engine\Build\BatchFiles\Build.bat" AerialRfEditor Win64 Development "C:\Users----\Documents\Unreal Projects\AerialRf\AerialRf.uproject" -waitmutex" exited with code 5. Please verify that you have sufficient rights to run this command. ========== Build: 1 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

My project is a simulation of a drone using depth data to find its way through a maze and all the depth data will be saved in the Octomap.

fmder commented 6 years ago

I agree, the implicit test for non-zero is kind of confusing. The comments are all the way up at line 783 which is not the best place. #202 adds those comments.