3 template<
template<
class...>
class MapType,
class KeyType,
class... RestTypes>
5 const MapType<KeyType, std::shared_ptr<Contact>, RestTypes...> & contactList,
6 const Eigen::VectorXd & wrenchRatio,
7 const Eigen::Vector3d & momentOrigin)
9 MapType<KeyType, sva::ForceVecd> wrenchList;
10 int wrenchRatioIdx = 0;
11 for(
const auto & contactKV : contactList)
15 contactKV.second->calcWrench(wrenchRatio.segment(wrenchRatioIdx, contactKV.second->ridgeNum()), momentOrigin));
16 wrenchRatioIdx += contactKV.second->ridgeNum();
21 template<
template<
class...>
class MapType,
class KeyType,
class... RestTypes>
23 const MapType<KeyType, std::shared_ptr<Contact>, RestTypes...> & contactList)
25 std::vector<std::shared_ptr<Contact>> contactVec;
26 for(
const auto & contactKV : contactList)
28 contactVec.push_back(contactKV.second);
std::vector< std::shared_ptr< Contact > > getContactVecFromMap(const MapType< KeyType, std::shared_ptr< Contact >, RestTypes... > &contactList)
Convert vector of contact constraint to map.
std::vector< sva::ForceVecd > calcWrenchList(const std::vector< std::shared_ptr< Contact >> &contactList, const Eigen::VectorXd &wrenchRatio, const Eigen::Vector3d &momentOrigin=Eigen::Vector3d::Zero())
Calculate contact wrench list.