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

Fix suppress excessive standard output from canTransform #83

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
1 change: 1 addition & 0 deletions ike_localization/src/ike_localization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ void IkeLocalization::getCurrentRobotPose(geometry_msgs::msg::PoseStamped & curr
while (rclcpp::ok() &&
not tf_buffer_->canTransform(odom_frame_, robot_frame_, tf2::TimePoint())) {
RCLCPP_WARN(get_logger(), "Wait Can Transform");
rclcpp::sleep_for(std::chrono::seconds(1));
}

geometry_msgs::msg::PoseStamped robot_pose;
Expand Down
8 changes: 4 additions & 4 deletions ike_localization/src/mcl/motionModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ void MotionModel::update(
std::vector<Particle> & particles, double current_pose_yaw, double delta_x, double delta_y,
double delta_yaw)
{
std::cerr << "Run MotionModel::update."
<< "\n";
// std::cerr << "Run MotionModel::update."
// << "\n";

double delta_rotate_1, delta_rotate_2, delta_trans;
double delta_rotate_1_hat, delta_rotate_2_hat, delta_trans_hat;
Expand Down Expand Up @@ -68,8 +68,8 @@ void MotionModel::update(
p.pose.euler.yaw = normalizeAngle(p.pose.euler.yaw) + delta_rotate_1_hat + delta_rotate_2_hat;
}

std::cerr << "Done MotionModel::update."
<< "\n";
// std::cerr << "Done MotionModel::update."
// << "\n";
}

double MotionModel::drawNoise(double sigma)
Expand Down
16 changes: 8 additions & 8 deletions ike_localization/src/mcl/observationModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,20 @@ void ObservationModel::initScan(

void ObservationModel::setScan(std::vector<float> & scan_data)
{
std::cerr << "Run ObservationModel::setScan."
<< "\n";
// std::cerr << "Run ObservationModel::setScan."
// << "\n";

scan_.ranges.resize(scan_data.size());
std::copy(std::begin(scan_data), std::end(scan_data), std::begin(scan_.ranges));

std::cerr << "Done ObservationModel::setScan."
<< "\n";
// std::cerr << "Done ObservationModel::setScan."
// << "\n";
}

void ObservationModel::update(std::vector<Particle> & particles, std::vector<float> scan_data)
{
std::cerr << "Run ObservationModel::update."
<< "\n";
// std::cerr << "Run ObservationModel::update."
// << "\n";

setScan(scan_data);

Expand All @@ -67,8 +67,8 @@ void ObservationModel::update(std::vector<Particle> & particles, std::vector<flo

marginal_likelihood_ = sum_score / (particles.size() * scan_.ranges.size());

std::cerr << "Done ObservationModel::update."
<< "\n";
// std::cerr << "Done ObservationModel::update."
// << "\n";
}

double ObservationModel::calculateParticleWeight(const Particle p)
Expand Down
8 changes: 4 additions & 4 deletions ike_localization/src/mcl/resampling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ Resampling::~Resampling(){};

void Resampling::resampling(std::vector<Particle> & particles)
{
std::cerr << "Run Resampling::resampling."
<< "\n";
// std::cerr << "Run Resampling::resampling."
// << "\n";

normalize(particles);
systematicSampling(particles);

std::cerr << "Done Resampling::resampling."
<< "\n";
// std::cerr << "Done Resampling::resampling."
// << "\n";
}

// 詳解 確率ロボティクス p.131
Expand Down
Loading