35 ROS_INFO_STREAM(
"Pose prediction is run for scene " << pattern_name <<
" with " << percentage_of_records_for_prediction <<
" times the demonstration trajectory lengths.");
36 ROS_INFO_STREAM(
"It is run for a reference with the pose " << reference_pose <<
".");
42 x.push_back(
IsmObject (pattern_name,
"MOCK"));
44 ROS_DEBUG_STREAM_NAMED(
"ShortestPath",
"These are shortest paths for unfound objects in scene" << pattern_name <<
":");
59 for (
IsmObject object : objects_in_pattern)
63 ROS_DEBUG_STREAM_NAMED(
"ShortestPath",
"Save shortest path in map for non-reference Object: " <<
"(" <<
object.first <<
"," <<
object.second <<
")");
64 predecessors.push_back(
object);
65 std::pair<ShortestPathMap::iterator,bool>ret;
66 ret =
shortest_path_map_.insert ( std::pair<IsmObject, IsmObjects>(
object, predecessors));
71 .at(
object.second).size();
75 ROS_DEBUG_STREAM_NAMED(
"ShortestPath",
"Object " <<
"(" <<
object.first <<
"," <<
object.second <<
")" <<
" already has a path");
78 predecessors.pop_back();
87 for (
IsmObject object : objects_in_pattern)
91 ROS_DEBUG_STREAM_NAMED(
"ShortesPath",
"Call createShortestPathMap for reference: " <<
"(" <<
object.first <<
"," <<
object.second <<
")");
92 predecessors.push_back(
object);
94 predecessors.pop_back();
100 ROS_DEBUG_NAMED(
"ShortesPath",
"ShortesPath::createAttributedPointCloud");
108 ROS_DEBUG_NAMED(
"ShortesPath",
"ShortesPath: generated poses, threshold: %f", ceil(percentage_of_records_for_prediction *
average_votes_ * prediction_generation_factor_));
109 IsmObject object = shortest_path_it->first;
110 IsmObjects predecessors = shortest_path_it->second;
111 ROS_DEBUG_STREAM_NAMED(
"ShortesPath",
"ISMOBject: " <<
"(" <<
object.first <<
"," <<
object.second <<
")");
113 ROS_DEBUG_STREAM_NAMED(
"ShortesPath",
"predecessors: " <<
"(" << temp_obj.first <<
"," << temp_obj.second <<
")");
117 for (
unsigned int i = 0; i < threshold ; ++i)
119 ISM::PosePtr object_pose_ptr =
predictPose(reference_pose_ptr, predecessors);
131 IsmObject object = shortest_path_it->first;
132 IsmObjects predecessors = shortest_path_it->second;
133 ROS_DEBUG_STREAM_NAMED(
"ShortestPath",
"Unfound object " <<
"(" <<
object.first <<
"," <<
object.second <<
")" <<
" has " << predecessors.size() <<
" predecessors in path to reference:");
ISM::PatternToObjectToVoteMap votes_
void addPointToPointCloud(ISM::PosePtr pose_to_add, std::string type, std::string identifier)
RecognizerPredictionISM::addPointToPointCloud Adds an ISM Pose with object type and identifier as att...
void createAttributedPointCloud(ISM::PosePtr reference_pose_ptr, double percentage_of_records_for_prediction)
#define ROS_DEBUG_STREAM_NAMED(name, args)
void createShortestPathMap(std::string type, IsmObjects paths)
AttributedPointCloud attributed_point_cloud_
AttributedPointCloud predictUnfoundPoses(ISM::PosePtr &reference_pose, std::string pattern_name, double percentage_of_records_for_prediction)
predictUnfoundPoses Processes the following steps for each object in the objectpattern set...
void printShortestPaths()
std::set< IsmObject > IsmObjectSet
ShortestPath(std::string database_filename)
#define ROS_DEBUG_NAMED(name,...)
ISM::PosePtr predictPose(ISM::PosePtr reference_pose_ptr, IsmObjects path_to_object)
#define ROS_DEBUG_STREAM_COND_NAMED(cond, name, args)
SizeMap specifiers_size_map_
std::pair< std::string, std::string > IsmObject
double prediction_generation_factor_
bool isReferenceObject(IsmObject object)
#define ROS_INFO_STREAM(args)
std::vector< IsmObject > IsmObjects
ShortestPathMap shortest_path_map_
bool isFoundObject(IsmObject object)
IsmObjectSet getObjectTypesAndIdsBelongingToPattern(std::string type)
asr_msgs::AsrAttributedPointCloud AttributedPointCloud