-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Step Type Query #91
Step Type Query #91
Conversation
src/Cinterface/analysis_C.cpp
Outdated
HF::GraphGenerator::GraphParams params; | ||
|
||
//Setup params struct | ||
params.up_step = up_step; params.down_step = down_step; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think these are needed, since the edge validity already exists, we only need to check what type of edge it is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The step types aren't stored anywhere when the graph is generated, so I have to call
dhart/src/Cpp/analysismethods/src/graph_utils.cpp
Lines 303 to 308 in 7587a53
HF::SpatialStructures::STEP CheckConnection( | |
const real3& parent, | |
const real3& child, | |
RayTracer& rt, | |
const GraphParams& params) | |
{ |
which takes these parameters as input. The parameters are actively used in code blocks such as
dhart/src/Cpp/analysismethods/src/graph_utils.cpp
Lines 338 to 345 in 7587a53
if (parent[2] > child[2]) | |
{ | |
node1 = child; | |
node2 = parent; | |
node1[2] = node1[2] + params.down_step; | |
node2[2] = node2[2] + GROUND_OFFSET; | |
s = STEP::DOWN; | |
} |
The workaround I had for this was using default values for these parameters corresponding the the default values in the GraphGenerator
up_step: float = 0.197,
up_slope: float = 20,
down_step: float = 0.197,
down_slope: float = 20,
ground_offset: float = 0.01,
node_z: float = 0.0001,
node_spacing: float = 0.00001
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Disregard my previous comment, I can remove the parameters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the unnecessary parameters and replaced the corresponding UnitTests with more complex ones. My initial PR is updated with any new functions I made.
|
||
def test_step_type_query(): | ||
mesh_path = dhart.get_sample_model("plane.obj") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
plane is probably not the best mesh to test with since it has no steps
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
try to make the graph steps work with obstacle_vistestcase.obj
>>> CalculateAndStoreStepTypes(g, bvh) | ||
|
||
>>> print(g.GetEdgeCost(0, 1, "step_type")) | ||
3.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the documentation needs to clarify what "3" means (i.e. the mapping)
Closes #65
Debug-C
.CalculateStepType
and 'CalculateAndStoreStepType' ingraph_utils
).CalculateAndStoreStepTypes
call the previously mentioned C++ methods, also storing all the step types in the given graph.CalculateAndStoreStepTypes
calls the new C_Interface function to query the step types in the Python interface.CheckConnection
ingraph_utils
that removes theparams
parameter. This is utilized inCalculateStepType
and is allowed because we know that the edges are valid after graph generation.CompareCheckConnection
to test equality between the two overloads forCheckConnection
. OnceCalculateAndStoreStepType(s)
is called, each edge step type found in the resultingstd::vector<EdgeSet>
is tested against the output of the corresponding step type given byCheckConnection
with theparams
parameter. This function's purpose was to simplify the appropriate UnitTests.Attached is a screenshot of all the VS test cases (including three new test cases for the C++ and C_Interface functions, with the exception of
![image](https://private-user-images.githubusercontent.com/109942147/406204722-1593b51a-8b39-437a-94f6-d5fe2ef94570.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyOTc0NzAsIm5iZiI6MTczOTI5NzE3MCwicGF0aCI6Ii8xMDk5NDIxNDcvNDA2MjA0NzIyLTE1OTNiNTFhLThiMzktNDM3YS05NGY2LWQ1ZmUyZWY5NDU3MC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudG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BC49xw69JE52tc)
HFUnitTests/CInterfaceTests/C_Pathfinder/CreateManyPathsPerformanceTest
due to runtime issues) and thetest_GraphGenerator.py
test cases passing.