io.h
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
22#pragma once
23
24#include <filesystem>
25#include <optional>
26
27#include <SimoxUtility/json/json.hpp>
28
32
33#include "Scene.h"
34#include "reparametrization.h"
35
37{
38
39 /**
40 * @brief Write scene, costmap and planning result as JSON for the python plotting tool.
41 *
42 * The costmap grid is written row-major with rows corresponding to x and columns to y.
43 * Only the bounds and the cell size are written, not per-cell coordinates: the grid is
44 * uniform and axis-aligned, so the reader can reconstruct them.
45 *
46 * An empty result means planning failed; the costmap is written either way so that failures
47 * can still be inspected.
48 *
49 * Every trajectory point additionally carries the maximum permissible velocity that `limit`
50 * reports for its position. Comparing the two is the verification step: if the planner's
51 * post-processing deformed the path without updating the velocities, the actual velocity
52 * exceeds the limit and the point is reported as a violation.
53 */
54 void writeResult(
55 const std::filesystem::path& filename,
56 const Config& config,
57 const algorithms::Costmap& costmap,
58 const std::optional<global_planning::GlobalPlannerResult>& result,
59 const algorithms::ObstacleAwareVelocityLimit& limit,
60 const std::optional<simulation::TrajectoryFollowingSimulation::Result>& simulated,
61 /// TOPPRA's time-parametrized reference, or null for the other parametrization modes.
62 const nlohmann::json& reference,
63 const CommandRampCheck& rampCheck,
64 /// Wall-clock seconds the parametrization took. Reported separately from the planner's
65 /// stage timings, which stop at `plan()` and would otherwise hide it.
66 double parametrizationSeconds);
67
68} // namespace armarx::navigation::analysis
This file is part of ArmarX.
Definition io.cpp:36
void writeResult(const std::filesystem::path &filename, const Config &config, const algorithms::Costmap &costmap, const std::optional< global_planning::GlobalPlannerResult > &result, const algorithms::ObstacleAwareVelocityLimit &limit, const std::optional< simulation::TrajectoryFollowingSimulation::Result > &simulated, const nlohmann::json &reference, const CommandRampCheck &rampCheck, const double parametrizationSeconds)
Write scene, costmap and planning result as JSON for the python plotting tool.
Definition io.cpp:274
How far a velocity profile asks for more than the device command ramp can deliver.
Everything the application needs, as read from the scene description file.
Definition Scene.h:63