File tree Expand file tree Collapse file tree 3 files changed +7
-4
lines changed
include/nav2_mppi_controller Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -119,8 +119,9 @@ class Optimizer
119
119
120
120
/* *
121
121
* @brief Reset the optimization problem to initial conditions
122
+ * @param Whether to reset the constraints to its base values
122
123
*/
123
- void reset ();
124
+ void reset (bool reset_dynamic_speed_limits = true );
124
125
125
126
protected:
126
127
/* *
Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ void MPPIController::deactivate()
71
71
72
72
void MPPIController::reset ()
73
73
{
74
- optimizer_.reset ();
74
+ optimizer_.reset (false /* Don't reset zone-based speed limits between requests */ );
75
75
}
76
76
77
77
geometry_msgs::msg::TwistStamped MPPIController::computeVelocityCommands (
Original file line number Diff line number Diff line change @@ -126,7 +126,7 @@ void Optimizer::setOffset(double controller_frequency)
126
126
}
127
127
}
128
128
129
- void Optimizer::reset ()
129
+ void Optimizer::reset (bool reset_dynamic_speed_limits )
130
130
{
131
131
state_.reset (settings_.batch_size , settings_.time_steps );
132
132
control_sequence_.reset (settings_.time_steps );
@@ -135,7 +135,9 @@ void Optimizer::reset()
135
135
control_history_[2 ] = {0 .0f , 0 .0f , 0 .0f };
136
136
control_history_[3 ] = {0 .0f , 0 .0f , 0 .0f };
137
137
138
- settings_.constraints = settings_.base_constraints ;
138
+ if (reset_dynamic_speed_limits) {
139
+ settings_.constraints = settings_.base_constraints ;
140
+ }
139
141
140
142
costs_ = xt::zeros<float >({settings_.batch_size });
141
143
generated_trajectories_.reset (settings_.batch_size , settings_.time_steps );
You can’t perform that action at this time.
0 commit comments