dynamic-hrp2_10.cc 1.91 KB
Newer Older
Thomas Moulard's avatar
Thomas Moulard committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
// Copyright 2010, François Bleibel, Thomas Moulard, Olivier Stasse,
// JRL, CNRS/AIST.
//
// This file is part of dynamic-graph.
// dynamic-graph is free software: you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
//
// dynamic-graph is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// General Lesser Public License for more details.  You should have
// received a copy of the GNU Lesser General Public License along with
// dynamic-graph. If not, see <http://www.gnu.org/licenses/>.

#include <stdexcept>
#include <sot/core/debug.hh>

#include <dynamic-graph/factory.h>
#include "dynamic-hrp2_10.hh"

using namespace dynamicgraph;
using namespace dynamicgraph::sot;

#include <abstract-robot-dynamics/robot-dynamics-object-constructor.hh>

namespace dynamicgraph
{
  namespace sot
  {
    namespace hrp2
    {
      DynamicHrp2_10::DynamicHrp2_10 (const std::string & name)
35
	: Dynamic (name)
Thomas Moulard's avatar
Thomas Moulard committed
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
      {
	sotDEBUGIN(15);
	DynamicHrp2_10::buildModelHrp2 ();
	sotDEBUGOUT(15);
      }

      void
      DynamicHrp2_10::buildModelHrp2 ()
      {
	sotDEBUGIN(15);
	dynamicsJRLJapan::ObjectFactory aRobotDynamicsObjectConstructor;

	hrp210Optimized<paramHrp210SmallOptimized>* aHDR =
	  new hrp210Optimized<paramHrp210SmallOptimized>
	  (&aRobotDynamicsObjectConstructor);

	m_HDR = aHDR;

	if (!aHDR)
	  throw std::runtime_error ("dynamic cast on HDR failed ");
	sotDEBUGOUT(15);
      }

      DynamicHrp2_10::~DynamicHrp2_10 ()
      {
	sotDEBUGINOUT(5);
	return;
      }

      DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN(DynamicHrp2_10,"DynamicHrp2_10");
    } // end of namespace hrp2.
  } // end of namespace sot.
} // end of namespace dynamicgraph.