<commit_before>/*
 * Copyright (C) 2013 RobotCub Consortium
 * Author: <NAME>
 * CopyPolicy: Released under the terms of the GNU GPL v2.0 (or any later version)
 *
 */

#ifndef IDYNTREE_H
#define IDYNTREE_H

#include <yarp/sig/Matrix.h>
#include <yarp/sig/Vector.h>

#include <kdl_codyco/treeserialization.hpp>
#include <kdl_codyco/undirectedtree.hpp>
#include <kdl_codyco/momentumjacobian.hpp>
#include <kdl_codyco/floatingjntspaceinertiamatrix.hpp>

#include "iDynTree/Sensors/Sensors.h"

#include <kdl/jntarray.hpp>
#include <kdl/tree.hpp>

#include <iostream>
#include <vector>
#include <map>


namespace iCub
{

namespace iDynTree
{

const int WORLD_FRAME = -10;
const int DEFAULT_INDEX_VALUE = -20;

class skinDynLibLinkID {
     public:
          int body_part;
          int local_link_index;

    bool operator<(const skinDynLibLinkID& k) const
    {
        if(this->body_part < k.body_part)
        {
           return true;
        }
        else if(this->body_part > k.body_part)
        {
           return false;
        }
        else
        {
            return this->local_link_index < k.local_link_index;
        }
    }

    bool operator==(const skinDynLibLinkID& k) const
    {
        return (this->body_part == k.body_part &&
                this->local_link_index == k.local_link_index);
    }
};

class iDynTreeLinkAndFrame {
     public:
          int link_index;
          int frame_index;
};



/**
 * \ingroup iDynTreeYARP
 *
 * An class for calculating the torques and the external wrenches
 * in a Rigid Body Dynamic tree, using kinetic information (linear acceleration, angular velocity and
 * angular acceleration of one arbitrary link, joint positions, velocities, acceleration)
 * and FT sensor measures.  *
 *
 * \warning The used velocities accelerations, without the information
 *          about base linear velocity, are not the "real" ones. Are just
 *          the velocities assuming no base linear velocity, that by Galilean
 *          Relativity generate the same dynamics of the "real" ones
 *
 */
class DynTree  {
    protected:
        /** configured flag: if true the model was correctly loaded
         *  if false not an all the methods will return false */
        bool configured;

        KDL::CoDyCo::UndirectedTree undirected_tree; /**< UndirectedTree object: it encodes the TreeSerialization and the TreePartition */

        //Violating DRY principle, but for code clarity
        unsigned NrOfDOFs;
        unsigned NrOfLinks;
        unsigned NrOfFTSensors;
        unsigned NrOfDynamicSubGraphs;<commit_msg>Deprecated all DynTree.h classes<commit_after>/*
 * Copyright (C) 2013 RobotCub Consortium
 * Author: <NAME>
 * CopyPolicy: Released under the terms of the GNU GPL v2.0 (or any later version)
 *
 */

#ifndef IDYNTREE_H
#define IDYNTREE_H

#include <yarp/sig/Matrix.h>
#include <yarp/sig/Vector.h>

#include <kdl_codyco/treeserialization.hpp>
#include <kdl_codyco/undirectedtree.hpp>
#include <kdl_codyco/momentumjacobian.hpp>
#include <kdl_codyco/floatingjntspaceinertiamatrix.hpp>

#include "iDynTree/Sensors/Sensors.h"

#include <kdl/jntarray.hpp>
#include <kdl/tree.hpp>

#include <iostream>
#include <vector>
#include <map>


namespace iCub
{

namespace iDynTree
{

const int WORLD_FRAME = -10;
const int DEFAULT_INDEX_VALUE = -20;

IDYNTREE_DEPRECATED(class skinDynLibLinkID) {
     public:
          int body_part;
          int local_link_index;

    bool operator<(const skinDynLibLinkID& k) const
    {
        if(this->body_part < k.body_part)
        {
           return true;
        }
        else if(this->body_part > k.body_part)
        {
           return false;
        }
        else
        {
            return this->local_link_index < k.local_link_index;
        }
    }

    bool operator==(const skinDynLibLinkID& k) const
    {
        return (this->body_part == k.body_part &&
                this->local_link_index == k.local_link_index);
    }
};

IDYNTREE_DEPRECATED(class iDynTreeLinkAndFrame) {
     public:
          int link_index;
          int frame_index;
};



/**
 * \ingroup iDynTreeYARP
 *
 * An class for calculating the torques and the external wrenches
 * in a Rigid Body Dynamic tree, using kinetic information (linear acceleration, angular velocity and
 * angular acceleration of one arbitrary link, joint positions, velocities, acceleration)
 * and FT sensor measures.  *
 *
 * \warning The used velocities accelerations, without the information
 *          about base linear velocity, are not the "real" ones. Are just
 *          the velocities assuming no base linear velocity, that by Galilean
 *          Relativity generate the same dynamics of the "real" ones
 *
 */
IDYNTREE_DEPRECATED(class DynTree, "Use KinDynComputations instead")  {
    protected:
        /** configured flag: if true the model was correctly loaded
         *  if false not an all the methods will return false */
        bool configured;

        KDL::CoDyCo::UndirectedTree undirected_tree; /**< UndirectedTree object: it encodes the TreeSerialization and the TreePartition */

        //Violating DRY principle, but for code clarity
        unsigned NrOfDOFs;
        unsigned NrOfLinks;
        unsigned NrOfFTSensors;
        unsigned NrOfDynamicSubGraphs;
{'fraction_non_alphanumeric': 0.08444275389882085, 'fraction_numerical': 0.003803727653100038, 'mean_word_length': 2.8612334801762116, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 39, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4143362', 'n_tokens_mistral': 1691, 'n_tokens_neox': 1611, 'n_words': 469}