46 std::vector<double> bounds;
47 auto joint_limits =
scene_->GetKinematicTree().GetJointLimits();
50 for (
unsigned int i = 0; i <
N; ++i)
52 bounds[i] = joint_limits(i, 0);
53 bounds[i +
N] = joint_limits(i, 1);
61 if (
init.Goal.size() ==
N)
65 else if (
init.Goal.size() == 0)
67 goal_ = Eigen::VectorXd::Zero(
N);
71 ThrowNamed(
"Dimension mismatch: problem N=" <<
N <<
", but goal state has dimension " <<
init.Goal.size());
93 if (
compound_ &&
init.FloatingBaseLowerLimits.rows() > 0 &&
init.FloatingBaseUpperLimits.rows() > 0)
97 scene_->GetKinematicTree().SetFloatingBaseLimitsPosXYZEulerZYX(
98 std::vector<double>(
init.FloatingBaseLowerLimits.data(),
init.FloatingBaseLowerLimits.data() +
init.FloatingBaseLowerLimits.size()),
99 std::vector<double>(
init.FloatingBaseUpperLimits.data(),
init.FloatingBaseUpperLimits.data() +
init.FloatingBaseUpperLimits.size()));
103 scene_->GetKinematicTree().SetPlanarBaseLimitsPosXYEulerZ(
104 std::vector<double>(
init.FloatingBaseLowerLimits.data(),
init.FloatingBaseLowerLimits.data() +
init.FloatingBaseLowerLimits.size()),
105 std::vector<double>(
init.FloatingBaseUpperLimits.data(),
init.FloatingBaseUpperLimits.data() +
init.FloatingBaseUpperLimits.size()));
119 for (
int i = 0; i <
tasks_.size(); ++i)
tasks_[i]->is_used =
false;
127 ThrowPretty(
"Dimensionality of goal state wrong: Got " << qT.rows() <<
", expected " <<
N);
142 ThrowPretty(
"Cannot set Goal. Task map '" << task_name <<
"' does not exist.");
156 ThrowPretty(
"Cannot set rho. Task map '" << task_name <<
"' does not exist.");
168 ThrowPretty(
"Cannot get Goal. Task map '" << task_name <<
"' does not exist.");
180 ThrowPretty(
"Cannot get rho. Task map '" << task_name <<
"' does not exist.");
194 ThrowPretty(
"Cannot set Goal. Task map '" << task_name <<
"' does not exist.");
208 ThrowPretty(
"Cannot set rho. Task map '" << task_name <<
"' does not exist.");
220 ThrowPretty(
"Cannot get Goal. Task map '" << task_name <<
"' does not exist.");
232 ThrowPretty(
"Cannot get rho. Task map '" << task_name <<
"' does not exist.");
251 const Eigen::VectorXd
x =
scene_->GetKinematicTree().GetControlledState();
252 const Eigen::MatrixXd bounds =
scene_->GetKinematicTree().GetJointLimits();
253 for (
int i = 0; i <
N; ++i)
255 if (
x(i) < bounds(i, 0) ||
x(i) > bounds(i, 1))
257 if (
debug_)
HIGHLIGHT_NAMED(
"SamplingProblem::IsValid",
"State is out of bounds: joint #" << i <<
": " << bounds(i, 0) <<
" < " <<
x(i) <<
" < " << bounds(i, 1));
268 HIGHLIGHT_NAMED(
"SamplingProblem::IsValid",
"NEQ = " << std::boolalpha << inequality_is_valid <<
", EQ = " << equality_is_valid);
269 if (!equality_is_valid)
273 if (!inequality_is_valid)
279 return (inequality_is_valid && equality_is_valid);