diff --git a/include/common_robotics_utilities/simple_rrt_planner.hpp b/include/common_robotics_utilities/simple_rrt_planner.hpp index c41a114..9552973 100644 --- a/include/common_robotics_utilities/simple_rrt_planner.hpp +++ b/include/common_robotics_utilities/simple_rrt_planner.hpp @@ -204,7 +204,7 @@ class SimpleRRTPlannerTree }; return serialization::SerializeVectorLike>( - tree.GetNodes(), buffer, element_serializer); + tree.GetNodesImmutable(), buffer, element_serializer); } static serialization::Deserialized> @@ -281,7 +281,7 @@ class SimpleRRTPlannerTree return new_node_index; } - const SimpleRRTPlannerStateVector& GetNodes() const + const SimpleRRTPlannerStateVector& GetNodesImmutable() const { return nodes_; } @@ -1545,7 +1545,7 @@ MakeLinearRRTNearestNeighborsFunction( return distance_fn(candidate_q, sample); }; const auto neighbors = simple_knearest_neighbors::GetKNearestNeighbors( - tree.GetNodes(), sampled, real_distance_fn, 1, use_parallel); + tree.GetNodesImmutable(), sampled, real_distance_fn, 1, use_parallel); if (neighbors.size() > 0) { const auto& nearest_neighbor = neighbors.at(0); @@ -1602,7 +1602,7 @@ MakeKinematicLinearBiRRTNearestNeighborsFunction( return distance_fn(candidate_q, sample); }; const auto neighbors = simple_knearest_neighbors::GetKNearestNeighbors( - tree.GetNodes(), sampled, real_distance_fn, 1, use_parallel); + tree.GetNodesImmutable(), sampled, real_distance_fn, 1, use_parallel); if (neighbors.size() > 0) { const auto& nearest_neighbor = neighbors.at(0);