40
40
#include < string>
41
41
#include < vector>
42
42
43
- // set as macro so that calling function name will be printed.
44
- // debug print is heavy. turn on only when debugging.
45
- #define DEBUG_PRINT (...) \
46
- RCLCPP_DEBUG_EXPRESSION (getLogger(), parameters_->print_debug_info, __VA_ARGS__)
47
- #define printShiftLines (p, msg ) DEBUG_PRINT(" [%s] %s" , msg, toStrInfo(p).c_str())
48
-
49
43
namespace behavior_path_planner
50
44
{
51
45
@@ -109,7 +103,7 @@ AvoidanceModule::AvoidanceModule(
109
103
110
104
bool AvoidanceModule::isExecutionRequested () const
111
105
{
112
- DEBUG_PRINT ( " AVOIDANCE isExecutionRequested" );
106
+ RCLCPP_DEBUG ( getLogger (), " AVOIDANCE isExecutionRequested" );
113
107
114
108
// Check ego is in preferred lane
115
109
updateInfoMarker (avoid_data_);
@@ -132,7 +126,11 @@ bool AvoidanceModule::isExecutionRequested() const
132
126
133
127
bool AvoidanceModule::isExecutionReady () const
134
128
{
135
- DEBUG_PRINT (" AVOIDANCE isExecutionReady" );
129
+ RCLCPP_DEBUG_STREAM (getLogger (), " ---Avoidance GO/NO-GO status---" );
130
+ RCLCPP_DEBUG_STREAM (getLogger (), std::boolalpha << " SAFE:" << avoid_data_.safe );
131
+ RCLCPP_DEBUG_STREAM (getLogger (), std::boolalpha << " COMFORTABLE:" << avoid_data_.comfortable );
132
+ RCLCPP_DEBUG_STREAM (getLogger (), std::boolalpha << " VALID:" << avoid_data_.valid );
133
+ RCLCPP_DEBUG_STREAM (getLogger (), std::boolalpha << " READY:" << avoid_data_.ready );
136
134
return avoid_data_.safe && avoid_data_.comfortable && avoid_data_.valid && avoid_data_.ready ;
137
135
}
138
136
@@ -1117,7 +1115,7 @@ void AvoidanceModule::addNewShiftLines(
1117
1115
const auto new_shift_length = front_new_shift_line.end_shift_length ;
1118
1116
const auto new_shift_end_idx = front_new_shift_line.end_idx ;
1119
1117
1120
- DEBUG_PRINT ( " min_start_idx = %lu" , min_start_idx);
1118
+ RCLCPP_DEBUG ( getLogger (), " min_start_idx = %lu" , min_start_idx);
1121
1119
1122
1120
// Remove shift points that starts later than the new_shift_line from path_shifter.
1123
1121
//
@@ -1130,8 +1128,9 @@ void AvoidanceModule::addNewShiftLines(
1130
1128
// farther avoidance.
1131
1129
for (const auto & sl : current_shift_lines) {
1132
1130
if (sl.start_idx >= min_start_idx) {
1133
- DEBUG_PRINT (
1134
- " sl.start_idx = %lu, this sl starts after new proposal. remove this one." , sl.start_idx );
1131
+ RCLCPP_DEBUG (
1132
+ getLogger (), " sl.start_idx = %lu, this sl starts after new proposal. remove this one." ,
1133
+ sl.start_idx );
1135
1134
continue ;
1136
1135
}
1137
1136
@@ -1149,7 +1148,7 @@ void AvoidanceModule::addNewShiftLines(
1149
1148
}
1150
1149
}
1151
1150
1152
- DEBUG_PRINT ( " sl.start_idx = %lu, no conflict. keep this one." , sl.start_idx );
1151
+ RCLCPP_DEBUG ( getLogger (), " sl.start_idx = %lu, no conflict. keep this one." , sl.start_idx );
1153
1152
future.push_back (sl);
1154
1153
}
1155
1154
0 commit comments