@@ -91,7 +91,6 @@ void ReactionAnalyzerNode::loadChainModules()
91
91
{
92
92
const auto param_key = std::string (" chain" );
93
93
const auto module_names = this ->list_parameters ({param_key}, 3 ).prefixes ;
94
- // std::cout << module_names.size() << std::endl;
95
94
for (const auto & module_name : module_names) {
96
95
const auto splitted_name = split (module_name, ' .' );
97
96
TopicConfig tmp;
@@ -300,7 +299,6 @@ void ReactionAnalyzerNode::onTimer()
300
299
all_topics_reacted_ = false ;
301
300
const auto brake_start_idx = findFirstBrakeIdx (message->first );
302
301
if (brake_start_idx) {
303
- // std::cout << "found brake idx" <<std::endl;
304
302
mutex_.lock ();
305
303
auto * tmp = std::get_if<ControlBuffer>(&messageBuffers_[key]);
306
304
if (tmp) tmp->second = message->first .at (brake_start_idx.value ());
@@ -444,14 +442,11 @@ void ReactionAnalyzerNode::controlCommandOutputCallback(
444
442
{
445
443
std::lock_guard<std::mutex> lock (mutex_);
446
444
auto & variant = messageBuffers_[node_name];
447
- if (std::holds_alternative<ControlBuffer>(variant)) {
448
- std::get<ControlBuffer>(variant).first .push_back (*msg_ptr);
449
- } else {
445
+ if (!std::holds_alternative<ControlBuffer>(variant)) {
450
446
// If the variant doesn't hold a vector of AckermannControlCommand yet, initialize it
451
447
ControlBuffer buffer (std::vector<AckermannControlCommand>{*msg_ptr}, std::nullopt);
452
448
variant = buffer;
453
449
}
454
- // std::cout << node_name << std::endl;
455
450
setControlCommandToBuffer (std::get<ControlBuffer>(variant).first , *msg_ptr);
456
451
}
457
452
@@ -520,18 +515,12 @@ void ReactionAnalyzerNode::setControlCommandToBuffer(
520
515
itr++;
521
516
}
522
517
}
523
- // std::cout << "buffer size: " << buffer.size() << std::endl;
524
518
buffer.emplace_back (cmd);
525
519
}
526
520
527
521
std::optional<size_t > ReactionAnalyzerNode::findFirstBrakeIdx (
528
522
const std::vector<AckermannControlCommand> & cmd_array)
529
523
{
530
- // for (size_t k = 0; k < cmd_array.size(); ++k) {
531
- // std::cout << cmd_array.at(k).longitudinal.acceleration << " ";
532
- // }
533
- // std::cout << std::endl;
534
-
535
524
if (
536
525
cmd_array.size () < static_cast <size_t >(node_params_.min_number_descending_order_control_cmd ) ||
537
526
!spawn_cmd_time)
@@ -543,8 +532,7 @@ std::optional<size_t> ReactionAnalyzerNode::findFirstBrakeIdx(
543
532
cmd_array.at (cmd_array.size () - node_params_.min_number_descending_order_control_cmd ).stamp ) <
544
533
spawn_cmd_time)
545
534
return {};
546
- std::cout << " searching " << std::endl;
547
- // find the place that acc cmd decreases continuously
535
+
548
536
for (size_t i = 0 ;
549
537
i < cmd_array.size () - node_params_.min_number_descending_order_control_cmd + 1 ; ++i) {
550
538
size_t decreased_cmd_counter = 1 ; // because # of the decreased cmd = iteration + 1
0 commit comments