grid: The time difference is now initialized to dt_ref for reference trajectory caching

master
Christoph Rösmann 2020-05-21 12:18:31 +02:00 committed by GitHub
parent 0b28d45590
commit aef38d0ccc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -58,6 +58,7 @@ corbo::GridUpdateResult FullDiscretizationGridBaseSE2::update(const Eigen::Vecto
// check if we need to cache the reference trajectory values // TODO(roesmann): we could restrict this to new_run==true only as long as we do not // check if we need to cache the reference trajectory values // TODO(roesmann): we could restrict this to new_run==true only as long as we do not
// have a grid resize... // have a grid resize...
int n = std::max(std::max(getNRef(), getN()), _n_adapt); int n = std::max(std::max(getNRef(), getN()), _n_adapt);
if (_dt.value() <= 0) _dt.value() = _dt_ref; // initialize _dt to _dt_ref in case it has not been optimized before
if (!xref.isCached(getDt(), n, t)) xref.precompute(getDt(), n, t); if (!xref.isCached(getDt(), n, t)) xref.precompute(getDt(), n, t);
if (!uref.isCached(getDt(), n, t)) uref.precompute(getDt(), n, t); if (!uref.isCached(getDt(), n, t)) uref.precompute(getDt(), n, t);
if (sref && !sref->isCached(getDt(), n, t)) sref->precompute(getDt(), n, t); if (sref && !sref->isCached(getDt(), n, t)) sref->precompute(getDt(), n, t);