Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
iri_ackermann_local_planner
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
labrobotica
ros
navigation
iri_ackermann_local_planner
Commits
cb5339d4
Commit
cb5339d4
authored
2 years ago
by
Sergi Hernandez
Browse files
Options
Downloads
Patches
Plain Diff
Used the farthest point of the path not outside of the costmap.
parent
3d809d20
No related branches found
No related tags found
1 merge request
!7
Cleaned up the code:
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/ackermann_planner.cpp
+21
-2
21 additions, 2 deletions
src/ackermann_planner.cpp
with
21 additions
and
2 deletions
src/ackermann_planner.cpp
+
21
−
2
View file @
cb5339d4
...
...
@@ -185,7 +185,6 @@ void AckermannPlanner::update_plan_and_local_costs(geometry_msgs::PoseStamped &g
// costs for going away from path
path_costs_
.
setTargetPoses
(
global_plan_
);
// costs for not going towards the local goal as much as possible
goal_costs_
.
setTargetPoses
(
global_plan_
);
...
...
@@ -197,6 +196,9 @@ void AckermannPlanner::update_plan_and_local_costs(geometry_msgs::PoseStamped &g
*/
base_local_planner
::
Trajectory
AckermannPlanner
::
find_best_path
(
geometry_msgs
::
PoseStamped
&
global_pose
,
ackermann_msgs
::
AckermannDrive
&
ackermann
,
geometry_msgs
::
PoseStamped
&
drive_velocities
,
std
::
vector
<
geometry_msgs
::
Point
>
footprint_spec
)
{
unsigned
int
cell_x
,
cell_y
,
path_index
=
global_plan_
.
size
()
-
1
;
geometry_msgs
::
PoseStamped
goal_pose
;
obstacle_costs_
.
setFootprint
(
footprint_spec
);
//make sure that our configuration doesn't change mid-run
...
...
@@ -204,7 +206,24 @@ base_local_planner::Trajectory AckermannPlanner::find_best_path(geometry_msgs::P
Eigen
::
Vector3f
pos
(
global_pose
.
pose
.
position
.
x
,
global_pose
.
pose
.
position
.
y
,
tf
::
getYaw
(
global_pose
.
pose
.
orientation
));
Eigen
::
Vector3f
ack_state
(
ackermann
.
speed
,
ackermann
.
steering_angle
,
ackermann
.
steering_angle_velocity
);
geometry_msgs
::
PoseStamped
goal_pose
=
global_plan_
.
back
();
while
(
!
planner_util_
->
get_costmap
()
->
worldToMap
(
global_plan_
[
path_index
].
pose
.
position
.
x
,
global_plan_
[
path_index
].
pose
.
position
.
y
,
cell_x
,
cell_y
)
&&
path_index
>
0
)
{
if
(
path_index
>
0
)
path_index
--
;
}
if
(
path_index
==
0
)
{
drive_velocities
.
pose
.
position
.
x
=
0
;
drive_velocities
.
pose
.
position
.
y
=
0
;
drive_velocities
.
pose
.
position
.
z
=
0
;
drive_velocities
.
pose
.
orientation
.
w
=
1
;
drive_velocities
.
pose
.
orientation
.
x
=
0
;
drive_velocities
.
pose
.
orientation
.
y
=
0
;
drive_velocities
.
pose
.
orientation
.
z
=
0
;
return
base_local_planner
::
Trajectory
();
}
else
goal_pose
=
global_plan_
[
path_index
];
Eigen
::
Vector3f
goal
(
goal_pose
.
pose
.
position
.
x
,
goal_pose
.
pose
.
position
.
y
,
tf
::
getYaw
(
goal_pose
.
pose
.
orientation
));
// prepare cost functions and generators for this run
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment