Commit 4eae9c4d authored by florent's avatar florent Committed by florent
Browse files

Include "kwsioConfig.h" where needed and clean code.

	* include/hppCore/hppProblem.h,
	* src/hppProblem.cpp.
parent ab80dad9
......@@ -10,10 +10,12 @@
#define HPP_PROBLEM_H
#if DEBUG==3
#include "kwsioConfig.h"
#define HPPPROBLEM_ODEBUG3(x) std::cout << "ChppProblem:" << x << std::endl
#define HPPPROBLEM_ODEBUG2(x) std::cout << "ChppProblem:" << x << std::endl
#define HPPPROBLEM_ODEBUG1(x) std::cerr << "ChppProblem:" << x << std::endl
#elif DEBUG==2
#include "kwsioConfig.h"
#define HPPPROBLEM_ODEBUG3(x)
#define HPPPROBLEM_ODEBUG2(x) std::cout << "ChppProblem:" << x << std::endl
#define HPPPROBLEM_ODEBUG1(x) std::cerr << "ChppProblem:" << x << std::endl
......
......@@ -195,32 +195,40 @@ CkwsSteeringMethodShPtr ChppProblem::steeringMethod() const
return attRobot->steeringMethod();
}
// ==========================================================================
ktStatus ChppProblem::checkProblem() const
{
if (!getRobot()) {
ODEBUG1(":solve: no device in problem " << inRank << ".");
ODEBUG1(":checkProblem: no device in problem.");
return KD_ERROR;
}
if (!initConfig()) {
ODEBUG1(":solve: no init config in problem " << inRank << ".");
ODEBUG1(":checkProblem: no init config in problem.");
return KD_ERROR;
}
if (!goalConfig()) {
ODEBUG1(":solve: no goal config in problem " << inRank << ".");
ODEBUG1(":checkProblem: no goal config in problem.");
return KD_ERROR;
}
if(!roadmapBuilder()){
ODEBUG1(":solve: problem Id=" << inRank << ": Define a roadmap builder with penetration");
return KD_ERROR ;
ODEBUG1(":checkProblem: define a roadmap builder with penetration");
return KD_ERROR;
}
if (!steeringMethod()) {
ODEBUG1(":checkProblem: define a steering method.");
return KD_ERROR;
}
/*
Test that goal configuration is valid
*/
if (validateConfig(getRobot(), goalConfig()) != KD_OK) {
ODEBUG1(":solve: goal configuration not valid.");
ODEBUG1("checkProblem:: goal configuration not valid.");
return KD_ERROR;
}
return KD_OK;
......
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