Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
d9735d5
Use final pose orientation at terminal intermediate goal
oscar-lima Oct 10, 2025
f8f79f1
Include PoseStamped definition in header
oscar-lima Oct 10, 2025
522a67c
Hold intermediate goal until within yaw tolerance
oscar-lima Oct 11, 2025
5812cec
Guard articulation vertices from jump-ahead selection
oscar-lima Oct 11, 2025
77985e6
Prevent articulation forcing from regressing
oscar-lima Oct 12, 2025
c8a32d2
Publish articulation debug point cloud
oscar-lima Oct 12, 2025
15e0c77
Hold intermediate goals until fully reached
oscar-lima Oct 12, 2025
4d26e39
Align final goal selection with global tolerances
oscar-lima Oct 12, 2025
a76330c
Ensure skipped articulations are recovered
oscar-lima Oct 12, 2025
b9bcf7d
Visualize intermediate goal tolerance
oscar-lima Oct 12, 2025
57b58a1
Scale tolerance marker with local goal tolerance
oscar-lima Oct 12, 2025
256949c
enforce intermediate goals in articulatiions
oscar-lima Oct 12, 2025
e885784
add initial base rotational path alignment before starting to move li…
oscar-lima Oct 12, 2025
3d3b54e
add missing lines of code on path progress
oscar-lima Oct 12, 2025
800382f
merge intermediate goals and articulation goals
oscar-lima Oct 12, 2025
1059e6d
bring back initial rotation and prioritize articulation goals over in…
oscar-lima Oct 12, 2025
5073d13
Adjusted the final-goal snapping logic so we only switch to the globa…
oscar-lima Oct 12, 2025
6886d60
prevent goal to steal the intermediate goal and follow the path inste…
oscar-lima Oct 12, 2025
8121278
Added pruning of the global plan to prevent oscillations
oscar-lima Oct 12, 2025
8e8885c
Avoid resetting path progress on timestamp-only plan updates
oscar-lima Oct 12, 2025
acac854
Preserve plan progress when geometry-only replans arrive
oscar-lima Oct 12, 2025
2cebf9d
Tighten orientation handling for path progress
oscar-lima Oct 12, 2025
29ff455
Require yaw alignment when restoring progress
oscar-lima Oct 12, 2025
f92a279
Snap intermediate goals to final pose when nearby
oscar-lima Oct 12, 2025
7d7cf41
Merge pull request #3 from oscar-lima/codex/fix-robot-oscillation-issue
oscar-lima Oct 13, 2025
f017461
Add global plan debug visualization
oscar-lima Oct 13, 2025
d736341
Limit published poses in global plan viz
oscar-lima Oct 13, 2025
701bd4c
Merge pull request #5 from oscar-lima/codex/add-visualization-markers…
oscar-lima Oct 13, 2025
dfb1403
Fix final goal handling in PathProgressCritic window
oscar-lima Oct 13, 2025
0649c4d
Refine PathProgressCritic plan change detection
oscar-lima Oct 13, 2025
412820a
Merge pull request #6 from oscar-lima/codex/fix-final-goal-tolerance-…
oscar-lima Oct 13, 2025
75d0593
Refactor advanced path tracking into dedicated critic
oscar-lima Oct 13, 2025
5d9dde2
Register PathFollowerCritic alias
oscar-lima Oct 13, 2025
79d117a
Add non-namespaced PathFollowerCritic alias
oscar-lima Oct 13, 2025
dbc22d3
use transformed_global_plan instead of SBPLLatticePlanner/plan for gl…
oscar-lima Oct 13, 2025
0b6ce91
Add PathFollower alias and update config
oscar-lima Oct 13, 2025
d9820e9
Remove PathFollower critic aliases
oscar-lima Oct 13, 2025
7c13e90
Align PathFollowerCritic plugin name
oscar-lima Oct 13, 2025
0a00d3c
Merge pull request #7 from oscar-lima/codex/refactor-path_progress-to…
oscar-lima Oct 13, 2025
5a0591b
tune dwb params
oscar-lima Oct 13, 2025
33c5335
Use plan orientation when computing outgoing angle
oscar-lima Oct 13, 2025
e2eb00a
Use plan orientation for intermediate goals
oscar-lima Oct 13, 2025
de7ff1b
Use transformed plan yaw and add spacing control
oscar-lima Oct 14, 2025
e8f2c9c
Honor plan orientation when choosing intermediate goals
oscar-lima Oct 14, 2025
cfe953b
Clamp intermediate goal spacing to articulation-aware window
oscar-lima Oct 14, 2025
ba3a9e1
Merge pull request #8 from oscar-lima/codex/use-orientation-from-tran…
oscar-lima Oct 14, 2025
a5a9727
Remove snap-to-final-goal logic in path follower critic
oscar-lima Oct 14, 2025
8da4943
Merge pull request #9 from oscar-lima/codex/explain-snap-goal-mechani…
oscar-lima Oct 15, 2025
4c1d473
enable RotateToGoal critic, tune xy_goal_tolerance
oscar-lima Oct 16, 2025
ad99596
manual cleanup
oscar-lima Oct 16, 2025
a16bf05
Merge pull request #10 from oscar-lima/cleanup-path-follower
oscar-lima Oct 16, 2025
f91054f
Fix formatting per pre-commit
oscar-lima Oct 20, 2025
e32149b
Merge pull request #11 from oscar-lima/codex/address-pre-commit-feedback
oscar-lima Oct 20, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions mir_dwb_critics/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ include_directories(
add_library(${PROJECT_NAME}
src/path_angle.cpp
src/path_progress.cpp
src/path_follower.cpp
src/path_dist_pruned.cpp
)
add_dependencies(${PROJECT_NAME} ${catkin_EXPORTED_TARGETS})
Expand Down
4 changes: 4 additions & 0 deletions mir_dwb_critics/default_critics.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
<class type="mir_dwb_critics::PathProgressCritic" base_class_type="dwb_local_planner::TrajectoryCritic">
<description>Scores trajectories based on how far along the global path they end up.</description>
</class>
<class name="mir_dwb_critics::PathFollowerCritic" type="mir_dwb_critics::PathFollowerCritic"
base_class_type="dwb_local_planner::TrajectoryCritic">
<description>Close path following behavior with articulation handling and pose alignment logic.</description>
</class>
<class type="mir_dwb_critics::PathAngleCritic" base_class_type="dwb_local_planner::TrajectoryCritic">
<description>Scores trajectories based on the difference between the path's current angle and the trajectory's angle</description>
</class>
Expand Down
129 changes: 129 additions & 0 deletions mir_dwb_critics/include/mir_dwb_critics/path_follower.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
/*
* Software License Agreement (BSD License)
*
* Copyright (c) 2019, DFKI GmbH
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* * Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef MIR_DWB_CRITICS_PATH_FOLLOWER_H_
#define MIR_DWB_CRITICS_PATH_FOLLOWER_H_

#include <dwb_critics/map_grid.h>
#include <geometry_msgs/PoseStamped.h>
#include <sensor_msgs/PointCloud.h>
#include <visualization_msgs/MarkerArray.h>
#include <ros/publisher.h>
#include <ros/time.h>
#include <cstdint>
#include <string>
#include <vector>

namespace mir_dwb_critics
{
/**
* @class PathFollowerCritic
* @brief Calculates an intermediate goal along the global path and scores trajectories on the distance to that goal.
*
* This trajectory critic helps ensure progress along the global path. It
* calculates an intermediate goal that is as far as possible along the global
* path as long as the path continues to move in one direction (+/-
* angle_threshold).
*/
class PathFollowerCritic : public dwb_critics::MapGridCritic
{
public:
bool prepare(const geometry_msgs::Pose2D& pose, const nav_2d_msgs::Twist2D& vel, const geometry_msgs::Pose2D& goal,
const nav_2d_msgs::Path2D& global_plan) override;

void onInit() override;
void reset() override;
double scoreTrajectory(const dwb_msgs::Trajectory2D& traj) override;

protected:
bool getGoalPose(const geometry_msgs::Pose2D& robot_pose, const geometry_msgs::Pose2D& final_goal,
const nav_2d_msgs::Path2D& global_plan, unsigned int& x, unsigned int& y, double& desired_angle);

unsigned int getGoalIndex(const std::vector<geometry_msgs::Pose2D>& plan, unsigned int start_index,
unsigned int last_valid_index, bool plan_tail_is_final_goal, double& desired_angle,
bool& has_forward_direction) const;

bool findNextArticulation(const std::vector<geometry_msgs::Pose2D>& plan, unsigned int start_index,
unsigned int end_index, unsigned int last_valid_index, unsigned int& articulation_index,
double& articulation_yaw, bool& has_forward_direction) const;

bool hasForwardProgress(const std::vector<geometry_msgs::Pose2D>& plan, unsigned int index) const;

bool isPoseReached(const geometry_msgs::Pose2D& robot_pose, const geometry_msgs::Pose2D& goal_pose, double goal_yaw,
double xy_tolerance, double yaw_tolerance) const;

bool isGoalReached(const geometry_msgs::Pose2D& robot_pose, const geometry_msgs::Pose2D& goal_pose,
double goal_yaw) const;

double xy_local_goal_tolerance_;
double yaw_local_goal_tolerance_;
double final_goal_yaw_tolerance_;
double final_goal_xy_tolerance_;
double angle_threshold_;
double articulation_angle_threshold_;
double heading_scale_;
bool enforce_forward_dot_;
bool always_target_articulations_;
unsigned int intermediate_goal_spacing_;
bool initial_alignment_done_;

// Plan change detection to reset internal state on new global plans
bool have_last_plan_;
size_t last_plan_size_;
geometry_msgs::Pose2D last_plan_end_pose_;
std::string last_plan_frame_id_;
ros::Time last_plan_stamp_;
uint32_t last_plan_seq_;
geometry_msgs::Pose2D last_plan_start_pose_;
geometry_msgs::Pose2D last_final_goal_pose_;
bool have_last_goal_pose_;

double plan_alignment_position_tolerance_;
double plan_alignment_yaw_tolerance_;

unsigned int last_progress_index_;
bool holding_goal_;
unsigned int held_goal_index_;
geometry_msgs::Pose2D held_goal_pose_;
double hold_position_epsilon_;
double hold_yaw_epsilon_;

std::vector<geometry_msgs::Pose2D> reached_intermediate_goals_;
double desired_angle_;
ros::Publisher intermediate_goal_pub_;
ros::Publisher articulation_points_pub_;
ros::Publisher intermediate_goal_tolerance_pub_;
};

} // namespace mir_dwb_critics
#endif // MIR_DWB_CRITICS_PATH_FOLLOWER_H_
Loading