MCPcopy Create free account
hub / github.com/RoboJackets/software-training / updateParticles

Method updateParticles

localization/src/motion_model.cpp:61–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59}
60
61void MotionModel::updateParticles(
62 std::vector<Particle> & particles,
63 geometry_msgs::msg::Twist::SharedPtr cmd_msg,
64 rclcpp::Time current_time)
65{
66 double dt = current_time.seconds() - last_message_time_.seconds();
67 if (dt > 1.0) {
68 last_message_time_ = current_time;
69 // very small motion can help with convergence
70 dt = 0.01;
71 }
72 for (Particle & particle : particles) {
73 updateParticle(particle, dt, cmd_msg);
74 }
75 last_message_time_ = current_time;
76}
77
78bool MotionModel::getEnabled(const rclcpp::Time & current_time)
79{

Callers 1

CmdCallbackMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected