Commit 10917560 authored by Thomas Moulard's avatar Thomas Moulard
Browse files

Initial work.

parents
[submodule "cmake"]
path = cmake
url = git://github.com/jrl-umi3218/jrl-cmakemodules.git
# Copyright 2011, Thomas Moulard, Olivier Stasse, JRL, CNRS/AIST
#
# This file is part of sot-hrp2.
# sot-hrp2 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.
#
# sot-hrp2 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
# sot-hrp2. If not, see <http://www.gnu.org/licenses/>.
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
INCLUDE(cmake/base.cmake)
INCLUDE(cmake/boost.cmake)
INCLUDE(cmake/lapack.cmake)
INCLUDE(cmake/cpack.cmake)
SET(PROJECT_NAME sot-hrp2)
SET(PROJECT_DESCRIPTION "dynamic-graph package for HRP-2 robot")
SET(PROJECT_URL "http://github.com/laas/sot-hrp2")
SET(CUSTOM_HEADER_DIR "${PROJECT_NAME}")
# Disable -Werror on Unix for now.
#SET(CXX_DISABLE_WERROR True)
SET(PKG_CONFIG_ADDITIONAL_VARIABLES
${PKG_CONFIG_ADDITIONAL_VARIABLES}
plugindirname
plugindir
)
SETUP_PROJECT()
# Search for dependencies.
ADD_REQUIRED_DEPENDENCY("jrl-mathtools")
ADD_REQUIRED_DEPENDENCY("jrl-mal >= 1.9.0")
ADD_REQUIRED_DEPENDENCY("jrl-dynamics >= 1.19.0")
ADD_REQUIRED_DEPENDENCY("hrp2-dynamics >= 1.5.0")
ADD_REQUIRED_DEPENDENCY("hrp2-10-optimized >= 1.0.1")
ADD_REQUIRED_DEPENDENCY("hrp2-10 >= 1.0.1")
ADD_REQUIRED_DEPENDENCY("hrp2-14 >= 1.8")
ADD_REQUIRED_DEPENDENCY("dynamic-graph")
ADD_REQUIRED_DEPENDENCY("sot-core")
# Search for dependencies.
# Boost
SET(BOOST_COMPONENTS filesystem system)
SEARCH_FOR_BOOST()
# Add subdirectories.
ADD_SUBDIRECTORY(src)
ADD_SUBDIRECTORY(tests)
SETUP_PROJECT_FINALIZE()
SETUP_PROJECT_CPACK()
Subproject commit e7c71a8d8bc6d3625d84ccee69b1a6d219fbee8b
INPUT = @CMAKE_SOURCE_DIR@/include
FILE_PATTERNS = *.cc *.cpp *.h *.hh *.hxx
TAGFILES = \
"@JRL_MAL_DOXYGENDOCDIR@/jrl-mal.doxytag = @JRL_MAL_DOXYGENDOCDIR@" \
"@DYNAMIC_GRAPH_DOXYGENDOCDIR@/dynamic-graph.doxytag = @DYNAMIC_GRAPH_DOXYGENDOCDIR@" \
"@SOT_CORE_DOXYGENDOCDIR@/sot-core.doxytag = @SOT_CORE_DOXYGENDOCDIR@"
# Copyright 2011, Thomas Moulard, Olivier Stasse, JRL, CNRS/AIST
#
# This file is part of sot-hrp2.
# sot-hrp2 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.
#
# sot-hrp2 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
# sot-hrp2. If not, see <http://www.gnu.org/licenses/>.
INCLUDE(../cmake/python.cmake)
FUNCTION(COMPILE_PLUGIN NAME SOURCES ENTITIES)
ADD_LIBRARY(${NAME} SHARED ${SOURCES})
SET_TARGET_PROPERTIES(${lib} PROPERTIES
PREFIX ""
SOVERSION ${PROJECT_VERSION})
PKG_CONFIG_USE_DEPENDENCY(${NAME} dynamic-graph)
PKG_CONFIG_USE_DEPENDENCY(${NAME} jrl-mathtools)
PKG_CONFIG_USE_DEPENDENCY(${NAME} jrl-mal)
PKG_CONFIG_USE_DEPENDENCY(${NAME} sot-core)
INSTALL(TARGETS ${NAME} DESTINATION lib/plugin)
# build python submodule
STRING(REPLACE - _ PYTHON_LIBRARY_NAME ${NAME})
ADD_DEPENDENCIES(${NAME} MKDIR_${PYTHON_LIBRARY_NAME})
ADD_CUSTOM_TARGET(MKDIR_${PYTHON_LIBRARY_NAME}
mkdir -p dynamic_graph/sot/hrp2/${PYTHON_LIBRARY_NAME}
)
SET(NEW_ENTITY_CLASS ${ENTITIES})
DYNAMIC_GRAPH_PYTHON_MODULE("sot/hrp2/${PYTHON_LIBRARY_NAME}"
${NAME}
sot/hrp2/${PYTHON_LIBRARY_NAME}/wrap
)
ENDFUNCTION()
# Compile plug-ins.
COMPILE_PLUGIN(dynamic-hrp2_14 dynamic-hrp2_14.cc DynamicHrp2_14)
COMPILE_PLUGIN(dynamic-hrp2_10 dynamic-hrp2_10.cc DynamicHrp2_10)
# Install Python files.
SET(PYTHON_MODULE_DIR
${CMAKE_CURRENT_SOURCE_DIR}/dynamic_graph/sot/hrp2)
SET(PYTHON_MODULE_BUILD_DIR
${CMAKE_CURRENT_BINARY_DIR}/dynamic_graph/sot/hrp2)
SET(FILES __init__.py robot.py)
# Install dynamic_graph.sot.hrp2_14
SET(PYTHON_MODULE dynamic_graph/sot/hrp2_14)
FOREACH(FILE ${FILES})
PYTHON_INSTALL_ON_SITE("${PYTHON_MODULE}" "${FILE}" )
ENDFOREACH()
# Install dynamic_graph.sot.hrp2_10
SET(PYTHON_MODULE dynamic_graph/sot/hrp2_10)
FOREACH(FILE ${FILES})
PYTHON_INSTALL_ON_SITE("${PYTHON_MODULE}" "${FILE}" )
ENDFOREACH()
// 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)
: Dynamic (name, false)
{
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.
// Copyright 2010, François Bleibel, Thomas Moulard, Olivier Stasse,
// JRL, CNRS/AIST.
//
// This file is part of sot-hrp2.
// sot-hrp2 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.
//
// sot-hrp2 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
// sot-hrp2. If not, see <http://www.gnu.org/licenses/>.
#ifndef SOT_HRP2_DYNAMIC_HRP2_10_HH
# define SOT_HRP2_DYNAMIC_HRP2_10_HH
# include <sot-dynamic/dynamic.h>
# include <hrp2-10-optimized/hrp2-10-small-optimized.hh>
# if defined (WIN32)
# if defined (dynamic_hrp2_10_EXPORTS)
# define DYNAMICHRP2_10_EXPORT __declspec(dllexport)
# else
# define DYNAMICHRP2_10_EXPORT __declspec(dllimport)
# endif
# else
# define DYNAMICHRP2_10_EXPORT
# endif
namespace dynamicgraph
{
namespace sot
{
namespace hrp2
{
/// \brief Optimized sot-dynamics entity using algorithms
/// dedicated to the hrp2-10 kinematics structure.
///
/// See hrp2_10_optimized package for more information.
class DYNAMICHRP2_10_EXPORT DynamicHrp2_10 : public Dynamic
{
DYNAMIC_GRAPH_ENTITY_DECL ();
public:
explicit DynamicHrp2_10 (const std::string& name);
virtual ~DynamicHrp2_10 ();
void buildModelHrp2 ();
};
} // end of namespace hrp2.
} // end of namespace sot.
} // end of namespace dynamicgraph.
#endif //! SOT_HRP2_DYNAMIC_HRP2_10_HH
// 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_14.hh"
using namespace dynamicgraph;
using namespace dynamicgraph::sot;
#include <abstract-robot-dynamics/robot-dynamics-object-constructor.hh>
namespace dynamicgraph
{
namespace sot
{
namespace hrp2
{
DynamicHrp2_14::DynamicHrp2_14 (const std::string & name)
: Dynamic (name, false)
{
sotDEBUGIN(15);
DynamicHrp2_14::buildModelHrp2 ();
sotDEBUGOUT(15);
}
void
DynamicHrp2_14::buildModelHrp2 ()
{
sotDEBUGIN(15);
dynamicsJRLJapan::ObjectFactory aRobotDynamicsObjectConstructor;
Chrp2OptHumanoidDynamicRobot* aHDR =
new Chrp2OptHumanoidDynamicRobot(&aRobotDynamicsObjectConstructor);
m_HDR = aHDR;
if (!aHDR)
throw std::runtime_error ("dynamic cast on HDR failed ");
sotDEBUGOUT(15);
}
DynamicHrp2_14::~DynamicHrp2_14 ()
{
sotDEBUGINOUT(5);
return;
}
DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN(DynamicHrp2_14,"DynamicHrp2_14");
} // end of namespace hrp2.
} // end of namespace sot.
} // end of namespace dynamicgraph.
// Copyright 2010, François Bleibel, Thomas Moulard, Olivier Stasse,
// JRL, CNRS/AIST.
//
// This file is part of sot-hrp2.
// sot-hrp2 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.
//
// sot-hrp2 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
// sot-hrp2. If not, see <http://www.gnu.org/licenses/>.
#ifndef SOT_HRP2_DYNAMIC_HRP2_14_HH
# define SOT_HRP2_DYNAMIC_HRP2_14_HH
# include <sot-dynamic/dynamic.h>
# include <hrp2-dynamics/hrp2OptHumanoidDynamicRobot.h>
# if defined (WIN32)
# if defined (dynamic_hrp2_14_EXPORTS)
# define DYNAMICHRP2_14_EXPORT __declspec(dllexport)
# else
# define DYNAMICHRP2_14_EXPORT __declspec(dllimport)
# endif
# else
# define DYNAMICHRP2_14_EXPORT
# endif
namespace dynamicgraph
{
namespace sot
{
namespace hrp2
{
/// \brief Optimized sot-dynamics entity using algorithms
/// dedicated to the hrp2-14 kinematics structure.
///
/// See hrp2_14_optimized package for more information.
class DYNAMICHRP2_14_EXPORT DynamicHrp2_14 : public Dynamic
{
DYNAMIC_GRAPH_ENTITY_DECL ();
public:
explicit DynamicHrp2_14 (const std::string& name);
virtual ~DynamicHrp2_14 ();
void buildModelHrp2 ();
};
} // end of namespace hrp2.
} // end of namespace sot.
} // end of namespace dynamicgraph.
#endif //! SOT_HRP2_DYNAMIC_HRP2_14_HH
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