Skip to content

Commit

Permalink
Added test application for loading additional views
Browse files Browse the repository at this point in the history
  • Loading branch information
RaresAmbrus committed Apr 13, 2016
1 parent e2acaeb commit ded4fa1
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 1 deletion.
11 changes: 10 additions & 1 deletion metaroom_xml_parser/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ add_executable(load_labelled_data src/load_labelled_data.cpp )

add_executable(test_dynamic_object_parser src/test_dynamic_object_parser.cpp )

add_executable(load_additional_views src/load_additional_views_main.cpp )

target_link_libraries(metaroom_xml_parser
${catkin_LIBRARIES}
${PCL_LIBRARIES}
Expand Down Expand Up @@ -84,11 +86,18 @@ add_executable(test_dynamic_object_parser src/test_dynamic_object_parser.cpp )
metaroom_xml_parser
)

target_link_libraries(load_additional_views
${catkin_LIBRARIES}
${PCL_LIBRARIES}
${QT_LIBRARIES}
metaroom_xml_parser
)



############################# INSTALL TARGETS

install(TARGETS metaroom_xml_parser load_single_file load_multiple_files load_labelled_data
install(TARGETS metaroom_xml_parser load_single_file load_multiple_files load_labelled_data test_dynamic_object_parser load_additional_views
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
Expand Down
41 changes: 41 additions & 0 deletions metaroom_xml_parser/src/load_additional_views_main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#include <metaroom_xml_parser/simple_summary_parser.h>
#include <metaroom_xml_parser/simple_xml_parser.h>
#include <metaroom_xml_parser/simple_dynamic_object_parser.h>
#include <metaroom_xml_parser/load_utilities.h>

typedef pcl::PointXYZRGB PointType;
typedef semantic_map_load_utilties::DynamicObjectData<PointType> ObjectData;

typedef pcl::PointCloud<PointType> Cloud;
typedef typename Cloud::Ptr CloudPtr;

using namespace std;

int main(int argc, char** argv)
{
string folder;


if (argc > 1){
folder = argv[1];
} else {
cout<<"Please specify the folder from where to load the data."<<endl;
return -1;
}

cout<<"Looking for sweeps..."<<endl;
vector<string> sweep_xmls = semantic_map_load_utilties::getSweepXmls<PointType>(folder);
cout<<sweep_xmls.size()<<" sweeps found."<<endl;

for (string sweep : sweep_xmls){

cout<<"Sweep "<<sweep<<endl;

vector<ObjectData> objects = semantic_map_load_utilties::loadAllDynamicObjectsFromSingleSweep<PointType>(sweep);
cout<<"Found "<<objects.size()<<" objects"<<endl;
for (size_t k=0; k<objects.size(); k++){
auto object = objects[k];
cout<<"Object "<<k<<" has "<<object.vAdditionalViews.size()<<" additional views"<<endl;
}
}
}

0 comments on commit ded4fa1

Please sign in to comment.