Nav2 Navigation Stack - jazzy
jazzy
ROS 2 Navigation Stack
|
Generates noise trajectories from optimal trajectory. More...
#include <nav2_mppi_controller/include/nav2_mppi_controller/tools/noise_generator.hpp>
Public Member Functions | |
NoiseGenerator ()=default | |
Constructor for mppi::NoiseGenerator. | |
void | initialize (mppi::models::OptimizerSettings &settings, bool is_holonomic, const std::string &name, ParametersHandler *param_handler) |
Initialize noise generator with settings and model types. More... | |
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 iteration. | |
void | setNoisedControls (models::State &state, const models::ControlSequence &control_sequence) |
set noised control_sequence to state controls More... | |
void | reset (mppi::models::OptimizerSettings &settings, bool is_holonomic) |
Reset noise generator with settings and model types. More... | |
Protected Member Functions | |
void | noiseThread () |
Thread to execute noise generation process. | |
void | generateNoisedControls () |
Generate random controls by gaussian noise with mean in control_sequence_. More... | |
Protected Attributes | |
xt::xtensor< float, 2 > | noises_vx_ |
xt::xtensor< float, 2 > | noises_vy_ |
xt::xtensor< float, 2 > | noises_wz_ |
mppi::models::OptimizerSettings | settings_ |
bool | is_holonomic_ |
std::thread | noise_thread_ |
std::condition_variable | noise_cond_ |
std::mutex | noise_lock_ |
bool | active_ {false} |
bool | ready_ {false} |
bool | regenerate_noises_ {false} |
Generates noise trajectories from optimal trajectory.
Definition at line 44 of file noise_generator.hpp.
|
protected |
Generate random controls by gaussian noise with mean in control_sequence_.
Definition at line 107 of file noise_generator.cpp.
Referenced by initialize(), noiseThread(), and reset().
void mppi::NoiseGenerator::initialize | ( | mppi::models::OptimizerSettings & | settings, |
bool | is_holonomic, | ||
const std::string & | name, | ||
ParametersHandler * | param_handler | ||
) |
Initialize noise generator with settings and model types.
settings | Settings of controller |
is_holonomic | If base is holonomic |
name | Namespace for configs |
param_handler | Get parameters util |
Definition at line 26 of file noise_generator.cpp.
References generateNoisedControls(), mppi::ParametersHandler::getParamGetter(), and noiseThread().
void mppi::NoiseGenerator::reset | ( | mppi::models::OptimizerSettings & | settings, |
bool | is_holonomic | ||
) |
Reset noise generator with settings and model types.
settings | Settings of controller |
is_holonomic | If base is holonomic |
Definition at line 76 of file noise_generator.cpp.
References generateNoisedControls().
void mppi::NoiseGenerator::setNoisedControls | ( | models::State & | state, |
const models::ControlSequence & | control_sequence | ||
) |
set noised control_sequence to state controls
Definition at line 65 of file noise_generator.cpp.