Skip to content

Commit 6b05659

Browse files
committed
copilot reviews
Signed-off-by: silanus23 <[email protected]>
1 parent 9bd3527 commit 6b05659

File tree

5 files changed

+9
-6
lines changed

5 files changed

+9
-6
lines changed

nav2_controller/include/nav2_controller/controller_server.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,6 @@ class ControllerServer : public nav2::LifecycleNode
233233
// Dynamic parameters handler
234234
rclcpp::node_interfaces::OnSetParametersCallbackHandle::SharedPtr dyn_params_handler_;
235235
std::mutex dynamic_params_lock_;
236-
std::mutex path_mutex_;
237236

238237
// The controller needs a costmap node
239238
std::shared_ptr<nav2_costmap_2d::Costmap2DROS> costmap_ros_;

nav2_msgs/msg/TrackingError.msg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ float32 tracking_error
55
uint32 last_index
66
float32 cross_product
77
geometry_msgs/PoseStamped robot_pose
8-
float32 distance_to_goal
8+
float32 distance_to_goal

nav2_util/include/nav2_util/geometry_utils.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ inline double cross_product_2d(
254254
const double robot_vec_x = p.x - a.x;
255255
const double robot_vec_y = p.y - a.y;
256256

257-
return (path_vec_x * robot_vec_y) - (path_vec_y * robot_vec_x);
257+
return (path_vec_x * robot_vec_y) - (path_vec_y * robot_vec_x);
258258
}
259259

260260
} // namespace geometry_utils

nav2_util/src/path_utils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ PathSearchResult distance_from_path(
4343
return result;
4444
}
4545

46-
if (start_index >= path.poses.size()) {
46+
if (start_index >= path.poses.size() - 1) {
4747
throw std::invalid_argument(
4848
"Invalid operation: requested start index (" + std::to_string(start_index) +
4949
") is greater than or equal to path size (" + std::to_string(path.poses.size()) +

nav2_util/test/test_path_utils.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,12 @@ class RetracingPathTest : public ::testing::Test
177177
protected:
178178
void SetUp() override
179179
{
180-
for (int i = 0; i <= 10; ++i) {target_path.poses.push_back(createPoseStamped(i, 0.0));}
181-
for (int i = 9; i >= 0; --i) {target_path.poses.push_back(createPoseStamped(i, 0.0));}
180+
for (int i = 0; i <= 10; ++i) {
181+
target_path.poses.push_back(createPoseStamped(i, 0.0));
182+
}
183+
for (int i = 9; i >= 0; --i) {
184+
target_path.poses.push_back(createPoseStamped(i, 0.0));
185+
}
182186
for (int i = 0; i <= 10; ++i) {
183187
robot_trajectory.push_back(createPose(i, 0.5));
184188
}

0 commit comments

Comments
 (0)