Skip to content

Commit

Permalink
You can select the half-edge-mesh implementation via the parameter 'h…
Browse files Browse the repository at this point in the history
…em' now. 'pmp' and 'lvr' are implemented.

The old half-edge-mesh can be selected by choosing 'lvr'. The new default half-edge-mesh is 'pmp' since it is more robust to different source meshes. The 'pmp' hem worked also to load all available meshes dynamically.

Cleanup: I removed mesh_client package since it was used nowhere.
  • Loading branch information
amock committed Dec 9, 2024
1 parent 37abc56 commit 1078da7
Show file tree
Hide file tree
Showing 18 changed files with 139 additions and 656 deletions.
7 changes: 7 additions & 0 deletions cvp_mesh_planner/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
cmake_minimum_required(VERSION 3.8)
project(cvp_mesh_planner)

# DEFAULT RELEASE
if (NOT EXISTS ${CMAKE_BINARY_DIR}/CMakeCache.txt)
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "" FORCE)
endif()
endif()

find_package(ament_cmake_ros REQUIRED)
find_package(mbf_mesh_core REQUIRED)
find_package(mbf_msgs REQUIRED)
Expand Down
22 changes: 19 additions & 3 deletions cvp_mesh_planner/src/cvp_mesh_planner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,15 @@ uint32_t CVPMeshPlanner::makePlan(const geometry_msgs::msg::PoseStamped& start,

// mesh_map->combineVertexCosts(); // TODO should be outside the planner

RCLCPP_INFO(node_->get_logger(), "start wave front propagation.");
RCLCPP_DEBUG_STREAM(node_->get_logger(), "start wave front propagation.");

mesh_map::Vector goal_vec = mesh_map::toVector(goal.pose.position);
mesh_map::Vector start_vec = mesh_map::toVector(start.pose.position);

const uint32_t outcome = waveFrontPropagation(goal_vec, start_vec, path, message);

RCLCPP_DEBUG_STREAM(node_->get_logger(), "finished wave front propagation.");

path.reverse();

std_msgs::msg::Header header;
Expand Down Expand Up @@ -649,15 +651,24 @@ uint32_t CVPMeshPlanner::waveFrontPropagation(const mesh_map::Vector& original_s
const auto& vertex_costs = mesh_map_->vertexCosts();
auto& invalid = mesh_map_->invalid;


RCLCPP_DEBUG_STREAM(node_->get_logger(), "BLA.");

mesh_map_->publishDebugPoint(original_start, mesh_map::color(0, 1, 0), "start_point");
mesh_map_->publishDebugPoint(original_goal, mesh_map::color(0, 0, 1), "goal_point");

RCLCPP_DEBUG_STREAM(node_->get_logger(), "published point.");

mesh_map::Vector start = original_start;
mesh_map::Vector goal = original_goal;

RCLCPP_DEBUG_STREAM(node_->get_logger(), "Find face.");

// Find the containing faces of start and goal
const auto& start_opt = mesh_map_->getContainingFace(start, 0.4);
const auto& goal_opt = mesh_map_->getContainingFace(goal, 0.4);
const lvr2::OptionalFaceHandle start_opt = mesh_map_->getContainingFace(start, 0.4);
const lvr2::OptionalFaceHandle goal_opt = mesh_map_->getContainingFace(goal, 0.4);

RCLCPP_DEBUG_STREAM(node_->get_logger(), "BLA 2.");

const auto t_initialization_start = std::chrono::steady_clock::now();

Expand All @@ -666,10 +677,12 @@ uint32_t CVPMeshPlanner::waveFrontPropagation(const mesh_map::Vector& original_s

if (!start_opt) {
message = "Could not find a face close enough to the given start pose";
RCLCPP_WARN_STREAM(node_->get_logger(), "waveFrontPropagation(): " << message);
return mbf_msgs::action::GetPath::Result::INVALID_START;
}
if (!goal_opt) {
message = "Could not find a face close enough to the given goal pose";
RCLCPP_WARN_STREAM(node_->get_logger(), "waveFrontPropagation(): " << message);
return mbf_msgs::action::GetPath::Result::INVALID_GOAL;
}

Expand All @@ -688,6 +701,7 @@ uint32_t CVPMeshPlanner::waveFrontPropagation(const mesh_map::Vector& original_s
// clear vector field map
vector_map_.clear();

RCLCPP_DEBUG_STREAM(node_->get_logger(), "Init distances.");
// initialize distances with infinity
// initialize predecessor of each vertex with itself
for (auto const& vH : mesh->vertices())
Expand Down Expand Up @@ -727,6 +741,8 @@ uint32_t CVPMeshPlanner::waveFrontPropagation(const mesh_map::Vector& original_s
const auto t_wavefront_start = std::chrono::steady_clock::now();
const auto initialization_duration_ms = std::chrono::duration_cast<std::chrono::milliseconds>(t_wavefront_start - t_initialization_start);


RCLCPP_DEBUG_STREAM(node_->get_logger(), "GO.");
while (!pq.isEmpty() && !cancel_planning_)
{
lvr2::VertexHandle current_vh = pq.popMin().key();
Expand Down
7 changes: 7 additions & 0 deletions dijkstra_mesh_planner/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
cmake_minimum_required(VERSION 3.8)
project(dijkstra_mesh_planner)

# DEFAULT RELEASE
if (NOT EXISTS ${CMAKE_BINARY_DIR}/CMakeCache.txt)
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "" FORCE)
endif()
endif()

find_package(ament_cmake_ros REQUIRED)
find_package(mbf_mesh_core REQUIRED)
find_package(mbf_msgs REQUIRED)
Expand Down
6 changes: 6 additions & 0 deletions mbf_mesh_core/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
cmake_minimum_required(VERSION 3.5)
project(mbf_mesh_core)

# DEFAULT RELEASE
if (NOT EXISTS ${CMAKE_BINARY_DIR}/CMakeCache.txt)
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "" FORCE)
endif()
endif()

find_package(ament_cmake_ros REQUIRED)
set(dependencies
Expand Down
7 changes: 7 additions & 0 deletions mbf_mesh_nav/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
endif()

# DEFAULT RELEASE
if (NOT EXISTS ${CMAKE_BINARY_DIR}/CMakeCache.txt)
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "" FORCE)
endif()
endif()

find_package(ament_cmake_ros REQUIRED)
# ROS deps
set(dependencies
Expand Down
15 changes: 0 additions & 15 deletions mesh_client/CHANGELOG.rst

This file was deleted.

50 changes: 0 additions & 50 deletions mesh_client/CMakeLists.txt

This file was deleted.

Empty file removed mesh_client/COLCON_IGNORE
Empty file.
187 changes: 0 additions & 187 deletions mesh_client/include/mesh_client/mesh_client.h

This file was deleted.

Loading

0 comments on commit 1078da7

Please sign in to comment.