PlanningUtil.h
Go to the documentation of this file.
1/*
2 * This file is part of ArmarX.
3 *
4 * Copyright (C) 2011-2016, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved.
5 *
6 * ArmarX is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * ArmarX is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 *
18 * @package RobotComponents
19 * @author Raphael Grimm ( raphael dot grimm at kit dot edu )
20 * @date 2015
21 * @copyright http://www.gnu.org/licenses/gpl.txt
22 * GNU General Public License
23 */
24#pragma once
25
26#include <chrono>
27#include <string>
28
29#include <RobotComponents/interface/components/MotionPlanning/DataStructures.h>
30
31namespace armarx::TaskStatus
32{
33 /**
34 * @brief Returns the given task status as a string.
35 * @param status The status to return as a string.
36 * @return The given task status as a string.
37 */
38 std::string toString(Status status);
39
40 //status information
41 /**
42 * @brief Returns whether the given task status describes a state where a path is planned.
43 * @param status The status to check.
44 * @return Whether the given task status describes a state where a path is planned.
45 */
46 bool isRunning(Status status);
47 /**
48 * @brief Returns whether the given task status describes a state where planning is done (may be failed).
49 * @param status The status to check.
50 * @return Whether the given task status describes a state where planning is done (may be failed)
51 */
52 bool finishedRunning(Status status);
53
54 //status transition
55 /**
56 * @brief Performs a transition from the given to the appropiate following status in case of a task kill.
57 * @param status The source status for the transition.
58 * @return Returns the following status.
59 */
60 Status transitionAtKill(Status status);
61 /**
62 * @brief Performs a transition from the given to the appropiate following status in case of the task failing.
63 * @param status The source status for the transition.
64 * @return Returns the following status.
65 */
66 Status transitionAtOutoftime(Status status);
67 /**
68 * @brief Performs a transition from the given to the appropiate following status in case the task is done.
69 * @param status The source status for the transition.
70 * @return Returns the following status.
71 */
72 Status transitionAtDone(Status status);
73
74} // namespace armarx::TaskStatus
Status transitionAtDone(Status status)
Performs a transition from the given to the appropiate following status in case the task is done.
bool finishedRunning(Status status)
Returns whether the given task status describes a state where planning is done (may be failed).
bool isRunning(Status status)
Returns whether the given task status describes a state where a path is planned.
std::string toString(Status status)
Returns the given task status as a string.
Status transitionAtOutoftime(Status status)
Performs a transition from the given to the appropiate following status in case of the task failing.
Status transitionAtKill(Status status)
Performs a transition from the given to the appropiate following status in case of a task kill.