COPP C++ API
C++ interface for COPP trajectory optimization
Loading...
Searching...
No Matches
topp2_ra.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <cstddef>
4#include <vector>
5
6#include "copp/core.hpp"
7#include "copp/robot.hpp"
8
10{
11
20 struct Options
21 {
22 double lp_feas_tol = 1.0e-8;
23 double a_cmp_abs_tol = 1.0e-8;
24 double a_cmp_rel_tol = 1.0e-8;
26 };
27
32 struct ReachSet
33 {
34 std::vector<double> a_max;
35 std::vector<double> a_min;
36
37 std::size_t len() const noexcept { return a_max.size(); }
38 bool empty() const noexcept { return a_max.empty(); }
39 };
40
48 {
49 public:
54
55 ConstraintsRef constraints() const noexcept { return constraints_; }
56 IndexInterval idx_s_interval() const noexcept { return idx_s_interval_; }
57 Boundary2 a_boundary() const noexcept { return a_boundary_; }
58 std::size_t s_len() const noexcept { return s_len_; }
59
60 private:
61 ConstraintsRef constraints_;
62 IndexInterval idx_s_interval_;
63 Boundary2 a_boundary_;
64 std::size_t s_len_ = 0;
65 };
66
73 COPP_API ReachSet reach_set_backward(const Problem &problem, const Options &options = {});
75 const Problem &problem,
76 const Options &options,
78 {
79 return detail::expected_from([&] { return reach_set_backward(problem, options); });
80 }
82 {
83 return reach_set_backward(problem, Options{}, tag);
84 }
85
90 COPP_API ReachSet reach_set_bidirectional(const Problem &problem, const Options &options = {});
92 const Problem &problem,
93 const Options &options,
95 {
96 return detail::expected_from([&] { return reach_set_bidirectional(problem, options); });
97 }
99 {
100 return reach_set_bidirectional(problem, Options{}, tag);
101 }
102
116 COPP_API std::vector<double> solve(const Problem &problem, const Options &options = {});
118 const Problem &problem,
119 const Options &options,
121 {
122 return detail::expected_from([&] { return solve(problem, options); });
123 }
125 {
126 return solve(problem, Options{}, tag);
127 }
128
129} // namespace copp::solver::topp2_ra
Non-owning view of a Rust-backed constraint buffer.
Definition robot.hpp:86
Small C++17 expected-like result used by no-throw overloads.
Definition core.hpp:527
TOPP2 problem descriptor.
Definition topp2_ra.hpp:48
IndexInterval idx_s_interval() const noexcept
Definition topp2_ra.hpp:56
ConstraintsRef constraints() const noexcept
Definition topp2_ra.hpp:55
Problem(ConstraintsRef constraints, IndexInterval idx_s_interval, Boundary2 a_boundary={})
std::size_t s_len() const noexcept
Definition topp2_ra.hpp:58
Boundary2 a_boundary() const noexcept
Definition topp2_ra.hpp:57
#define COPP_API
Definition core.hpp:23
auto expected_from(Fn &&fn) -> Expected< typename std::decay< decltype(fn())>::type >
Definition core.hpp:580
Second-order time-optimal reachability-analysis solver plus second-order reachable-set artifacts and ...
COPP_API ReachSet reach_set_bidirectional(const Problem &problem, const Options &options={})
Compute bidirectional TOPP2 reachable intervals, enforcing both boundaries.
COPP_API std::vector< double > solve(const Problem &problem, const Options &options={})
Solve TOPP2 with reachability analysis.
COPP_API ReachSet reach_set_backward(const Problem &problem, const Options &options={})
Compute backward-only TOPP2 reachable intervals.
Verbosity
Diagnostic verbosity for solver algorithms.
Definition core.hpp:47
Second-order endpoint boundary values.
Definition core.hpp:77
Closed station-index interval used by TOPP/COPP problem descriptors.
Definition core.hpp:67
Tag object selecting no-throw overloads.
Definition core.hpp:608
Options shared by TOPP2-RA and TOPP2 reachable-set construction.
Definition topp2_ra.hpp:21
Reachable interval result for second-order state a = (ds/dt)^2.
Definition topp2_ra.hpp:33
std::vector< double > a_min
Definition topp2_ra.hpp:35
std::size_t len() const noexcept
Definition topp2_ra.hpp:37
bool empty() const noexcept
Definition topp2_ra.hpp:38
std::vector< double > a_max
Definition topp2_ra.hpp:34