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

refactor(motion_utils): delete wall marker explicitly #2506

Merged
Show file tree
Hide file tree
Changes from 77 commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
6db801a
delete wall marker in intersection module
kyoichi-sugahara Dec 6, 2022
bc946ed
delete wall marker in stop_line module
kyoichi-sugahara Dec 7, 2022
01ecc29
delete wall marker in blind_spot module
kyoichi-sugahara Dec 7, 2022
5913037
delete wall marker in no_stopping_area
kyoichi-sugahara Dec 7, 2022
ecd8305
delete wall marker in run_out module
kyoichi-sugahara Dec 7, 2022
92407b3
make motion util function to delete wall marker
kyoichi-sugahara Dec 8, 2022
6755b73
add common function
kyoichi-sugahara Dec 13, 2022
9913e0e
temp
kyoichi-sugahara Dec 14, 2022
f810507
fix(default_ad_api): fix autoware state to add wait time (#2407)
isamu-takagi Dec 6, 2022
16e1a42
chore(behaviror_velocity_planner): changed logging level for intersec…
soblin Dec 6, 2022
3970821
fix(tvm_utility): copy test result to CPU (#2414)
ambroise-arm Dec 6, 2022
bd9dfb9
fix(raw_vehicle_cmd_converter): fix column index for map validation (…
mkuri Dec 7, 2022
e0a8ee8
revert(default_ad_api): fix autoware state to add wait time (#2407) (…
isamu-takagi Dec 7, 2022
e074c8a
feat(behavior_path_planner): cut overlapped path (#2451)
purewater0901 Dec 7, 2022
4165aa0
perf(behavior_velocity_planner): remove unnecessary debug data (#2462)
veqcc Dec 7, 2022
c8c0009
docs: update training data for traffic light (#2464)
Mingyu1991 Dec 7, 2022
0a9c77f
feat(motion_utils): add points resample function (#2465)
purewater0901 Dec 7, 2022
254f40c
feat: remove web controller (#2405)
yukkysaito Dec 7, 2022
fd09262
fix(motion_utils): rename sampling function (#2469)
purewater0901 Dec 7, 2022
07c1150
fix: rename `use_external_emergency_stop` to `check_external_emergen…
shmpwk Dec 7, 2022
7d3869b
fix(tier4_autoware_api_launch): add rosbridge_server dependency (#2470)
takayuki5168 Dec 7, 2022
843e126
fix: remove unnecessary DEBUG_INFO declarations (#2457)
kminoda Dec 8, 2022
b9941f0
feat(gyro_odometer): publish twist when both data arrives (#2423)
kminoda Dec 8, 2022
5f5c794
fix(freespace_planning_algorithms): comment out failing tests (#2440)
kosuke55 Dec 8, 2022
43f06b3
feat(behavior_velocity_planner): add velocity factors (#1985)
isamu-takagi Dec 8, 2022
f0da5b2
fix(emergency_handler): fix mrm handling when mrm behavior is none (#…
mkuri Dec 8, 2022
567a569
feat(behavior_velocity_planner): clean walkway module (#2480)
purewater0901 Dec 9, 2022
38c7efe
fix(trajectory_follower): fix mpc trajectory z pos (#2482)
TakaHoribe Dec 9, 2022
117543d
fix(ground-segmentation): recheck gnd cluster pointcloud (#2448)
badai-nguyen Dec 9, 2022
87ae0cd
fix(freespace_planning_algorithms): fix rrtstar can't arrive goal err…
NorahXiong Dec 9, 2022
62b0c38
revert(behavior_path): revert removal of refineGoalFunction (#2340)" …
mitsudome-r Dec 9, 2022
f77b732
fix(behavior_path_planner): minimum distance for lane change (#2413)
zulfaqar-azmi-t4 Dec 12, 2022
2e30e47
fix(behavior_path_planner): lane change candidate resolution (#2426)
zulfaqar-azmi-t4 Dec 12, 2022
fa7398a
chore(simulator_compatibility_test): suppress setuptools warnings (#2…
isamu-takagi Dec 12, 2022
d11d61c
docs(tier4_state_rviz_plugin): update readme (#2475)
isamu-takagi Dec 12, 2022
ab7a07c
feat(trajectory_follower): pub steer converged marker (#2441)
kosuke55 Dec 12, 2022
f59f39d
feat: replace python launch with xml launch for system monitor (#2430)
wep21 Dec 12, 2022
db745f3
refactor(vehicle_cmd_gate): remove old emergency topics (#2403)
isamu-takagi Dec 12, 2022
37c6da5
feat(behavior_path_planner, obstacle_avoidance_planner): add new driv…
purewater0901 Dec 12, 2022
8850808
feat(default_ad_api): split parameters into file (#2488)
isamu-takagi Dec 12, 2022
4a9331c
docs(default_ad_api): add readme (#2491)
isamu-takagi Dec 12, 2022
0946f5d
feat(map_loader): add differential map loading interface (#2417)
kminoda Dec 13, 2022
3c3aac2
feat(behavior_path_planner): change turn signal output timing (#2493)
purewater0901 Dec 13, 2022
4771c86
feat(behavior_path_planner): remove unnecessary code and clean turn s…
purewater0901 Dec 13, 2022
aeacdf8
feat(trajectory_visualizer): update for steer limit, remove tf for po…
TakaHoribe Dec 13, 2022
55b91d3
feat(mission_planner): check goal footprint (#2088)
ismetatabay Dec 13, 2022
8fea2a0
feat(behavior_path_planner): fix overlap checker (#2498)
purewater0901 Dec 14, 2022
1ffe705
fix(behavior_path_planner): fix find nearest function from lateral di…
purewater0901 Dec 14, 2022
7f451e6
fix(behavior_path_planner): fix planner data copy (#2501)
purewater0901 Dec 14, 2022
d90ad2f
refactor(simple_planning_simulator): make function for duplicated cod…
TakaHoribe Dec 14, 2022
64f46df
fix build error
kyoichi-sugahara Dec 14, 2022
a6d39c0
Merge branch 'autowarefoundation:main' into refactor/wall_marker_delete
kyoichi-sugahara Dec 15, 2022
9627051
ci(pre-commit): autofix
pre-commit-ci[bot] Dec 15, 2022
c24d1b0
revert intersection module change
kyoichi-sugahara Dec 19, 2022
c6536be
delete wallmarker in intersection module
kyoichi-sugahara Dec 19, 2022
17aa6e2
compare pose with resample_uitils
kyoichi-sugahara Dec 19, 2022
8ddd140
delete wallmarker in merge_from_private module
kyoichi-sugahara Dec 19, 2022
02dddc3
delete wallmarker in no_stopping_area
kyoichi-sugahara Dec 20, 2022
42f962e
ci(pre-commit): autofix
pre-commit-ci[bot] Dec 20, 2022
6baa97c
add dead line creator
kyoichi-sugahara Dec 20, 2022
7a69f3f
fix base function
kyoichi-sugahara Dec 20, 2022
3f5fa7e
delete wall marker in each module
kyoichi-sugahara Dec 21, 2022
f7b81cb
ci(pre-commit): autofix
pre-commit-ci[bot] Dec 21, 2022
751fc77
Merge branch 'autowarefoundation:main' into refactor/wall_marker_delete
kyoichi-sugahara Dec 22, 2022
a3fd60a
Merge branch 'autowarefoundation:main' into refactor/wall_marker_delete
kyoichi-sugahara Dec 28, 2022
6a5d004
empty gurad
kyoichi-sugahara Dec 28, 2022
6d0990c
ci(pre-commit): autofix
pre-commit-ci[bot] Dec 28, 2022
59e0a74
Merge remote-tracking branch 'mine/main' into refactor/wall_marker_de…
kyoichi-sugahara Jan 10, 2023
3ea68ca
Merge branch 'autowarefoundation:main' into refactor/wall_marker_delete
kyoichi-sugahara Jan 11, 2023
86a12e7
Merge branch 'main' into refactor/wall_marker_delete
kyoichi-sugahara Jan 12, 2023
3998d24
Merge branch 'autowarefoundation:main' into refactor/wall_marker_delete
kyoichi-sugahara Jan 17, 2023
f6eedaa
instantiation wall maeker creator
kyoichi-sugahara Jan 19, 2023
c193652
initialize pointer
kyoichi-sugahara Jan 23, 2023
e348e64
ci(pre-commit): autofix
pre-commit-ci[bot] Jan 23, 2023
ef16608
Merge branch 'autowarefoundation:main' into refactor/wall_marker_delete
kyoichi-sugahara Jan 24, 2023
e8b857f
Merge branch 'main' into refactor/wall_marker_delete
kyoichi-sugahara Jan 24, 2023
0390357
Merge branch 'main' into refactor/wall_marker_delete
kyoichi-sugahara Jan 24, 2023
b3815e5
Merge branch 'main' into refactor/wall_marker_delete
kyoichi-sugahara Jan 25, 2023
8b77ff0
define create_wall_function and delete_wall_function in VirtualWallMa…
kyoichi-sugahara Jan 25, 2023
cc442cb
change instance name
kyoichi-sugahara Jan 25, 2023
09bcba9
ci(pre-commit): autofix
pre-commit-ci[bot] Jan 25, 2023
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
57 changes: 51 additions & 6 deletions common/motion_utils/include/motion_utils/marker/marker_helper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,28 @@
#ifndef MOTION_UTILS__MARKER__MARKER_HELPER_HPP_
#define MOTION_UTILS__MARKER__MARKER_HELPER_HPP_

#include "motion_utils/resample/resample_utils.hpp"
#include "tier4_autoware_utils/tier4_autoware_utils.hpp"

#include <functional>
#include <string>
#include <vector>

namespace motion_utils
{
using geometry_msgs::msg::Pose;

visualization_msgs::msg::MarkerArray createStopVirtualWallMarker(
const geometry_msgs::msg::Pose & pose, const std::string & module_name, const rclcpp::Time & now,
const int32_t id, const double longitudinal_offset = 0.0);
const Pose & pose, const std::string & module_name, const rclcpp::Time & now, const int32_t id,
const double longitudinal_offset = 0.0);

visualization_msgs::msg::MarkerArray createSlowDownVirtualWallMarker(
const geometry_msgs::msg::Pose & pose, const std::string & module_name, const rclcpp::Time & now,
const int32_t id, const double longitudinal_offset = 0.0);
const Pose & pose, const std::string & module_name, const rclcpp::Time & now, const int32_t id,
const double longitudinal_offset = 0.0);

visualization_msgs::msg::MarkerArray createDeadLineVirtualWallMarker(
const geometry_msgs::msg::Pose & pose, const std::string & module_name, const rclcpp::Time & now,
const int32_t id, const double longitudinal_offset = 0.0);
const Pose & pose, const std::string & module_name, const rclcpp::Time & now, const int32_t id,
const double longitudinal_offset = 0.0);

visualization_msgs::msg::MarkerArray createDeletedStopVirtualWallMarker(
const rclcpp::Time & now, const int32_t id);
Expand All @@ -41,6 +46,46 @@ visualization_msgs::msg::MarkerArray createDeletedSlowDownVirtualWallMarker(

visualization_msgs::msg::MarkerArray createDeletedDeadLineVirtualWallMarker(
const rclcpp::Time & now, const int32_t id);

visualization_msgs::msg::MarkerArray createVirtualWallMarkerFromPreviousPoses(
const std::vector<Pose> & stop_poses, const std::vector<Pose> & previous_poses,
const rclcpp::Time & now, int32_t id);

using create_wall_function = std::function<visualization_msgs::msg::MarkerArray(
const geometry_msgs::msg::Pose & pose, const std::string & module_name, const rclcpp::Time & now,
const int32_t id, const double longitudinal_offset)>;

using delete_wall_function =
std::function<visualization_msgs::msg::MarkerArray(const rclcpp::Time & now, const int32_t id)>;

Copy link
Contributor

@soblin soblin Jan 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you define create_wall_function and delete_wall_function in VirtualWallMarkerCreator:

class VirtualWallMarkerCreator {
public:
   using create_wall_function = ...
   using delete_wall_function -= ...
}

to limit the scope of symbol ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

class VirtualWallMarkerCreator
{
public:
virtual ~VirtualWallMarkerCreator() = default;

visualization_msgs::msg::MarkerArray createStopVirtualWallMarker(
const std::vector<Pose> & stop_poses, const std::string & module_name, const rclcpp::Time & now,
int32_t id, const double longitudinal_offset = 0.0);

visualization_msgs::msg::MarkerArray createSlowDownVirtualWallMarker(
const std::vector<Pose> & slow_down_poses, const std::string & module_name,
const rclcpp::Time & now, int32_t id, const double longitudinal_offset = 0.0);

visualization_msgs::msg::MarkerArray createDeadLineVirtualWallMarker(
const std::vector<Pose> & dead_line_poses, const std::string & module_name,
const rclcpp::Time & now, int32_t id, const double longitudinal_offset = 0.0);

private:
visualization_msgs::msg::MarkerArray handleVirtualWallMarker(
const std::vector<Pose> & poses, const std::string & module_name, const rclcpp::Time & now,
int32_t id, create_wall_function function_create_wall_marker,
delete_wall_function function_delete_wall_marker,
std::vector<geometry_msgs::msg::Pose> & previous_poses, const double longitudinal_offset = 0.0);

std::vector<Pose> previous_stop_poses_;
std::vector<Pose> previous_slow_down_poses_;
std::vector<Pose> previous_dead_line_poses_;
};
} // namespace motion_utils

#endif // MOTION_UTILS__MARKER__MARKER_HELPER_HPP_
76 changes: 76 additions & 0 deletions common/motion_utils/src/marker/marker_helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,16 @@

#include <string>

using tier4_autoware_utils::appendMarkerArray;
using tier4_autoware_utils::createDefaultMarker;
using tier4_autoware_utils::createDeletedDefaultMarker;
using tier4_autoware_utils::createMarkerColor;
using tier4_autoware_utils::createMarkerScale;
using visualization_msgs::msg::MarkerArray;

namespace
{

inline visualization_msgs::msg::MarkerArray createVirtualWallMarkerArray(
const geometry_msgs::msg::Pose & vehicle_front_pose, const std::string & module_name,
const std::string & ns_prefix, const rclcpp::Time & now, const int32_t id,
Expand Down Expand Up @@ -128,4 +131,77 @@ visualization_msgs::msg::MarkerArray createDeletedDeadLineVirtualWallMarker(
{
return createDeletedVirtualWallMarkerArray("dead_line_", now, id);
}

visualization_msgs::msg::MarkerArray VirtualWallMarkerCreator::handleVirtualWallMarker(
const std::vector<Pose> & poses, const std::string & module_name, const rclcpp::Time & now,
int32_t id, create_wall_function function_create_wall_marker,
delete_wall_function function_delete_wall_marker,
std::vector<geometry_msgs::msg::Pose> & previous_virtual_wall_poses,
const double longitudinal_offset)
{
size_t id_to_create = id;
size_t id_to_delete = id;
visualization_msgs::msg::MarkerArray wall_marker;

if (poses.size() == 0 || previous_virtual_wall_poses.empty()) {
return wall_marker;
}

for (const auto & p : previous_virtual_wall_poses) {
const bool previous_stop_pose_is_in_stop_pose =
std::any_of(poses.begin(), poses.end(), [&](const geometry_msgs::msg::Pose & elem) {
std::vector<Pose> poses;
poses.push_back(p);
poses.push_back(elem);
return resample_utils::validate_points_duplication(poses);
});

if (!previous_stop_pose_is_in_stop_pose) {
appendMarkerArray(function_delete_wall_marker(now, id_to_delete), &wall_marker, now);
}
id_to_delete++;
}

for (const auto & p : poses) {
appendMarkerArray(
function_create_wall_marker(p, module_name, now, id_to_create++, longitudinal_offset),
&wall_marker);
}
previous_virtual_wall_poses = poses;
return wall_marker;
}

visualization_msgs::msg::MarkerArray VirtualWallMarkerCreator::createStopVirtualWallMarker(
const std::vector<Pose> & stop_poses, const std::string & module_name, const rclcpp::Time & now,
int32_t id, const double longitudinal_offset)
{
create_wall_function f1 = motion_utils::createStopVirtualWallMarker;
delete_wall_function f2 = motion_utils::createDeletedStopVirtualWallMarker;

return handleVirtualWallMarker(
stop_poses, module_name, now, id, f1, f2, previous_stop_poses_, longitudinal_offset);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest creator, deleter instead of f1, f2

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I applied your proposal thanks!


visualization_msgs::msg::MarkerArray VirtualWallMarkerCreator::createSlowDownVirtualWallMarker(
const std::vector<Pose> & slow_down_poses, const std::string & module_name,
const rclcpp::Time & now, int32_t id, const double longitudinal_offset)
{
create_wall_function f1 = motion_utils::createSlowDownVirtualWallMarker;
delete_wall_function f2 = motion_utils::createDeletedSlowDownVirtualWallMarker;

return handleVirtualWallMarker(
slow_down_poses, module_name, now, id, f1, f2, previous_slow_down_poses_, longitudinal_offset);
}

visualization_msgs::msg::MarkerArray VirtualWallMarkerCreator::createDeadLineVirtualWallMarker(
const std::vector<Pose> & dead_line_poses, const std::string & module_name,
const rclcpp::Time & now, int32_t id, const double longitudinal_offset)
{
create_wall_function f1 = motion_utils::createDeadLineVirtualWallMarker;
delete_wall_function f2 = motion_utils::createDeletedDeadLineVirtualWallMarker;

return handleVirtualWallMarker(
dead_line_poses, module_name, now, id, f1, f2, previous_dead_line_poses_, longitudinal_offset);
}

} // namespace motion_utils
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,9 @@ class BlindSpotModule : public SceneModuleInterface

// Debug
mutable DebugData debug_data_;

std::shared_ptr<motion_utils::VirtualWallMarkerCreator> virtual_wall_marker_creator_ =
std::make_shared<motion_utils::VirtualWallMarkerCreator>();
};
} // namespace behavior_velocity_planner

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include <pcl/point_types.h>
#include <pcl_conversions/pcl_conversions.h>

#include <memory>
#include <string>
#include <unordered_map>
#include <utility>
Expand Down Expand Up @@ -174,6 +175,9 @@ class CrosswalkModule : public SceneModuleInterface

// whether ego passed safety_slow_point
bool passed_safety_slow_point_;

std::shared_ptr<motion_utils::VirtualWallMarkerCreator> virtual_wall_marker_creator_crosswalk_ =
std::make_shared<motion_utils::VirtualWallMarkerCreator>();
};
} // namespace behavior_velocity_planner

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include <lanelet2_routing/RoutingGraph.h>
#include <lanelet2_routing/RoutingGraphContainer.h>

#include <memory>
#include <utility>
#include <vector>

Expand Down Expand Up @@ -72,6 +73,9 @@ class WalkwayModule : public SceneModuleInterface

// Debug
DebugData debug_data_;

std::shared_ptr<motion_utils::VirtualWallMarkerCreator> virtual_wall_marker_creator_walkway_ =
std::make_shared<motion_utils::VirtualWallMarkerCreator>();
};
} // namespace behavior_velocity_planner

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ class DetectionAreaModule : public SceneModuleInterface

// Debug
DebugData debug_data_;

std::shared_ptr<motion_utils::VirtualWallMarkerCreator> virtual_wall_marker_creator_ =
std::make_shared<motion_utils::VirtualWallMarkerCreator>();
};
} // namespace behavior_velocity_planner

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#ifndef SCENE_MODULE__INTERSECTION__SCENE_INTERSECTION_HPP_
#define SCENE_MODULE__INTERSECTION__SCENE_INTERSECTION_HPP_

#include <motion_utils/motion_utils.hpp>
#include <rclcpp/rclcpp.hpp>
#include <scene_module/scene_module_interface.hpp>
#include <tier4_autoware_utils/tier4_autoware_utils.hpp>
Expand Down Expand Up @@ -260,6 +261,9 @@ class IntersectionModule : public SceneModuleInterface

// Debug
mutable DebugData debug_data_;

std::shared_ptr<motion_utils::VirtualWallMarkerCreator> virtual_wall_marker_creator_ =
std::make_shared<motion_utils::VirtualWallMarkerCreator>();
};
} // namespace behavior_velocity_planner

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ class MergeFromPrivateRoadModule : public SceneModuleInterface

// Debug
mutable DebugData debug_data_;

std::shared_ptr<motion_utils::VirtualWallMarkerCreator> virtual_wall_marker_creator_ =
std::make_shared<motion_utils::VirtualWallMarkerCreator>();
};
} // namespace behavior_velocity_planner

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,9 @@ class NoStoppingAreaModule : public SceneModuleInterface

// Debug
DebugData debug_data_;

std::shared_ptr<motion_utils::VirtualWallMarkerCreator> virtual_wall_marker_creator_ =
std::make_shared<motion_utils::VirtualWallMarkerCreator>();
};
} // namespace behavior_velocity_planner

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ class OcclusionSpotModule : public SceneModuleInterface

// Debug
mutable DebugData debug_data_;

std::shared_ptr<motion_utils::VirtualWallMarkerCreator> virtual_wall_marker_creator_ =
std::make_shared<motion_utils::VirtualWallMarkerCreator>();
};
} // namespace behavior_velocity_planner

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

#include "scene_module/run_out/dynamic_obstacle.hpp"

#include <memory>
#include <string>
#include <vector>
namespace behavior_velocity_planner
Expand Down Expand Up @@ -130,6 +131,8 @@ class RunOutDebug
DebugValues debug_values_;
AccelReason accel_reason_;
double height_{0};
std::shared_ptr<motion_utils::VirtualWallMarkerCreator> virtual_wall_marker_creator_ =
std::make_shared<motion_utils::VirtualWallMarkerCreator>();
};

} // namespace behavior_velocity_planner
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ class StopLineModule : public SceneModuleInterface

// Debug
DebugData debug_data_;

std::shared_ptr<motion_utils::VirtualWallMarkerCreator> virtual_wall_marker_creator_ =
std::make_shared<motion_utils::VirtualWallMarkerCreator>();
};
} // namespace behavior_velocity_planner

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ class VirtualTrafficLightModule : public SceneModuleInterface
tier4_v2x_msgs::msg::InfrastructureCommand command_;
MapData map_data_;
ModuleData module_data_;
std::shared_ptr<motion_utils::VirtualWallMarkerCreator> virtual_wall_marker_creator_ =
std::make_shared<motion_utils::VirtualWallMarkerCreator>();

void updateInfrastructureCommand();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ visualization_msgs::msg::MarkerArray BlindSpotModule::createVirtualWallMarkerArr

if (!isActivated() && !is_over_pass_judge_line_) {
appendMarkerArray(
motion_utils::createStopVirtualWallMarker(
debug_data_.virtual_wall_pose, "blind_spot", now, module_id_),
virtual_wall_marker_creator_->createStopVirtualWallMarker(
{debug_data_.virtual_wall_pose}, "blind_spot", now, module_id_),
&wall_marker, now);
}
return wall_marker;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,17 +223,26 @@ visualization_msgs::msg::MarkerArray CrosswalkModule::createVirtualWallMarkerArr
{
const auto now = this->clock_->now();
auto id = module_id_;
std::vector<Pose> stop_poses;
std::vector<Pose> slow_down_poses;

visualization_msgs::msg::MarkerArray wall_marker;
for (const auto & p : debug_data_.stop_poses) {
const auto p_front = calcOffsetPose(p, debug_data_.base_link2front, 0.0, 0.0);
appendMarkerArray(createStopVirtualWallMarker(p_front, "crosswalk", now, id++), &wall_marker);
stop_poses.push_back(p_front);
}
appendMarkerArray(
virtual_wall_marker_creator_crosswalk_->createStopVirtualWallMarker(
stop_poses, "crosswalk", now, id),
&wall_marker);
for (const auto & p : debug_data_.slow_poses) {
const auto p_front = calcOffsetPose(p, debug_data_.base_link2front, 0.0, 0.0);
appendMarkerArray(
createSlowDownVirtualWallMarker(p_front, "crosswalk", now, id++), &wall_marker);
slow_down_poses.push_back(p_front);
}
appendMarkerArray(
virtual_wall_marker_creator_crosswalk_->createSlowDownVirtualWallMarker(
slow_down_poses, "crosswalk", now, id),
&wall_marker);

return wall_marker;
}
Expand All @@ -242,12 +251,17 @@ visualization_msgs::msg::MarkerArray WalkwayModule::createVirtualWallMarkerArray
{
const auto now = this->clock_->now();
auto id = module_id_;
std::vector<Pose> stop_poses;

visualization_msgs::msg::MarkerArray wall_marker;
for (const auto & p : debug_data_.stop_poses) {
const auto p_front = calcOffsetPose(p, debug_data_.base_link2front, 0.0, 0.0);
appendMarkerArray(createStopVirtualWallMarker(p_front, "walkway", now, id++), &wall_marker);
stop_poses.push_back(p_front);
}
appendMarkerArray(
virtual_wall_marker_creator_walkway_->createStopVirtualWallMarker(
stop_poses, "walkway", now, id),
&wall_marker);
return wall_marker;
}

Expand Down
Loading