Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(freespace_planning_algorithms): add is_back flag into the return of A* python wrapper #7831

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@
AstarParam = _fp.AstarParam


class PlannerWaypoint:
def __init__(self, pose, is_back):
self.pose = pose
self.is_back = is_back


class PlannerWaypoints:
def __init__(self):
self.waypoints = []
Expand Down Expand Up @@ -59,6 +65,9 @@ def getWaypoints(self):
for waypoint in waypoints_vector.waypoints:
pos = Point(x=waypoint[0], y=waypoint[1], z=waypoint[2])
quat = Quaternion(x=waypoint[3], y=waypoint[4], z=waypoint[5], w=waypoint[6])
waypoints.waypoints.append(Pose(position=pos, orientation=quat))
is_bask = bool(waypoint[7])
waypoints.waypoints.append(
PlannerWaypoint(Pose(position=pos, orientation=quat), is_bask)
)

return waypoints
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,9 @@
// python-side. So this function returns [*position, *quaternion] as double array
const auto & xyz = waypoint.pose.pose.position;
const auto & quat = waypoint.pose.pose.orientation;
const double & is_back = waypoint.is_back;

Check warning on line 92 in planning/autoware_freespace_planning_algorithms/scripts/bind/astar_search_pybind.cpp

View check run for this annotation

Codecov / codecov/patch

planning/autoware_freespace_planning_algorithms/scripts/bind/astar_search_pybind.cpp#L92

Added line #L92 was not covered by tests
waypoints_vector.waypoints.push_back(
std::vector<double>({xyz.x, xyz.y, xyz.z, quat.x, quat.y, quat.z, quat.w}));
std::vector<double>({xyz.x, xyz.y, xyz.z, quat.x, quat.y, quat.z, quat.w, is_back}));

Check warning on line 94 in planning/autoware_freespace_planning_algorithms/scripts/bind/astar_search_pybind.cpp

View check run for this annotation

Codecov / codecov/patch

planning/autoware_freespace_planning_algorithms/scripts/bind/astar_search_pybind.cpp#L94

Added line #L94 was not covered by tests
}
waypoints_vector.length = waypoints.compute_length();
return waypoints_vector;
Expand Down
Loading