Skip to content

Moved the snapping extractor out of the RapidHeightMapManager and to a higher level closer to where its used #796

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

Merged
merged 16 commits into from
May 7, 2025

Conversation

PotatoPeeler3000
Copy link
Contributor

No description provided.

Base automatically changed from cleanup/environment to develop May 5, 2025 21:47
# Conflicts:
#	ihmc-high-level-behaviors/src/main/java/us/ihmc/behaviors/activeMapping/ContinuousHikingProcess.java
activeMappingParameterToolBox = new ActiveMappingParameterToolBox(ros2Node, robotModel, "ForContinuousWalking");
environmentHandler = new EnvironmentHandler();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both of these are happening at the highest level now

@@ -94,14 +94,6 @@ public HeightMapData getLatestHeightMapData()
}
}

public TerrainMapData getLatestTerrainMapData()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not coming from the height map thread anymore

@@ -96,11 +95,6 @@ public HeightMapData getLatestHeightMapData()
return rapidHeightMapThread.getLatestHeightMapData();
}

public TerrainMapData getLatestTerrainMapData()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not happening in the realsense process anymore

@@ -117,8 +114,7 @@ public RapidHeightMapExtractorCUDA(int mode, HeightMapParameters heightMapParame
globalHeightMapImage = new GpuMat(globalCellsPerAxis, globalCellsPerAxis, opencv_core.CV_16UC1);
terrainCostImage = new GpuMat(globalCellsPerAxis, globalCellsPerAxis, opencv_core.CV_8UC1);
contactMapImage = new GpuMat(globalCellsPerAxis, globalCellsPerAxis, opencv_core.CV_8UC1);
sensorCroppedHeightMapImage = new GpuMat(cellsPerAxisCropped, cellsPerAxisCropped, opencv_core.CV_16UC1);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This name was confusing

@@ -149,9 +145,6 @@ private void recomputeDerivedParameters()
globalCenterIndex = HeightMapTools.computeCenterIndex(heightMapParameters.getInternalGlobalWidthInMeters(), heightMapParameters.getCellSizeInMeters());
globalCellsPerAxis = 2 * globalCenterIndex + 1;

terrainCenterIndex = HeightMapTools.computeCenterIndex(heightMapParameters.getTerrainWidthInMeters(), heightMapParameters.getCellSizeInMeters());
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no concept of a terrain map anymore, its just the cropped map

@@ -449,13 +438,8 @@ public int getSequenceNumber()
return sequenceNumber;
}

public GpuMat getTerrainHeightMapImage()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not happening in here any more

@@ -6,14 +6,16 @@
import org.bytedeco.opencv.global.opencv_core;
import org.bytedeco.opencv.opencv_core.GpuMat;
import org.bytedeco.opencv.opencv_core.Mat;
import us.ihmc.euclid.tuple3D.Point3D;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We only need the center of the height map which is a 2D point

@@ -74,13 +74,8 @@
"lowerBound": 1.0,
"upperBound": 4.5
},
"Terrain width in meters": {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got rid of this

@@ -21,13 +24,27 @@ public void testSnappingTerrainKernelRuns()
HeightMapParameters heightMapParameters = new HeightMapParameters();
SnappingTerrainExtractor snappingTerrainExtractor = new SnappingTerrainExtractor(heightMapParameters);

GpuMat fakeHeightMap = new GpuMat(500, 500, opencv_core.CV_16UC1);
GpuMat fakeHeightMap = new GpuMat(401, 401, opencv_core.CV_16UC1);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A little test to make sure the extractor runs

@@ -453,32 +451,6 @@ extern "C" __global__ void croppingKernel(unsigned short *inputMap, size_t pitch
unsigned short *croppedRow = (unsigned short *)((char *)croppedMap + xIndex * pitchCropped);
croppedRow[yIndex] = 0; // Assign 0 for out-of-bounds cells
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only keepin the cropped map now

Copy link
Contributor

@TomaszTB TomaszTB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So can we still run whatever requires the snapping kernel from the autonomy process?

(float) heightMapParameters.getCellSizeInMeters(),
heightMapParameters);
heightMap.close();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@PotatoPeeler3000
Copy link
Contributor Author

So can we still run whatever requires the snapping kernel from the autonomy process?

The only thing that requires the snapping kernel is the footstep planner. But in the way the autonomy process use's the planner its probably not using the snapping kernel.
However, the snapping kernel is still used the same was as before which is for Continuous Hiking, I think that's the only place that uses it.

@PotatoPeeler3000 PotatoPeeler3000 merged commit 69a3853 into develop May 7, 2025
64 of 68 checks passed
@PotatoPeeler3000 PotatoPeeler3000 deleted the cleanup/move-snapping-extractor branch May 7, 2025 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants