TrajectoryParametrizationFactory.cpp
Go to the documentation of this file.
1/**
2 * This file is part of ArmarX.
3 *
4 * ArmarX is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * ArmarX is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * @author Fabian Reister ( fabian dot reister at kit dot edu )
17 * @date 2026
18 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
19 * GNU General Public License
20 */
21
23
24#include <memory>
25
27
30
32{
33
35 TrajectoryParametrizationFactory::create(const core::GeneralConfig& generalConfig,
36 const algorithms::Toppra::DriveParams& drive)
37 {
38 switch (generalConfig.parametrization)
39 {
41 return std::make_shared<algorithms::NoParametrization>();
42
44 return std::make_shared<algorithms::Ramping>(generalConfig);
45
47 // Constructed even when the python side is missing: it reports the reason from
48 // apply(), which keeps this switch free of preprocessor branches.
50 {
51 ARMARX_WARNING << "TOPP-RA parametrization was configured but is not "
52 "available: "
54 << ". Planning will fail when it is used.";
55 }
56
57 return std::make_shared<algorithms::Toppra>(generalConfig, drive);
58 }
59
60 ARMARX_ERROR << "switch-case not comprehensive!";
61
62 return std::make_shared<algorithms::Ramping>(generalConfig);
63 }
64
65} // namespace armarx::navigation::fac
static bool available()
Whether the python side was found at configure time. False means apply() throws.
Definition Toppra.cpp:217
static std::string unavailableReason()
Why it is unavailable, as recorded at configure time. Empty when available.
Definition Toppra.cpp:227
#define ARMARX_ERROR
The logging level for unexpected behaviour, that must be fixed.
Definition Logging.h:194
#define ARMARX_WARNING
The logging level for unexpected behaviour, but not a serious problem.
Definition Logging.h:191
std::shared_ptr< TrajectoryParametrization > TrajectoryParametrizationPtr
@ Ramping
Ramp down at the start, the goal and every corner. The stack's historical behaviour.
@ Toppra
Time-optimal under per-motor torque and command-ramp limits.
This file is part of ArmarX.