- Move existing OndselSolver, GNN ML layer, and tooling into GNN/ directory for integration in later phases - Add Create addon scaffold: package.xml, Init.py - Add expression DAG with eval, symbolic diff, simplification - Add parameter table with fixed/free variable tracking - Add quaternion rotation as polynomial Expr trees - Add RigidBody entity (7 DOF: position + unit quaternion) - Add constraint classes: Coincident, DistancePointPoint, Fixed - Add Newton-Raphson solver with symbolic Jacobian + numpy lstsq - Add pre-solve passes: substitution + single-equation - Add DOF counting via Jacobian SVD rank - Add KindredSolver IKCSolver bridge for kcsolve integration - Add 82 unit tests covering all modules Registers as 'kindred' solver via kcsolve.register_solver() when loaded by Create's addon_loader.
89 lines
2.6 KiB
C++
89 lines
2.6 KiB
C++
/***************************************************************************
|
|
* Copyright (c) 2023 Ondsel, Inc. *
|
|
* *
|
|
* This file is part of OndselSolver. *
|
|
* *
|
|
* See LICENSE file for details about copyright. *
|
|
***************************************************************************/
|
|
|
|
#include "DirectionCosineIeqctJeqc.h"
|
|
#include "EndFrameqc.h"
|
|
#include "EndFrameqct.h"
|
|
|
|
using namespace MbD;
|
|
|
|
DirectionCosineIeqctJeqc::DirectionCosineIeqctJeqc()
|
|
{
|
|
}
|
|
|
|
DirectionCosineIeqctJeqc::DirectionCosineIeqctJeqc(EndFrmsptr frmi, EndFrmsptr frmj, size_t axisi, size_t axisj) :
|
|
DirectionCosineIeqcJeqc(frmi, frmj, axisi, axisj)
|
|
{
|
|
}
|
|
|
|
void DirectionCosineIeqctJeqc::initialize()
|
|
{
|
|
DirectionCosineIeqcJeqc::initialize();
|
|
ppAijIeJepEIpt = std::make_shared<FullRow<double>>(4);
|
|
ppAijIeJepEJpt = std::make_shared<FullRow<double>>(4);
|
|
}
|
|
|
|
void DirectionCosineIeqctJeqc::initializeGlobally()
|
|
{
|
|
ppAjOJepEJpEJ = std::static_pointer_cast<EndFrameqc>(frmJ)->ppAjOepEpE(axisJ);
|
|
}
|
|
|
|
FRowDsptr MbD::DirectionCosineIeqctJeqc::ppvaluepEIpt()
|
|
{
|
|
return ppAijIeJepEIpt;
|
|
}
|
|
|
|
FRowDsptr MbD::DirectionCosineIeqctJeqc::ppvaluepEJpt()
|
|
{
|
|
return ppAijIeJepEJpt;
|
|
}
|
|
|
|
double MbD::DirectionCosineIeqctJeqc::ppvalueptpt()
|
|
{
|
|
return ppAijIeJeptpt;
|
|
}
|
|
|
|
void DirectionCosineIeqctJeqc::calcPostDynCorrectorIteration()
|
|
{
|
|
//"ppAjOIepEIpEI is not longer constant and must be set before any calculation."
|
|
|
|
ppAjOIepEIpEI = std::static_pointer_cast<EndFrameqc>(frmI)->ppAjOepEpE(axisI);
|
|
DirectionCosineIeqcJeqc::calcPostDynCorrectorIteration();
|
|
}
|
|
|
|
void DirectionCosineIeqctJeqc::preVelIC()
|
|
{
|
|
Item::preVelIC();
|
|
auto pAjOIept = std::static_pointer_cast<EndFrameqct>(frmI)->pAjOept(axisI);
|
|
pAijIeJept = pAjOIept->dot(aAjOJe);
|
|
}
|
|
|
|
double DirectionCosineIeqctJeqc::pvaluept()
|
|
{
|
|
return pAijIeJept;
|
|
}
|
|
|
|
void DirectionCosineIeqctJeqc::preAccIC()
|
|
{
|
|
//| ppAjOIepEITpt ppAjOIeptpt ppAjOIepEITpti pAjOIept |
|
|
Item::preAccIC();
|
|
auto pAjOIept = std::static_pointer_cast<EndFrameqct>(frmI)->pAjOept(axisI);
|
|
auto ppAjOIepEITpt = std::static_pointer_cast<EndFrameqct>(frmI)->ppAjOepETpt(axisI);
|
|
auto ppAjOIeptpt = std::static_pointer_cast<EndFrameqct>(frmI)->ppAjOeptpt(axisI);
|
|
for (size_t i = 0; i < 4; i++)
|
|
{
|
|
auto& ppAjOIepEITpti = ppAjOIepEITpt->at(i);
|
|
ppAijIeJepEIpt->atiput(i, ppAjOIepEITpti->dot(aAjOJe));
|
|
}
|
|
for (size_t i = 0; i < 4; i++)
|
|
{
|
|
ppAijIeJepEJpt->atiput(i, pAjOIept->dot(pAjOJepEJT->at(i)));
|
|
}
|
|
ppAijIeJeptpt = ppAjOIeptpt->dot(aAjOJe);
|
|
}
|