MCPcopy Create free account
hub / github.com/dartsim/dart / initialize

Method initialize

examples/hubo_puppet/main.cpp:831–854  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

829 }
830
831 void initialize()
832 {
833 mRestConfig = mHubo->getPositions();
834
835 for (std::size_t i = 0; i < mHubo->getNumEndEffectors(); ++i) {
836 const InverseKinematicsPtr ik = mHubo->getEndEffector(i)->getIK();
837 if (ik) {
838 mDefaultBounds.push_back(ik->getErrorMethod().getBounds());
839 mDefaultTargetTf.push_back(ik->getTarget()->getRelativeTransform());
840 mConstraintActive.push_back(false);
841 mEndEffectorIndex.push_back(i);
842 }
843 }
844
845 mPosture = std::dynamic_pointer_cast<RelaxedPosture>(
846 mHubo->getIK(true)->getObjective());
847
848 mBalance = std::dynamic_pointer_cast<dart::constraint::BalanceConstraint>(
849 mHubo->getIK(true)->getProblem()->getEqConstraint(1));
850
851 mOptimizationKey = 'r';
852
853 mMoveComponents.resize(TeleoperationWorld::NUM_MOVE, false);
854 }
855
856 bool handle(
857 const ::osgGA::GUIEventAdapter& ea, ::osgGA::GUIActionAdapter&) override

Callers

nothing calls this directly

Calls 9

getEndEffectorMethod · 0.80
getErrorMethodMethod · 0.80
getTargetMethod · 0.80
getEqConstraintMethod · 0.80
getPositionsMethod · 0.45
getIKMethod · 0.45
getObjectiveMethod · 0.45
getProblemMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected