Go to the documentation of this file.
3 #include <unordered_map>
5 #include <mc_rtc/Configuration.h>
6 #include <mc_rtc/gui/StateBuilder.h>
7 #include <SpaceVecAlg/SpaceVecAlg>
17 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
46 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
58 VertexWithRidge(
const Eigen::Vector3d & _vertex,
const std::vector<Eigen::Vector3d> & _ridgeList)
71 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
77 Contact(
const std::string & name, std::optional<sva::ForceVecd> maxWrench = std::nullopt);
80 virtual std::string
type()
const = 0;
85 return static_cast<int>(
graspMat_.cols());
96 sva::ForceVecd
calcWrench(
const Eigen::VectorXd & wrenchRatio,
97 const Eigen::Vector3d & momentOrigin = Eigen::Vector3d::Zero())
const;
103 sva::ForceVecd
calcLocalWrench(
const Eigen::VectorXd & wrenchRatio)
const;
112 virtual void addToGUI(mc_rtc::gui::StateBuilder & gui,
113 const std::vector<std::string> & category,
116 const Eigen::VectorXd & wrenchRatio = Eigen::VectorXd::Zero(0));
142 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
152 EmptyContact(
const mc_rtc::Configuration & mcRtcConfig);
155 inline virtual std::string
type()
const override
174 static void loadVerticesMap(
const mc_rtc::Configuration & mcRtcConfig);
177 static inline std::unordered_map<std::string, std::vector<Eigen::Vector3d>>
verticesMap;
183 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
194 const std::vector<Eigen::Vector3d> & localVertices,
195 const sva::PTransformd & pose,
196 std::optional<sva::ForceVecd> maxWrench = std::nullopt);
204 inline virtual std::string
type()
const override
222 virtual void addToGUI(mc_rtc::gui::StateBuilder & gui,
223 const std::vector<std::string> & category,
226 const Eigen::VectorXd & wrenchRatio = Eigen::VectorXd::Zero(0))
override;
236 static void loadVerticesMap(
const mc_rtc::Configuration & mcRtcConfig);
239 static inline std::unordered_map<std::string, std::vector<sva::PTransformd>>
verticesMap;
245 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
256 const std::vector<sva::PTransformd> & localVertices,
257 const sva::PTransformd & pose,
258 std::optional<sva::ForceVecd> maxWrench = std::nullopt);
263 GraspContact(
const mc_rtc::Configuration & mcRtcConfig);
266 inline virtual std::string
type()
const override
284 virtual void addToGUI(mc_rtc::gui::StateBuilder & gui,
285 const std::vector<std::string> & category,
288 const Eigen::VectorXd & wrenchRatio = Eigen::VectorXd::Zero(0))
override;
297 sva::ForceVecd
calcTotalWrench(
const std::vector<std::shared_ptr<Contact>> & contactList,
298 const Eigen::VectorXd & wrenchRatio,
299 const Eigen::Vector3d & momentOrigin = Eigen::Vector3d::Zero());
307 std::vector<sva::ForceVecd>
calcWrenchList(
const std::vector<std::shared_ptr<Contact>> & contactList,
308 const Eigen::VectorXd & wrenchRatio,
309 const Eigen::Vector3d & momentOrigin = Eigen::Vector3d::Zero());
316 std::vector<sva::ForceVecd>
calcLocalWrenchList(
const std::vector<std::shared_ptr<Contact>> & contactList,
317 const Eigen::VectorXd & wrenchRatio);
327 template<
template<
class...>
class MapType,
class KeyType,
class... RestTypes>
329 const MapType<KeyType, std::shared_ptr<Contact>, RestTypes...> & contactList,
330 const Eigen::VectorXd & wrenchRatio,
331 const Eigen::Vector3d & momentOrigin = Eigen::Vector3d::Zero());
339 template<
template<
class...>
class MapType,
class KeyType,
class... RestTypes>
341 const MapType<KeyType, std::shared_ptr<Contact>, RestTypes...> & contactList);
constexpr double defaultForceScale
Default scale of force markers.
sva::ForceVecd calcTotalWrench(const std::vector< std::shared_ptr< Contact >> &contactList, const Eigen::VectorXd &wrenchRatio, const Eigen::Vector3d &momentOrigin=Eigen::Vector3d::Zero())
Calculate total wrench.
int ridgeNum() const
Number of ridges.
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 > calcLocalWrenchList(const std::vector< std::shared_ptr< Contact >> &contactList, const Eigen::VectorXd &wrenchRatio)
Calculate local contact wrench list.
std::vector< Eigen::Vector3d > calcGlobalRidgeList(const Eigen::Matrix3d &rot) const
Calculate ridge vector list in global coordinates.
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.
EIGEN_MAKE_ALIGNED_OPERATOR_NEW FrictionPyramid(double fricCoeff, int ridgeNum=4)
Constructor.
std::vector< Eigen::Vector3d > localRidgeList_
Local ridge list.
constexpr double defaultFricPyramidScale
Default scale of friction pyramid markers.