Commit 6f3830c5 authored by mnaveau's avatar mnaveau

[cmake] Fix bug in making hrp-2 libraries optional.

parent 9a28f18f
......@@ -41,21 +41,23 @@ FUNCTION(COMPILE_PLUGIN NAME SOURCES ENTITIES)
ENDFUNCTION()
# Compile plug-ins.
IF (hrp2-dynamics_FOUND)
IF (HRP2_DYNAMICS_FOUND)
MESSAGE(STATUS "Add dynamic-hrp2_14 plugin")
COMPILE_PLUGIN(dynamic-hrp2_14 dynamic-hrp2_14.cc DynamicHrp2_14)
PKG_CONFIG_USE_DEPENDENCY(dynamic-hrp2_14 hrp2-dynamics)
ENDIF()
IF (hrp2-10-optimized_FOUND)
IF (HRP2_10_OPTIMIZED_FOUND)
MESSAGE(STATUS "Add dynamic-hrp2_10 plugin")
COMPILE_PLUGIN(dynamic-hrp2_10 dynamic-hrp2_10.cc DynamicHrp2_10)
PKG_CONFIG_USE_DEPENDENCY(dynamic-hrp2_10 hrp2-10-optimized)
ENDIF()
IF (hrp2-10-optimized_FOUND)
IF (HRP2_10_OPTIMIZED_FOUND)
CONFIG_FILES(dynamic_graph/sot/hrp2_10/robot.py)
ENDIF()
IF (hrp2-dynamics_FOUND)
IF (HRP2_DYNAMICS_FOUND)
CONFIG_FILES(dynamic_graph/sot/hrp2_14/robot.py)
ENDIF()
......@@ -71,7 +73,7 @@ PYTHON_INSTALL_ON_SITE("${PYTHON_MODULE}" "hrp2.py" )
SET(FILES __init__.py robot.py)
# Install dynamic_graph.sot.hrp2_14
IF (hrp2-dynamics_FOUND)
IF (HRP2_DYNAMICS_FOUND)
SET(PYTHON_MODULE dynamic_graph/sot/hrp2_14)
PYTHON_INSTALL_ON_SITE("${PYTHON_MODULE}" "__init__.py" )
PYTHON_INSTALL_BUILD("${PYTHON_MODULE}" "robot.py" "${PYTHON_SITELIB}")
......@@ -79,7 +81,7 @@ IF (hrp2-dynamics_FOUND)
ENDIF()
# Install dynamic_graph.sot.hrp2_10
IF (hrp2-10-optimized_FOUND)
IF (HRP2_10_OPTIMIZED_FOUND)
SET(PYTHON_MODULE dynamic_graph/sot/hrp2_10)
PYTHON_INSTALL_ON_SITE("${PYTHON_MODULE}" "__init__.py" )
PYTHON_INSTALL_BUILD("${PYTHON_MODULE}" "robot.py" "${PYTHON_SITELIB}")
......@@ -149,11 +151,11 @@ MACRO(build_hrp2_controller robotnumber)
ENDMACRO()
IF (hrp2-10-optimized_FOUND)
IF (HRP2_10_OPTIMIZED_FOUND)
build_hrp2_controller("10")
ENDIF()
IF (hrp2-dynamics_FOUND)
IF (HRP2_DYNAMICS_FOUND)
build_hrp2_controller("14")
ENDIF()
......@@ -172,10 +172,9 @@ void SoTHRP2Device::getControl(map<string,dgsot::ControlValues> &controlOut)
sotDEBUGIN(25) ;
vector<double> anglesOut;
anglesOut.resize(state_.size());
// Integrate control
increment(timestep_);
sotDEBUG (25) << "state = " << state_ << std::endl;
sotDEBUG (25) << "diff = " << ((previousState_.size() == state_.size())?
(state_ - previousState_) : state_ ) << std::endl;
......@@ -188,7 +187,7 @@ void SoTHRP2Device::getControl(map<string,dgsot::ControlValues> &controlOut)
for(unsigned int i=6; i < state_.size();++i)
anglesOut[i-6] = state_(i);
controlOut["joints"].setValues(anglesOut);
// Read zmp reference from input signal if plugged
int time = controlSIN.getTime ();
zmpSIN.recompute (time + 1);
......@@ -206,7 +205,7 @@ void SoTHRP2Device::getControl(map<string,dgsot::ControlValues> &controlOut)
controlOut["zmp"].setName("zmp");
controlOut["zmp"].setValues(ZMPRef);
// Update position of freeflyer in global frame
for (int i = 0;i < 3; ++i)
baseff_[i*4+3] = freeFlyerPose () (i, 3);
......
Markdown is supported
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