1#define BIORBD_API_EXPORTS
2#include "RigidBody/SoftContacts.h"
4#include "RigidBody/GeneralizedCoordinates.h"
5#include "RigidBody/GeneralizedVelocity.h"
6#include "RigidBody/Joints.h"
7#include "RigidBody/Segment.h"
8#include "RigidBody/SoftContactNode.h"
9#include "RigidBody/SoftContactSphere.h"
10#include "Utils/Error.h"
11#include "Utils/SpatialVector.h"
12#include "Utils/String.h"
13#include "Utils/UtilsEnum.h"
15using namespace BIORBD_NAMESPACE;
31 utils::NODE_TYPE::SOFT_CONTACT_SPHERE) {
32 (*m_softContacts)[i] = std::make_shared<rigidbody::SoftContactSphere>();
45 std::vector<utils::String> out;
47 out.push_back(c->utils::Node::name());
54 if (contact.
typeOfNode() == utils::NODE_TYPE::SOFT_CONTACT_SPHERE) {
56 std::make_shared<rigidbody::SoftContactSphere>(contact));
64 return *(*m_softContacts)[idx];
81 std::vector<rigidbody::NodeSegment> out;
82 for (
int i = 0; i < static_cast<int>(
m_softContacts->size()); ++i) {
84#ifndef BIORBD_USE_CASADI_MATH
120std::vector<rigidbody::NodeSegment>
125 std::vector<rigidbody::NodeSegment> pos;
134std::vector<rigidbody::NodeSegment>
139 std::vector<rigidbody::NodeSegment> pos;
161 std::vector<size_t> indices;
165 indices.push_back(i);
Class GeneralizedCoordinates.
Class GeneralizedVelocity.
This is the core of the musculoskeletal model in biorbd.
utils::SpatialVector CalcPointVelocity6D(const rigidbody::GeneralizedCoordinates &Q, const rigidbody::GeneralizedVelocity &Qdot, utils::String segmentName, const utils::Vector3d &pointInLocal, bool updateKin=true)
Interface to call CalcPointVelocity6D. It is pretty much useless in Eigen, but fixes an issue in Casa...
Segment & segment(size_t idx)
Get a segment of index idx.
utils::Vector3d CalcPointVelocity(const rigidbody::GeneralizedCoordinates &Q, const rigidbody::GeneralizedVelocity &Qdot, utils::String segmentName, const utils::Vector3d &pointInLocal, bool updateKin=true)
Interface to call CalcPointVelocity. It is pretty much useless in Eigen, but fixes an issue in Casadi...
utils::Vector3d CalcBodyToBaseCoordinates(const rigidbody::GeneralizedCoordinates &Q, utils::String segmentName, const utils::Vector3d &pointInLocal, bool updateKin=true)
Interface to call CalcBodyToBaseCoordinates. It is pretty much useless in Eigen, but fixes an issue i...
A point attached to a segment, generally speaking a skin marker.
A point attached to a contact node, generally speaking a skin marker.
Holder for the biorbd contact set.
NodeSegment softContactVelocity(const GeneralizedCoordinates &Q, const GeneralizedVelocity &Qdot, size_t idx, bool updateKin=true)
Return the linear velocity of a contact.
std::shared_ptr< std::vector< std::shared_ptr< SoftContactNode > > > m_softContacts
The contacts.
std::vector< NodeSegment > softContactsVelocity(const GeneralizedCoordinates &Q, const GeneralizedVelocity &Qdot, bool updateKin=true)
Return the velocity of all the contacts.
std::vector< NodeSegment > softContacts(const GeneralizedCoordinates &Q, bool updateKin=true)
Return a the contacts at a given position Q.
utils::String softContactName(size_t i)
Return the name of the soft contact.
SoftContactNode & softContact(size_t idx)
Return a specified contact.
std::vector< size_t > segmentSoftContactIdx(size_t idx) const
Return all the soft contacts indices of a segment.
void addSoftContact(const SoftContactNode &contact)
Add a new contact to the contact set.
NodeSegment softContactAngularVelocity(const GeneralizedCoordinates &Q, const GeneralizedVelocity &Qdot, size_t idx, bool updateKin=true)
Return the angular velocity of a contact.
std::vector< utils::String > softContactNames()
Return the names of the soft contact.
std::vector< NodeSegment > softContactsAngularVelocity(const GeneralizedCoordinates &Q, const GeneralizedVelocity &Qdot, bool updateKin=true)
Return the angular velocity of all the contacts.
SoftContacts()
Construct a contact biorbd set.
SoftContacts DeepCopy() const
Deep copy of the contacts.
size_t nbSoftContacts() const
Return the number of contacts.
static void raise(const String &message)
Throw an error message.
const String & name() const
Return the name of the node.
NODE_TYPE typeOfNode() const
Return the type of node.
const String & parent() const
Return the parent name of the node.
Wrapper around the std::string class with augmented functionality.