Skip to content

Commit

Permalink
feat(no_drivable_lane): reflecting refactoring changes of adding new …
Browse files Browse the repository at this point in the history
…framework for virtual walls markers

Signed-off-by: AhmedEbrahim <ahmed.a.d.ebrahim@gmail.com>
  • Loading branch information
ahmeddesokyebrahim committed Jun 6, 2023
1 parent 207eee2 commit 23372a5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
16 changes: 9 additions & 7 deletions planning/behavior_velocity_no_drivable_lane_module/src/debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,22 +70,24 @@ visualization_msgs::msg::MarkerArray createNoDrivableLaneMarkers(
}
} // namespace

visualization_msgs::msg::MarkerArray NoDrivableLaneModule::createVirtualWallMarkerArray()
motion_utils::VirtualWalls NoDrivableLaneModule::createVirtualWalls()
{
visualization_msgs::msg::MarkerArray wall_marker;
motion_utils::VirtualWalls virtual_walls;

const auto now = this->clock_->now();

if (
(state_ == State::APPROACHING) || (state_ == State::INSIDE_NO_DRIVABLE_LANE) ||
(state_ == State::STOPPED)) {
appendMarkerArray(
virtual_wall_marker_creator_->createStopVirtualWallMarker(
{debug_data_.stop_pose}, "no_drivable_lane", now),
&wall_marker, now);
motion_utils::VirtualWall wall;
wall.text = "no_drivable_lane";
wall.style = motion_utils::VirtualWallType::stop;
wall.ns = std::to_string(module_id_) + "_";
wall.pose = debug_data_.stop_pose;
virtual_walls.push_back(wall);
}

return wall_marker;
return virtual_walls;
}

visualization_msgs::msg::MarkerArray NoDrivableLaneModule::createDebugMarkerArray()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class NoDrivableLaneModule : public SceneModuleInterface
bool modifyPathVelocity(PathWithLaneId * path, StopReason * stop_reason) override;

visualization_msgs::msg::MarkerArray createDebugMarkerArray() override;
visualization_msgs::msg::MarkerArray createVirtualWallMarkerArray() override;
motion_utils::VirtualWalls createVirtualWalls() override;

private:
const int64_t lane_id_;
Expand All @@ -78,9 +78,6 @@ class NoDrivableLaneModule : public SceneModuleInterface
geometry_msgs::msg::Point first_intersection_point;
double distance_ego_first_intersection;

std::shared_ptr<motion_utils::VirtualWallMarkerCreator> virtual_wall_marker_creator_ =
std::make_shared<motion_utils::VirtualWallMarkerCreator>();

void handle_init_state();
void handle_approaching_state(PathWithLaneId * path, StopReason * stop_reason);
void handle_inside_no_drivable_lane_state(PathWithLaneId * path, StopReason * stop_reason);
Expand Down

0 comments on commit 23372a5

Please sign in to comment.