Skip to content
Snippets Groups Projects
Commit 30eb47a9 authored by Joaquim Casals Buñuel's avatar Joaquim Casals Buñuel
Browse files

Fixed compile errors

parent 960fc9b9
No related branches found
No related tags found
1 merge request!260WIP: params autoconf
Pipeline #2589 passed
...@@ -4,11 +4,9 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) ...@@ -4,11 +4,9 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
# ADD_EXECUTABLE(hello_plugin hello_plugin.cpp sensor_odom_2D.cpp processor_odom_2D.cpp) # ADD_EXECUTABLE(hello_plugin hello_plugin.cpp sensor_odom_2D.cpp processor_odom_2D.cpp)
ADD_EXECUTABLE(hello_plugin hello_plugin.cpp) ADD_EXECUTABLE(hello_plugin hello_plugin.cpp)
ADD_EXECUTABLE(params_autoconf params_autoconf.cpp)
# target_link_libraries(hello_plugin class_loader boost_system console_bridge wolf yaml-cpp ${CERES_LIBRARIES}) # target_link_libraries(hello_plugin class_loader boost_system console_bridge wolf yaml-cpp ${CERES_LIBRARIES})
# target_link_libraries(params_autoconf class_loader boost_system console_bridge wolf yaml-cpp ) # target_link_libraries(params_autoconf class_loader boost_system console_bridge wolf yaml-cpp )
target_link_libraries(hello_plugin boost_system wolf yaml-cpp ${CERES_LIBRARIES} dl) target_link_libraries(hello_plugin wolf yaml-cpp ${CERES_LIBRARIES} dl)
target_link_libraries(params_autoconf boost_system wolf yaml-cpp dl)
# These lines always at the end # These lines always at the end
SET(HDRS_PLUGIN ${HDRS_PLUGIN} PARENT_SCOPE ) SET(HDRS_PLUGIN ${HDRS_PLUGIN} PARENT_SCOPE )
SET(SRCS_PLUGIN ${SRCS_PLUGIN} PARENT_SCOPE ) SET(SRCS_PLUGIN ${SRCS_PLUGIN} PARENT_SCOPE )
......
/*
* params_autoconf.cpp
*
* Created on: Feb 15, 2019
* Author: jcasals
*/
#include "base/sensor/sensor_base.h"
#include "base/wolf.h"
// #include "sensor_odom_2D.cpp"
#include <yaml-cpp/yaml.h>
#include "base/yaml/parser_yaml.hpp"
#include "base/params_server.hpp"
#include "../hello_wolf/capture_range_bearing.h"
#include "../hello_wolf/feature_range_bearing.h"
#include "../hello_wolf/constraint_range_bearing.h"
#include "../hello_wolf/landmark_point_2D.h"
#include "loader.hpp"
#include "base/processor/processor_odom_2D.h"
#include "base/solver/solver_factory.h"
#include "base/ceres_wrapper/ceres_manager.h"
using namespace std;
using namespace wolf;
using namespace Eigen;
int main(int argc, char** argv) {
string file = "";
if(argc > 1) file = argv[1];
parserYAML parser = parserYAML(file);
parser.parse();
paramsServer server = paramsServer(parser.getParams(), parser.sensorsSerialization(), parser.processorsSerialization());
cout << "PRINTING SERVER MAP" << endl;
server.print();
cout << "-----------------------------------" << endl;
/**
It seems to be a requirement that each file is loaded by its own ClassLoader object, otherwise I get
a segmentation fault. Likewise, it seems that these ClassLoaders must be allocated at the heap, because
the constructor refuses to build an object if I try to do local (stack) allocation, i.e `ClassLoader(it)` is not allowed but `new ClassLoader(it)` is.
**/
auto loaders = vector<Loader*>();
for(auto it : parser.getFiles()) {
auto l = new LoaderRaw(it);
loaders.push_back(l);
}
ProblemPtr problem = Problem::create("PO 2D");
auto sensorMap = map<string, SensorBasePtr>();
auto procesorMap = map<string, ProcessorBasePtr>();
for(auto s : server.getSensors()){
cout << s._name << " " << s._type << endl;
sensorMap.insert(pair<string, SensorBasePtr>(s._name,problem->installSensor(s._type, s._name, server)));
}
for(auto s : server.getProcessors()){
cout << s._name << " " << s._type << " " << s._name_assoc_sensor << endl;
procesorMap.insert(pair<string, ProcessorBasePtr>(s._name,problem->installProcessor(s._type, s._name, s._name_assoc_sensor, server)));
}
auto prc = ProcessorParamsOdom2D("my_proc_test", server);
std::cout << "prc.cov_det " << prc.cov_det << std::endl;
std::cout << "prc.unmeasured_perturbation_std " << prc.unmeasured_perturbation_std << std::endl;
std::cout << "prc.angle_turned " << prc.angle_turned << std::endl;
std::cout << "prc.dist_traveled " << prc.dist_traveled << std::endl;
std::cout << "prc.max_buff_length " << prc.max_buff_length << std::endl;
std::cout << "prc.max_time_span " << prc.max_time_span << std::endl;
std::cout << "prc.time_tolerance " << prc.time_tolerance << std::endl;
std::cout << "prc.voting_active " << prc.voting_active << std::endl;
return 0;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment