38 if (phi.rows() !=
static_cast<int>(
dim_))
ThrowNamed(
"Wrong size of phi!");
45 if (phi.rows() !=
static_cast<int>(
dim_))
ThrowNamed(
"Wrong size of phi!");
46 if (J.rows() !=
static_cast<int>(
dim_) || J.cols() !=
scene_->GetKinematicTree().GetNumControlledJoints())
ThrowNamed(
"Wrong size of Jacobian!");
55 if (proxies.size() >
dim_)
WARNING(
"Too many proxies!");
56 int max_dim = std::min(proxies.size(),
dim_);
59 Eigen::MatrixXd J_a(6,
scene_->GetKinematicTree().GetNumControlledJoints()), J_b(6,
scene_->GetKinematicTree().GetNumControlledJoints());
60 for (
int i = 0; i < max_dim; ++i)
75 if (proxy.
e1 !=
nullptr)
82 arel = arel.Identity();
86 if (proxy.
e2 !=
nullptr)
93 brel = brel.Identity();
97 J.row(i) += proxy.
normal1.transpose() * J_a.topRows<3>();
98 J.row(i) -= proxy.
normal1.transpose() * J_b.topRows<3>();
116 if (
dim_ <= 0)
ThrowNamed(
"Dimension needs to be greater than equal to 1, given: " <<
dim_);
CollisionScenePtr cscene_
Eigen::Ref< Eigen::VectorXd > VectorXdRef
std::shared_ptr< Scene > ScenePtr
void AssignScene(ScenePtr scene) override
VariableSizeCollisionDistanceInitializer parameters_
const Eigen::Ref< const Eigen::VectorXd > & VectorXdRefConst
#define HIGHLIGHT_NAMED(name, x)
Eigen::Ref< Eigen::MatrixXd > MatrixXdRef
int TaskSpaceDim() override
REGISTER_TASKMAP_TYPE("VariableSizeCollisionDistance", exotica::VariableSizeCollisionDistance)
void UpdateInternal(Eigen::VectorXdRefConst x, Eigen::VectorXdRef phi, Eigen::MatrixXdRef J, bool updateJacobian=true)
void Update(Eigen::VectorXdRefConst x, Eigen::VectorXdRef phi) override
std::shared_ptr< KinematicElement > e2
std::shared_ptr< KinematicElement > e1