assignment_optimization-2Dgrasp
Public Member Functions | Static Public Member Functions | List of all members
problem_ns::Problem Class Reference

#include <problem.h>

Public Member Functions

bool configure (const std::vector< double > &shape, const double friction, const Force &F)
 
const std::vector< double > & get_shape () const
 
double get_friction () const
 
const Forceget_F () const
 
const yarp::sig::Vector & get_COM () const
 
yarp::sig::Vector get_P (const double t) const
 
yarp::sig::Vector get_dP (const double t) const
 
yarp::sig::Vector get_T (const double t) const
 
yarp::sig::Vector get_dT (const double t) const
 
yarp::sig::Vector get_N (const double t) const
 
yarp::sig::Vector get_dN (const double t) const
 
std::pair< yarp::sig::Vector, double > compute_newton_law (const std::vector< Force > &forces) const
 
bool check_no_slippage (const Force &force) const
 
bool check_no_slippage (const std::vector< Force > &forces) const
 

Static Public Member Functions

static std::shared_ptr< Problemgenerate ()
 
static double wrap_angle (const double t)
 

Detailed Description

Problem API.

Member Function Documentation

◆ check_no_slippage() [1/2]

bool Problem::check_no_slippage ( const Force force) const

Check if the force is within the friction cone.

Parameters
forceis the 2D inward force.
Returns
true if the check has passed.

◆ check_no_slippage() [2/2]

bool problem_ns::Problem::check_no_slippage ( const std::vector< Force > &  forces) const

Check if the forces are within the friction cones.

Parameters
forcesis the vector of 2D inward forces.
Returns
true if the check has passed for all forces.

◆ compute_newton_law()

pair< Vector, double > Problem::compute_newton_law ( const std::vector< Force > &  forces) const

Compute the total force and torque acting on the object due to F and input forces.

Parameters
forcesis the 2D vector of the inward forces.
Returns
a pair representing the total force and torque.

◆ configure()

bool Problem::configure ( const std::vector< double > &  shape,
const double  friction,
const Force F 
)

Configure the problem.

Parameters
shapeis a 4D vector containing the coefficients of the object's perimeter.
frictionis in range [0,1].
Fis the applied force.
Returns
true/false on success/failure.

◆ generate()

shared_ptr< Problem > Problem::generate ( )
static

Generate a random problem.

Returns
the problem.

◆ get_COM()

const Vector & Problem::get_COM ( ) const

Retrieve the COM of the object.

Returns
a YARP vector containing the x and y coordinates.

◆ get_dN()

Vector Problem::get_dN ( const double  t) const

Retrieve the derivative of the inward normal N on the object's perimeter.

Parameters
tis the parameter.
Returns
a YARP vector containing the x and y coordinates.

◆ get_dP()

Vector Problem::get_dP ( const double  t) const

Retrieve the derivative of the point P on the object's perimeter.

Parameters
tis the parameter.
Returns
a YARP vector containing the x and y coordinates.

◆ get_dT()

Vector Problem::get_dT ( const double  t) const

Retrieve the derivative of the tangent T on the object's perimeter.

Parameters
tis the parameter.
Returns
a YARP vector containing the x and y coordinates.

◆ get_F()

const Force & Problem::get_F ( ) const

Retrieve the force applied to the object.

Returns
the force F.

◆ get_friction()

double Problem::get_friction ( ) const

Retrieve the friction value.

Returns
the friction.

◆ get_N()

Vector Problem::get_N ( const double  t) const

Retrieve the normal N on the object's perimeter.

Parameters
tis the parameter.
Returns
a YARP vector containing the x and y coordinates.
Note
|N|≠1, i.e. N is not a unit vector.
(T×N)·z>0, i.e. N points inward.

◆ get_P()

Vector Problem::get_P ( const double  t) const

Retrieve the point P on the object's perimeter.

Parameters
tis the parameter.
Returns
a YARP vector containing the x and y coordinates.

◆ get_shape()

const vector< double > & Problem::get_shape ( ) const

Retrieve the current vector of coefficients describing the object's perimeter.

Returns
the perimeter's coefficients.

◆ get_T()

Vector Problem::get_T ( const double  t) const

Retrieve the tangent T on the object's perimeter.

Parameters
tis the parameter.
Returns
a YARP vector containing the x and y coordinates.
Note
|T|≠1, i.e. T is not a unit vector.
T·dP>0, i.e. T is aligned w/ velocity.

◆ wrap_angle()

double Problem::wrap_angle ( const double  t)
static

Helper function that returns the parameter t within the interval [0, 2*PI].

Parameters
tis the input parameter.
Returns
the wrapped version of t.

The documentation for this class was generated from the following files: