Ejemplo n.º 1
0
    // Semantics operations
    bool AngularForceVector3Semantics::changePoint(const PositionSemantics & newPoint,
                                                   const LinearForceVector3Semantics & otherLinear,
                                                   AngularForceVector3Semantics & resultAngular) const
    {
        // check semantics
        bool semantics_status =
        (   reportErrorIf(!checkEqualOrUnknown(newPoint.getCoordinateFrame(),this->coordinateFrame),
                          IDYNTREE_PRETTY_FUNCTION,
                          "newPoint expressed in a different coordinateFrame\n")
         && reportErrorIf(!checkEqualOrUnknown(newPoint.getReferencePoint(),this->point),
                          IDYNTREE_PRETTY_FUNCTION,
                          "newPoint has a reference point different from the original Force vector point\n")/*
         && reportErrorIf(!checkEqualOrUnknown(newPoint.getBody(),newPoint.getRefBody()),
                          IDYNTREE_PRETTY_FUNCTION,
                          "newPoint point and reference point are not fixed to the same body\n")
         && reportErrorIf(!checkEqualOrUnknown(newPoint.getRefBody(),this->body),
                          IDYNTREE_PRETTY_FUNCTION,
                          "newPoint reference point and original Force vector point are not fixed to the same body\n")*/
         && reportErrorIf(!checkEqualOrUnknown(otherLinear.getCoordinateFrame(),this->coordinateFrame),
                          IDYNTREE_PRETTY_FUNCTION,
                          "otherLinear expressed in a different coordinateFrame\n")
         && reportErrorIf(!checkEqualOrUnknown(otherLinear.getBody(),this->body),
                          IDYNTREE_PRETTY_FUNCTION,
                          "The bodies defined for both linear and angular force vectors don't match\n")
         && reportErrorIf(!checkEqualOrUnknown(otherLinear.getRefBody(),this->refBody),
                          IDYNTREE_PRETTY_FUNCTION,
                          "The reference bodies defined for both linear and angular force vectors don't match\n"));

        // compute semantics
        resultAngular = *this;
        resultAngular.point = newPoint.getPoint();

        return semantics_status;
    }
Ejemplo n.º 2
0
    bool PositionSemantics::changePoint(const PositionSemantics& newPoint)
    {
        // check semantics
        bool status = this->check_changePoint(newPoint);

        // set new semantics
        this->point = newPoint.getPoint();

        return status;
    }