Commit efcc41ad authored by Joseph Mirabel's avatar Joseph Mirabel Committed by Joseph Mirabel
Browse files

Add computation flag GEOMETRY

parent 9c2eb1e0
......@@ -54,11 +54,12 @@ namespace hpp {
/// controlComputation.
enum Computation_t {
JOINT_POSITION = 0x1,
JACOBIAN = 0x2,
VELOCITY = 0x4,
ACCELERATION = 0x8,
COM = 0x10,
ALL = 0Xffff
JACOBIAN = 0x2,
VELOCITY = 0x4,
ACCELERATION = 0x8,
COM = 0x10,
GEOMETRY = 0x20,
ALL = 0Xffff
};
/// Collision pairs between bodies
......
......@@ -209,7 +209,7 @@ namespace hpp {
Configuration_t Device::
neutralConfiguration () const
{
Configuration_t n (configSize);
Configuration_t n (configSize());
n.head(model_->nv) = model()->neutralConfiguration;
n.tail(extraConfigSpace_.dimension()).setZero();
return n;
......@@ -244,6 +244,8 @@ namespace hpp {
assert(model_);
assert(data_);
// a IMPLIES b === (b || ~a)
// geometry IMPLIES position
assert( (computationFlag_|JOINT_POSITION) || (!(computationFlag_|GEOMETRY)) );
// velocity IMPLIES position
assert( (computationFlag_|JOINT_POSITION) || (!(computationFlag_|VELOCITY)) );
// acceleration IMPLIES velocity
......@@ -273,6 +275,9 @@ namespace hpp {
if(computationFlag_|JACOBIAN)
se3::computeJacobians(*model_,*data_,currentConfiguration_);
if(computationFlag_|GEOMETRY)
se3::updateGeometryPlacements(*model(),*data(),*geomModel(),*geomData());
}
std::ostream& Device::
......@@ -290,7 +295,6 @@ namespace hpp {
{
/* Following hpp::model API, the forward kinematics (joint placement) is
* supposed to have already been computed. */
se3::updateGeometryPlacements(*model(),*data(),*geomModel(),*geomData());
return se3::computeCollisions(*geomData(),stopAtFirstCollision);
}
......@@ -298,7 +302,6 @@ namespace hpp {
{
/* Following hpp::model API, the forward kinematics (joint placement) is
* supposed to have already been computed. */
se3::updateGeometryPlacements(*model(),*data(),*geomModel(),*geomData());
se3::computeDistances (*geomData());
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment