test_structured_optimal_control_problem.cpp
Go to the documentation of this file.
1 /*********************************************************************
2  *
3  * Software License Agreement
4  *
5  * Copyright (c) 2018,
6  * TU Dortmund - Institute of Control Theory and Systems Engineering.
7  * All rights reserved.
8  *
9  * This software is currently not released.
10  * Redistribution and use in source and binary forms,
11  * with or without modification, are prohibited.
12  *
13  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
14  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
15  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
16  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
17  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
18  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
19  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
21  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
23  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24  * POSSIBILITY OF SUCH DAMAGE.
25  *
26  * Authors: Christoph Rösmann
27  *********************************************************************/
28 
29 #include <corbo-optimization/optimal_control/structured_optimal_control_problem.h>
30 
32 
33 #include <corbo-core/console.h>
34 #include <corbo-core/macros.h>
36 
37 #include "gtest/gtest.h"
38 
39 // using corbo::FullDiscretizationGrid;
40 // using corbo::StaticReference;
41 // using corbo::ZeroReference;
42 // using corbo::VectorVertex;
43 
44 class StructuredOptimalControlProblem : public testing::Test
45 {
46  protected:
47  // You can do set-up work for each test here.
49  // You can do clean-up work that doesn't throw exceptions here.
51  // If the constructor and destructor are not enough for setting up
52  // and cleaning up each test, you can define the following methods:
53 
54  // Code here will be called immediately after the constructor (right
55  // before each test).
56  void SetUp() override {}
57  // Code here will be called immediately after each test (right
58  // before the destructor).
59  // virtual void TearDown();
60 
61  // FullDiscretizationGrid grid;
62 };
63 
64 // TEST_F(TestFullDiscretizationGrid, initialize_grid)
65 //{
66 // Eigen::Vector2d x0(0, 1);
67 // Eigen::VectorXd u_ref(1);
68 // u_ref[0] = -1;
69 
70 // StaticReference xref(Eigen::Vector2d(6, 4));
71 // StaticReference uref(u_ref);
72 
73 // corbo::IntegratorSystem::Ptr system = std::make_shared<corbo::IntegratorSystem>(2);
74 
75 // grid.setDt(0.1);
76 // grid.setNumStates(4);
77 
78 // grid.initialize(x0, xref, uref, system);
79 
80 // // check state inputs
81 // EXPECT_EQ(grid.getStateSequence().size(), 3);
82 // EXPECT_DOUBLE_EQ(grid.getStateSequence()[0].values()[0], 0.0);
83 // EXPECT_DOUBLE_EQ(grid.getStateSequence()[0].values()[1], 1.0);
84 // EXPECT_DOUBLE_EQ(grid.getStateSequence()[1].values()[0], 2.0);
85 // EXPECT_DOUBLE_EQ(grid.getStateSequence()[1].values()[1], 2.0);
86 // EXPECT_DOUBLE_EQ(grid.getStateSequence()[2].values()[0], 4.0);
87 // EXPECT_DOUBLE_EQ(grid.getStateSequence()[2].values()[1], 3.0);
88 // EXPECT_DOUBLE_EQ(grid.getFinalState().values()[0], 6.0);
89 // EXPECT_DOUBLE_EQ(grid.getFinalState().values()[1], 4.0);
90 
91 // EXPECT_EQ(grid.getStateSequence().front().getDimensionUnfixed(), 0);
92 // EXPECT_EQ(grid.getFinalState().getDimensionUnfixed(), 2);
93 
94 // // check control inputs
95 // EXPECT_EQ(grid.getControlSequence().size(), 3);
96 // for (const VectorVertex& vertex : grid.getControlSequence())
97 // {
98 // EXPECT_DOUBLE_EQ(vertex.values()[0], -1);
99 // }
100 //}
StructuredOptimalControlProblem
Definition: test_structured_optimal_control_problem.cpp:44
macros.h
console.h
StructuredOptimalControlProblem::StructuredOptimalControlProblem
StructuredOptimalControlProblem()
Definition: test_structured_optimal_control_problem.cpp:74
value_comparison.h
StructuredOptimalControlProblem::~StructuredOptimalControlProblem
virtual ~StructuredOptimalControlProblem()
Definition: test_structured_optimal_control_problem.cpp:76
StructuredOptimalControlProblem::SetUp
void SetUp() override
Definition: test_structured_optimal_control_problem.cpp:82
reference_trajectory.h


control_box_rst
Author(s): Christoph Rösmann
autogenerated on Wed Mar 2 2022 00:07:06