47 PRINT_WARNING(
"MinTimeViaPointsCost::update(): no via_point container specified");
65 assert(n == fd_grid->
getN());
70 _vp_association.resize(n, std::make_pair<std::vector<const teb_local_planner::PoseSE2*>, std::size_t>({}, 0));
79 int start_pose_idx = 0;
88 if (idx > n - 2) idx = n - 2;
97 PRINT_DEBUG(
"TebOptimalPlanner::AddEdgesViaPoints(): skipping a via-point that is close or behind the current robot pose.");
102 _vp_association[idx].first.push_back(&pose);
106 for (
auto& item : _vp_association)
108 if (item.first.size() != item.second)
110 item.second = item.first.size();
111 new_structure =
true;
117 return new_structure;
int findClosestPose(double x_ref, double y_ref, int start_idx=0, double *distance=nullptr) const
Find the closest pose (first part of the state vector) on the grid w.r.t. to a provided reference poi...
#define PRINT_WARNING(msg)
std::vector< std::pair< std::vector< const teb_local_planner::PoseSE2 * >, std::size_t > > _vp_association
double _vp_position_weight
#define PRINT_DEBUG_NAMED(msg)
int getN() const override
get current horizon length
int getNonIntegralStateTermDimension(int k) const override
void computeNonIntegralDtTerm(int k, double dt, Eigen::Ref< Eigen::VectorXd > cost) const override
Full discretization grid specialization for SE2.
double normalize_theta(double theta)
normalize angle to interval [-pi, pi)
std::shared_ptr< StagePreprocessor > Ptr
bool update(int n, double, corbo::ReferenceTrajectoryInterface &, corbo::ReferenceTrajectoryInterface &, corbo::ReferenceTrajectoryInterface *, bool single_dt, const Eigen::VectorXd &x0, corbo::StagePreprocessor::Ptr, const std::vector< double > &, const corbo::DiscretizationGridInterface *grid) override
void computeNonIntegralStateTerm(int k, const Eigen::Ref< const Eigen::VectorXd > &x_k, Eigen::Ref< Eigen::VectorXd > cost) const override
const ViaPointContainer * _via_points
double _vp_orientation_weight