BipedalLocomotion::Contacts::GlobalCoPEvaluator class

GlobalCoPEvaluator is a class that computes the global CoP given a set of contact wrenches.

Following P. Sardain and G. Bessonnet, "Forces acting on a biped robot. Center of pressure-zero moment point," in IEEE Transactions on Systems, Man, and Cybernetics, we defined the global CoP as the weighted average of the CoP of each contact, with the weight determined by the normal force of the contact. In detail, given $n$ contacts, with $n > 0$ , the global CoP is defined as

\[ {}^{I} x_{\text{CoP}}^{\text{global}} = \frac{1}{\sum_{i=1}^{n} f_{z,i}} \sum_{i=1}^{n} ({}^I f_{z,i} \; \; x_{\text{CoP},i}) \]

where ${}^I x_{\text{CoP}}^{\text{global}}$ is the global CoP expressed in the inertial frame $I$ , ${}^I f_{z,i}$ is the z component of the contact force expressed in the inertial frame $I$ , ${}^I x_{\text{CoP},i}$ is the CoP of the $i$ -th contact expressed in the inertial frame $I$ . The local CoP ${}^I x_{\text{CoP},i}$ can be computed as follows

\[ {}^I x_{\text{CoP},i} = {}^I x_{\text{C},i} + {}^I R_{\text{C},i} \; {}^C x_{\text{CoP},i} \]

where ${}^I x_{\text{C},i}$ is the contact position in the inertial frame $I$ , ${}^I R_{\text{C},i}$ is the rotation matrix from the inertial frame $I$ to the contact frame $C$ , and ${}^C x_{\text{CoP},i}$ is the CoP of the $i$ -th contact expressed in the contact frame $C$ that can be computed as follows

\[ {}^C x_{\text{CoP},i} = \frac{1}{f_{z,i}} \begin{bmatrix} -\mu_{y,i} \\ \mu_{x,i} \\ 0 \end{bmatrix} \]

with $\mu_{x,i}$ and $\mu_{y,i}$ being the x and y component of the moment of the contact wrench expressed in the contact frame $C$ .

Base classes

template<class _Input, class _Output>
class BipedalLocomotion::System::Advanceable<std::vector<Contacts::ContactWrench>, Eigen::Vector3d>
Basic class that represents a discrete system.

Public functions

auto initialize(std::weak_ptr<const ParametersHandler::IParametersHandler> handler) -> bool override
Initialize the class.
auto setInput(const std::initializer_list<Contacts::ContactWrench>& input) -> bool
Set the input to the class.
auto setInput(const std::vector<Contacts::ContactWrench>& input) -> bool override
Set the input to the class.
auto advance() -> bool override
Compute the global CoP.
auto isOutputValid() const -> bool override
Check if the CoP evaluated by the class is valid.
auto getOutput() const -> const Eigen::Vector3d& override
Get the global CoP.

Function documentation

bool BipedalLocomotion::Contacts::GlobalCoPEvaluator::initialize(std::weak_ptr<const ParametersHandler::IParametersHandler> handler) override

Initialize the class.

Parameters
handler pointer to a parameter handler
Returns true in case of success, false otherwise.

bool BipedalLocomotion::Contacts::GlobalCoPEvaluator::setInput(const std::initializer_list<Contacts::ContactWrench>& input)

Set the input to the class.

Parameters
input list containing the contact wrench
Returns true in case of success and false otherwise

bool BipedalLocomotion::Contacts::GlobalCoPEvaluator::setInput(const std::vector<Contacts::ContactWrench>& input) override

Set the input to the class.

Parameters
input list containing the contact wrench
Returns true in case of success and false otherwise

bool BipedalLocomotion::Contacts::GlobalCoPEvaluator::advance() override

Compute the global CoP.

Returns true in case of success and false otherwise

bool BipedalLocomotion::Contacts::GlobalCoPEvaluator::isOutputValid() const override

Check if the CoP evaluated by the class is valid.

Returns true if valid, false otherwise.

const Eigen::Vector3d& BipedalLocomotion::Contacts::GlobalCoPEvaluator::getOutput() const override

Get the global CoP.

Returns a 3D vector containing the position of the global CoP expressed respect to the global (inertial) frame.