15 #ifndef NAV2_MPPI_CONTROLLER__TOOLS__NOISE_GENERATOR_HPP_
16 #define NAV2_MPPI_CONTROLLER__TOOLS__NOISE_GENERATOR_HPP_
18 #include <Eigen/Dense>
24 #include <condition_variable>
27 #include "nav2_ros_common/lifecycle_node.hpp"
28 #include "nav2_mppi_controller/models/optimizer_settings.hpp"
29 #include "nav2_mppi_controller/tools/parameters_handler.hpp"
30 #include "nav2_mppi_controller/models/control_sequence.hpp"
31 #include "nav2_mppi_controller/models/state.hpp"
98 Eigen::ArrayXXf noises_vx_;
99 Eigen::ArrayXXf noises_vy_;
100 Eigen::ArrayXXf noises_wz_;
102 std::default_random_engine generator_;
103 std::normal_distribution<float> ndistribution_vx_;
104 std::normal_distribution<float> ndistribution_wz_;
105 std::normal_distribution<float> ndistribution_vy_;
110 std::thread noise_thread_;
111 std::condition_variable noise_cond_;
112 std::mutex noise_lock_;
113 bool active_{
false}, ready_{
false}, regenerate_noises_{
false};
Generates noise trajectories from optimal trajectory.
NoiseGenerator()=default
Constructor for mppi::NoiseGenerator.
void reset(mppi::models::OptimizerSettings &settings, bool is_holonomic)
Reset noise generator with settings and model types.
void initialize(mppi::models::OptimizerSettings &settings, bool is_holonomic, const std::string &name, ParametersHandler *param_handler)
Initialize noise generator with settings and model types.
void generateNoisedControls()
Generate random controls by gaussian noise with mean in control_sequence_.
void noiseThread()
Thread to execute noise generation process.
void setNoisedControls(models::State &state, const models::ControlSequence &control_sequence)
set noised control_sequence to state controls
void shutdown()
Shutdown noise generator thread.
void generateNextNoises()
Signal to the noise thread the controller is ready to generate a new noised control for the next iter...
Handles getting parameters and dynamic parameter changes.
A control sequence over time (e.g. trajectory)
Settings for the optimizer to use.
State information: velocities, controls, poses, speed.