Go to the documentation of this file.
41 N =
scene_->GetKinematicTree().GetNumControlledJoints();
57 if (init.LowerBound.rows() ==
N)
59 scene_->GetKinematicTree().SetJointLimitsLower(
init.LowerBound);
61 else if (
init.LowerBound.rows() != 0)
63 ThrowNamed(
"Lower bound size incorrect! Expected " <<
N <<
" got " <<
init.LowerBound.rows());
65 if (
init.UpperBound.rows() ==
N)
67 scene_->GetKinematicTree().SetJointLimitsUpper(
init.UpperBound);
69 else if (
init.UpperBound.rows() != 0)
71 ThrowNamed(
"Lower bound size incorrect! Expected " <<
N <<
" got " <<
init.UpperBound.rows());
89 bool succeeded =
true;
90 auto bounds =
scene_->GetKinematicTree().GetJointLimits();
92 std::cout.precision(4);
95 for (
int t = 0;
t <
T_; ++
t)
100 for (
int i = 0; i <
N; ++i)
105 if (
debug_)
HIGHLIGHT_NAMED(
"TimeIndexedProblem::IsValid",
"State at timestep " <<
t <<
" is out of bounds: joint #" << i <<
": " << bounds(i, 0) <<
" < " <<
x[
t](i) <<
" < " << bounds(i, 1));
134 if (((
x[
t] -
x[
t - 1]).cwiseAbs() -
xdiff_max_).maxCoeff() > 1.e-5)
136 if (
debug_)
HIGHLIGHT_NAMED(
"TimeIndexedProblem::IsValid",
"Violated joint velocity constraints at timestep " <<
t <<
": (" << (
x[
t] -
x[
t - 1]).transpose() <<
"), (limit=" <<
xdiff_max_.transpose() <<
"), violation: (" << ((
x[
t] -
x[
t - 1]).cwiseAbs() -
xdiff_max_).transpose() <<
")");
TimeIndexedProblemInitializer parameters_
std::vector< Eigen::VectorXd > x
Current internal problem state.
double w_scale_
Kinematic system transition error covariance multiplier (constant throughout the trajectory)
Eigen::VectorXd GetEquality() const
Returns the equality constraint values for the entire trajectory.
void Instantiate(const TimeIndexedProblemInitializer &init) override
Instantiates the problem from an Initializer.
bool IsValid() override
Evaluates whether the problem is valid, i.e., all bound and general constraints are satisfied.
Time-indexed problem with bound, joint velocity, and general equality/inequality constraints.
TaskSpaceVector equality_Phi
#define HIGHLIGHT_NAMED(name, x)
int T_
Number of time steps.
Eigen::VectorXd xdiff_max_
Maximum change in the variables in a single timestep tau_. Gets set/updated via SetJointVelocityLimit...
virtual void ReinitializeVariables()
double tau_
Time step duration.
#define REGISTER_PROBLEM_TYPE(TYPE, DERIV)
void SetJointVelocityLimits(const Eigen::VectorXd &qdot_max_in)
Sets the joint velocity limits. Supports N- and 1-dimensional vectors.
TimeIndexedTask equality
General equality task.
virtual void Initialize(const std::vector< exotica::Initializer > &inits, std::shared_ptr< PlanningProblem > prob, TaskSpaceVector &Phi)
TimeIndexedTask cost
Cost task.
virtual Eigen::VectorXd ApplyStartState(bool update_traj=true)
Eigen::VectorXd q_dot_max_
Joint velocity limit (rad/s)
void init(const M_string &remappings)
TimeIndexedTask inequality
General inequality task.
TaskSpaceVector inequality_Phi
Eigen::VectorXd GetInequality() const
Returns the inequality constraint values for the entire trajectory.
geometry_msgs::TransformStamped t
exotica_core
Author(s): Yiming Yang, Michael Camilleri
autogenerated on Fri Aug 2 2024 08:43:02