We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f2aadb1 commit 2b39d36Copy full SHA for 2b39d36
mjpc/planners/sampling/planner.cc
@@ -267,8 +267,13 @@ void SamplingPlanner::AddNoiseToPolicy(int i) {
267
int shift = i * (model->nu * kMaxTrajectoryHorizon);
268
269
// sample noise
270
- for (int k = 0; k < num_parameters; k++) {
271
- noise[k + shift] = absl::Gaussian<double>(gen_, 0.0, noise_exploration);
+ for (int t = 0; t < num_spline_points; t++) {
+ for (int k = 0; k < model->nu; k++) {
272
+ double scale = 0.5 * (model->actuator_ctrlrange[2 * k + 1] -
273
+ model->actuator_ctrlrange[2 * k]);
274
+ noise[shift + t * model->nu + k] =
275
+ absl::Gaussian<double>(gen_, 0.0, scale * noise_exploration);
276
+ }
277
}
278
279
// add noise
0 commit comments