24 , mPrivateNamespaceHandle(
"~")
25 , mSceneName(pSceneName)
62 unsigned int trajectoryLength = pParent->mObjectSet->objects.size();
66 if(trajectoryLength != pChild->mObjectSet->objects.size())
67 throw std::runtime_error(
"Shape term learner: the observation trajectories of child and parent node don't have the same length. This indicates a bug in the scene_graph_generator.");
99 for(
unsigned int i = 0; i < trajectoryLength; i++)
107 childPose->convertPoseIntoFrame(parentPose, relativePoseToParent);
110 learnerPosition.
addDatum(relativePoseToParent->point->getEigen());
111 learnerOrientation.
addDatum(relativePoseToParent->quat->getEigen());
116 ROS_INFO(
"Learning gaussian mixture model over position.");
117 learnerPosition.
learn();
118 learnerPosition.
getModel(pChild->mGaussianMixtureModelPosition);
121 ROS_INFO(
"Learning gaussian mixture model over orientation.");
122 learnerOrientation.
learn();
123 learnerOrientation.
getModel(pChild->mGaussianMixtureModelOrientation);
135 if(!localNamespaceHandle.
getParam(pParameterName, pParameter))
137 ROS_DEBUG_STREAM(
"Could not find parameter " <<
"~/" <<
mSceneName <<
"/" << pParameterName <<
". Using unspecific namespace instead.");
139 throw std::runtime_error(
"Please specify parameter " + pParameterName +
" when starting this node.");
145 double tempParameter;
147 pParameter = (int) tempParameter;
void getModel(GaussianMixtureModel &gmm)
void getParameter(std::string pParameterName, double &pParameter)
void addDatum(Eigen::Vector3d pSample)
void learnNodePose(boost::shared_ptr< OcmTree > pParent, boost::shared_ptr< OcmTree > pChild)
ShapeTermLearner(std::string pSceneName="")
int mNumberOfSyntheticSamples
#define ROS_DEBUG_STREAM(args)
void learn(boost::shared_ptr< OcmModel > pModel)
double mIntervalOrientation
bool getParam(const std::string &key, std::string &s) const
std::string mPathOrientationPlots
ros::NodeHandle mPrivateNamespaceHandle