Receding horizon ergodic trajectory optimization. More...
#include <ergodic_control.hpp>
Public Member Functions | |
void | addStateMemory (const vec &x) |
Add the robot's state to memory. More... | |
void | configTarget (const GridMap &grid) |
Compose target distribution grid and spatial coefficients. More... | |
vec | control (const GridMap &grid, const vec &x) |
Update the control signal. More... | |
ErgodicControl (const ModelT &model, const Collision &collision, double dt, double horizon, double resolution, double exploration_weight, unsigned int num_basis, unsigned int buffer_size, unsigned int batch_size, const mat &Rinv, const vec &umin, const vec &umax) | |
Constructor. More... | |
mat | optTraj () const |
Return optimized trajectory. More... | |
nav_msgs::Path | path (const std::string &map_frame_id) const |
Return optimized trajectory. More... | |
void | setTarget (const Target &target) |
Set the target distribution. More... | |
double | timeStep () const |
return time step More... | |
Private Member Functions | |
mat | gradBarrier (const mat &xt) |
Gradient of the barrier function. More... | |
mat | gradErgodicMetric (const vec &ck, const mat &xt) |
Compose the gradient of the ergodic metric. More... | |
void | updateControl (const mat &xt, const mat &rhot) |
Update the control signal. More... | |
Private Attributes | |
Basis | basis_ |
ReplayBuffer | buffer_ |
Collision | collision_ |
double | dt_ |
double | expl_weight_ |
double | horizon_ |
vec | map_pos_ |
ModelT | model_ |
vec | phik_ |
vec | pose_ |
double | resolution_ |
CoStateFunc | rhodot_ |
vec | rhoT_ |
mat | Rinv_ |
RungeKutta | rk4_ |
unsigned int | steps_ |
Target | target_ |
vec | umax_ |
vec | umin_ |
mat | ut_ |
Receding horizon ergodic trajectory optimization.
Definition at line 73 of file ergodic_control.hpp.
ergodic_exploration::ErgodicControl< ModelT >::ErgodicControl | ( | const ModelT & | model, |
const Collision & | collision, | ||
double | dt, | ||
double | horizon, | ||
double | resolution, | ||
double | exploration_weight, | ||
unsigned int | num_basis, | ||
unsigned int | buffer_size, | ||
unsigned int | batch_size, | ||
const mat & | Rinv, | ||
const vec & | umin, | ||
const vec & | umax | ||
) |
Constructor.
model | - robot's dynamic model |
collision | - collision detector |
dt | - time step in integration |
horizon | - control horizon |
resolution | - discretization of target grid |
num_basis | - number of cosine basis functions per dimension |
buffer_size | - number of past states in memory |
batch_size | - number of states sampled from memory |
Rinv | - inverse of a positive definite matrix that penalizes controls |
umin | - body twist lower limits |
umax | - body twist upper limits |
Definition at line 188 of file ergodic_control.hpp.
void ergodic_exploration::ErgodicControl< ModelT >::addStateMemory | ( | const vec & | x | ) |
Add the robot's state to memory.
x | - current state [x, y, theta] |
Definition at line 345 of file ergodic_control.hpp.
void ergodic_exploration::ErgodicControl< ModelT >::configTarget | ( | const GridMap & | grid | ) |
Compose target distribution grid and spatial coefficients.
grid | - grid map |
Updates the spatial coefficients if the map is larger than before
Definition at line 363 of file ergodic_control.hpp.
vec ergodic_exploration::ErgodicControl< ModelT >::control | ( | const GridMap & | grid, |
const vec & | x | ||
) |
Update the control signal.
grid | - grid map |
x | - current state [x, y, theta] |
Definition at line 225 of file ergodic_control.hpp.
|
private |
Gradient of the barrier function.
xt | - forward simulated trajectory in fourier domain |
Updates a matrix conatining the barrier function derivatve for each state in xt. The barrier function tries to keep the robot's predicted trajectory within the fourier domain.
Definition at line 454 of file ergodic_control.hpp.
|
private |
Compose the gradient of the ergodic metric.
ck | - trajectory fourier coefficients |
xt | - forward simulated trajectory in fourier domain |
Updates a matrix containing ergodic metric gradient for each state in xt
Definition at line 419 of file ergodic_control.hpp.
mat ergodic_exploration::ErgodicControl< ModelT >::optTraj |
Return optimized trajectory.
Definition at line 314 of file ergodic_control.hpp.
nav_msgs::Path ergodic_exploration::ErgodicControl< ModelT >::path | ( | const std::string & | map_frame_id | ) | const |
Return optimized trajectory.
Definition at line 320 of file ergodic_control.hpp.
void ergodic_exploration::ErgodicControl< ModelT >::setTarget | ( | const Target & | target | ) |
Set the target distribution.
target | - target distribution |
Definition at line 357 of file ergodic_control.hpp.
double ergodic_exploration::ErgodicControl< ModelT >::timeStep |
return time step
Definition at line 351 of file ergodic_control.hpp.
|
private |
Update the control signal.
xt | - forward simulated trajectory in fourier domain |
rhot | - co-state variable solution |
rhot is assumed to already be sorted from [t0 tf] with t0 at index 0
Definition at line 439 of file ergodic_control.hpp.
|
private |
Definition at line 180 of file ergodic_control.hpp.
|
private |
Definition at line 181 of file ergodic_control.hpp.
|
private |
Definition at line 166 of file ergodic_control.hpp.
|
private |
Definition at line 167 of file ergodic_control.hpp.
|
private |
Definition at line 170 of file ergodic_control.hpp.
|
private |
Definition at line 168 of file ergodic_control.hpp.
|
private |
Definition at line 176 of file ergodic_control.hpp.
|
private |
Definition at line 165 of file ergodic_control.hpp.
|
private |
Definition at line 174 of file ergodic_control.hpp.
|
private |
Definition at line 179 of file ergodic_control.hpp.
|
private |
Definition at line 169 of file ergodic_control.hpp.
|
private |
Definition at line 183 of file ergodic_control.hpp.
|
private |
Definition at line 175 of file ergodic_control.hpp.
|
private |
Definition at line 172 of file ergodic_control.hpp.
|
private |
Definition at line 182 of file ergodic_control.hpp.
|
private |
Definition at line 171 of file ergodic_control.hpp.
|
private |
Definition at line 184 of file ergodic_control.hpp.
|
private |
Definition at line 178 of file ergodic_control.hpp.
|
private |
Definition at line 177 of file ergodic_control.hpp.
|
private |
Definition at line 173 of file ergodic_control.hpp.