Skip to content
Snippets Groups Projects
Commit 88988348 authored by Joan Solà Ortega's avatar Joan Solà Ortega
Browse files

Add filename parameter to API

parent 545a60ea
No related branches found
No related tags found
2 merge requests!31devel->main,!30Complete UAV identification setup
......@@ -69,11 +69,11 @@ class Test_SimulationProblemForceTorqueInertialDynamics_yaml : public testing::T
std::vector<Quaterniond> quaternion;
protected:
void ExtractAndCompleteData()
void extractAndCompleteData(const std::string& file_path_name)
{
Vector3d position_i, vlin_i, vang_i, force_i, torque_i, a_meas_i;
std::ifstream data_simulation;
string data_file = "/home/asanjuan/dev/wolf_lib/bodydynamics/test/dades_simulacio_pep.csv";
string data_file = file_path_name;
data_simulation.open(data_file, std::ios::in);
string line_data;
char delimiter = ',';
......@@ -199,14 +199,15 @@ class Test_SimulationProblemForceTorqueInertialDynamics_yaml : public testing::T
void SetUp() override
{
ExtractAndCompleteData();
std::string wolf_bodydynamics_root = _WOLF_BODYDYNAMICS_ROOT_DIR;
extractAndCompleteData(wolf_bodydynamics_root + "/test/dades_simulacio_pep.csv");
std::string wolf_root = _WOLF_BODYDYNAMICS_ROOT_DIR;
ParserYaml parser =
ParserYaml("problem_force_torque_inertial_dynamics_simulation_test.yaml", wolf_root + "/test/yaml/");
ParserYaml("problem_force_torque_inertial_dynamics_simulation_test.yaml", wolf_bodydynamics_root + "/test/yaml/");
ParamsServer server = ParamsServer(parser.getParams());
P = Problem::autoSetup(server);
// CERES WRAPPER
solver = std::make_shared<SolverCeres>(P);
// solver->getSolverOptions().max_num_iterations = 1e4;
// solver->getSolverOptions().function_tolerance = 1e-15;
......@@ -233,12 +234,13 @@ TEST_F(Test_SimulationProblemForceTorqueInertialDynamics_yaml, simulation)
{
// Calibration params
Vector6d bias_guess(Vector6d::Zero());
S->getStateBlock('I')->setState(bias_guess);
Vector3d cdm_guess(0.005, 0.005, 0.1);
S->getStateBlock('C')->setState(cdm_guess);
Vector3d inertia_guess(0.01, 0.01, 0.02);
S->getStateBlock('i')->setState(inertia_guess);
double mass_guess = 1.5;
S->getStateBlock('I')->setState(bias_guess);
S->getStateBlock('C')->setState(cdm_guess);
S->getStateBlock('i')->setState(inertia_guess);
S->getStateBlock('m')->setState(Vector1d(mass_guess));
S->getStateBlock('P')->fix();
......
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