Commit 8a6ebb77 authored by olivier-stasse's avatar olivier-stasse
Browse files

Correct tests to accept the sample humanoid robot specific case.

parent 5dbd452a
......@@ -16,40 +16,61 @@
ADD_DEFINITIONS(-DDEBUG=2)
SET(tests
dummy
test_djj
test_dyn
test_results)
dummy
test_djj
test_dyn
test_results)
SET(test_dyn_plugins_dependencies dynamic)
# getting the information for the robot.
SET(samplemodelpath ${JRL_DYNAMICS_PKGDATAROOTDIR}/examples/data/)
SET(samplespec
${JRL_DYNAMICS_PKGDATAROOTDIR}/examples/data/sampleSpecificities.xml
)
SET(sampleljr
${JRL_DYNAMICS_PKGDATAROOTDIR}/examples/data/sampleLinkJointRank.xml
)
SET(sampleinitconfig
${JRL_DYNAMICS_PKGDATAROOTDIR}/examples/data/sampleInitConfig.dat)
LIST(APPEND LOGGING_WATCHED_VARIABLES samplespec sampleljr)
FOREACH(test ${tests})
SET(EXECUTABLE_NAME "${test}_exe")
ADD_EXECUTABLE(${EXECUTABLE_NAME}
${test}.cpp)
TARGET_LINK_LIBRARIES(${EXECUTABLE_NAME}
zmpreffromcom
force-compensation
integrator-force-exact
mass-apparent
integrator-force-rk4
integrator-force
angle-estimator
waist-attitude-from-sensor
)
PKG_CONFIG_USE_DEPENDENCY(${EXECUTABLE_NAME} jrl-dynamics)
PKG_CONFIG_USE_DEPENDENCY(${EXECUTABLE_NAME} hrp2-dynamics)
PKG_CONFIG_USE_DEPENDENCY(${EXECUTABLE_NAME} sot-core)
PKG_CONFIG_USE_DEPENDENCY(${EXECUTABLE_NAME} dynamic-graph)
PKG_CONFIG_USE_DEPENDENCY(${EXECUTABLE_NAME} jrl-mal)
IF(${test}_plugins_dependencies)
ADD_DEPENDENCIES(${EXECUTABLE_NAME} "${${test}_plugins_dependencies}")
TARGET_LINK_LIBRARIES(${EXECUTABLE_NAME} "${${test}_plugins_dependencies}")
ENDIF(${test}_plugins_dependencies)
ADD_TEST(${test} ${EXECUTABLE_NAME})
SET(EXECUTABLE_NAME "${test}_exe")
ADD_EXECUTABLE(${EXECUTABLE_NAME}
${test}.cpp)
TARGET_LINK_LIBRARIES(${EXECUTABLE_NAME}
zmpreffromcom
force-compensation
integrator-force-exact
mass-apparent
integrator-force-rk4
integrator-force
angle-estimator
waist-attitude-from-sensor
)
PKG_CONFIG_USE_DEPENDENCY(${EXECUTABLE_NAME} jrl-dynamics)
PKG_CONFIG_USE_DEPENDENCY(${EXECUTABLE_NAME} hrp2-dynamics)
PKG_CONFIG_USE_DEPENDENCY(${EXECUTABLE_NAME} sot-core)
PKG_CONFIG_USE_DEPENDENCY(${EXECUTABLE_NAME} dynamic-graph)
PKG_CONFIG_USE_DEPENDENCY(${EXECUTABLE_NAME} jrl-mal)
IF(${test}_plugins_dependencies)
ADD_DEPENDENCIES(${EXECUTABLE_NAME} "${${test}_plugins_dependencies}")
TARGET_LINK_LIBRARIES(${EXECUTABLE_NAME} "${${test}_plugins_dependencies}")
ENDIF(${test}_plugins_dependencies)
ADD_TEST(${test} ${EXECUTABLE_NAME}
${samplemodelpath} sample.wrl ${samplespec} ${sampleljr} )
IF (UNIX)
SET_PROPERTY(TEST ${test} PROPERTY
ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_BINARY_DIR}/src")
ENDIF(UNIX)
ENDFOREACH(test)
......@@ -225,4 +225,5 @@ int main(int argc, char *argv[])
// The End!
delete aHDR;
return true;
}
......@@ -28,28 +28,38 @@
using namespace std;
using namespace sot;
int main( void )
int main(int argc, char * argv[])
{
if (argc!=5)
{
cerr << "Usage:" << endl;
cerr << "./" << argv[0] << " DIR_OF_VRML_MODEL VRML_MODEL_FILENAME PATH_TO_SPECIFICITIES_FILE PATH_TO_LINK2JOINT_FILE " << endl;
cerr << " DIR_OF_VRML_MODEL : Directory where the robot VRML model lies. "<< endl;
cerr << " VRML_MODEL_FILENAME : Filename of the VRML model describing the robot." << endl;
cerr << " PATH_TO_SPECIFICITIES_FILE : Path to the file describing the humanoid robot specificities." << endl;
cerr << " PATH_TO_LINK2JOINT_FILE: Path to the file describing the relationship of the joint and the state vector." << endl;
}
Dynamic * dyn = new Dynamic("tot");
try {
dyn->setVrmlDirectory("~/src/OpenHRP/etc/HRP2JRL/");
dyn->setXmlSpecificityFile("~/src/PatternGeneratorJRL/src/data/HRP2Specificities.xml");
dyn->setXmlRankFile("~/src/PatternGeneratorJRL/src/data/HRP2LinkJointRank.xml");
dyn->setVrmlMainFile("HRP2JRLmain.wrl");
dyn->parseConfigFiles();
} catch (sot::ExceptionDynamic& e)
{
if ( !strcmp(e.what(), "Error while parsing." )) {
cout << "Could not locate the necessary files for this test" << endl;
return 77;
}
else
// rethrow
throw e;
}
try
{
dyn->setVrmlDirectory(argv[1]);
dyn->setXmlSpecificityFile(argv[3]);
dyn->setXmlRankFile(argv[4]);
dyn->setVrmlMainFile(argv[2]);
dyn->parseConfigFiles();
}
catch (sot::ExceptionDynamic& e)
{
if ( !strcmp(e.what(), "Error while parsing." )) {
cout << "Could not locate the necessary files for this test" << endl;
return 77;
}
else
// rethrow
throw e;
}
istringstream iss;
string help("help");
......
......@@ -41,11 +41,11 @@ using namespace std;
int main(int argc, char * argv[])
{
if (argc!=5)
if (argc!=6)
{
cerr << " This program takes 4 arguments: " << endl;
cerr << "./TestHumanoidDynamicRobot PATH_TO_VRML_FILE VRML_FILE_NAME "<< endl;
cerr << " PATH_TO_SPECIFICITIES_XML PATH PATH_TO_MAP_JOINT_2_RANK" << endl;
cerr << " PATH_TO_SPECIFICITIES_XML PATH PATH_TO_MAP_JOINT_2_RANK INITIAL_CONFIGURATION_FILE" << endl;
exit(0);
}
......
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