planning_response.h
Go to the documentation of this file.
1 /*********************************************************************
2  * Software License Agreement (BSD License)
3  *
4  * Copyright (c) 2012, Willow Garage, Inc.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  * * Redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer.
13  * * Redistributions in binary form must reproduce the above
14  * copyright notice, this list of conditions and the following
15  * disclaimer in the documentation and/or other materials provided
16  * with the distribution.
17  * * Neither the name of Willow Garage nor the names of its
18  * contributors may be used to endorse or promote products derived
19  * from this software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32  * POSSIBILITY OF SUCH DAMAGE.
33  *********************************************************************/
34 
35 /* Author: Ioan Sucan */
36 
37 #pragma once
38 
41 #include <moveit_msgs/MotionPlanResponse.h>
42 #include <moveit_msgs/MotionPlanDetailedResponse.h>
43 
44 namespace planning_interface
45 {
46 struct MotionPlanResponse
47 {
48  robot_trajectory::RobotTrajectoryPtr trajectory_;
49  double planning_time_;
51  moveit_msgs::RobotState start_state_;
52  std::string planner_id_;
53 
54  [[deprecated("Use trajectory_ instead.")]] const robot_trajectory::RobotTrajectoryPtr& trajectory;
55  [[deprecated("Use planning_time_ instead.")]] const double& planning_time;
56  [[deprecated("Use error_code_ instead.")]] const moveit::core::MoveItErrorCode& error_code;
57  [[deprecated("Use start_state_ instead.")]] const moveit_msgs::RobotState& start_state;
58 
59 #pragma GCC diagnostic push
60 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
62  : planning_time_(0.0)
67  {
68  }
69 #pragma GCC diagnostic pop
70 
72  {
73  *this = response;
74  }
75 
77  {
78  trajectory_ = response.trajectory_;
79  planning_time_ = response.planning_time_;
80  error_code_ = response.error_code_;
81  start_state_ = response.start_state_;
82  planner_id_ = response.planner_id_;
83  return *this;
84  }
85 
86  void getMessage(moveit_msgs::MotionPlanResponse& msg) const;
87 
88  // Enable checking of query success or failure, for example if(response) ...
89  explicit operator bool() const
90  {
91  return bool(error_code_);
92  }
93 };
94 
95 struct MotionPlanDetailedResponse
96 {
97  void getMessage(moveit_msgs::MotionPlanDetailedResponse& msg) const;
98 
99  std::vector<robot_trajectory::RobotTrajectoryPtr> trajectory_;
100  std::vector<std::string> description_;
101  std::vector<double> processing_time_;
103  moveit_msgs::RobotState start_state_;
104  std::string planner_id_;
105 
106  // Enable checking of query success or failure, for example if(response) ...
107  explicit operator bool() const
108  {
109  return bool(error_code_);
110  }
111 };
112 
113 } // namespace planning_interface
response
const std::string response
planning_interface::MotionPlanResponse::getMessage
void getMessage(moveit_msgs::MotionPlanResponse &msg) const
Definition: planning_response.cpp:40
planning_interface::MotionPlanResponse::planning_time
const double & planning_time
Definition: planning_response.h:119
planning_interface::MotionPlanResponse::error_code_
moveit::core::MoveItErrorCode error_code_
Definition: planning_response.h:114
robot_trajectory.h
planning_interface::MotionPlanResponse::operator=
MotionPlanResponse & operator=(const MotionPlanResponse &response)
Definition: planning_response.h:140
moveit::core::MoveItErrorCode
a wrapper around moveit_msgs::MoveItErrorCodes to make it easier to return an error code message from...
Definition: moveit_error_code.h:110
planning_interface::MotionPlanResponse::trajectory_
robot_trajectory::RobotTrajectoryPtr trajectory_
Definition: planning_response.h:112
planning_interface::MotionPlanDetailedResponse::trajectory_
std::vector< robot_trajectory::RobotTrajectoryPtr > trajectory_
Definition: planning_response.h:131
planning_interface::MotionPlanResponse::trajectory
const robot_trajectory::RobotTrajectoryPtr & trajectory
Definition: planning_response.h:118
planning_interface::MotionPlanDetailedResponse::start_state_
moveit_msgs::RobotState start_state_
Definition: planning_response.h:135
moveit_error_code.h
planning_interface::MotionPlanResponse::start_state_
moveit_msgs::RobotState start_state_
Definition: planning_response.h:115
planning_interface::MotionPlanResponse::error_code
const moveit::core::MoveItErrorCode & error_code
Definition: planning_response.h:120
planning_interface::MotionPlanResponse::MotionPlanResponse
MotionPlanResponse()
Definition: planning_response.h:125
planning_interface
This namespace includes the base class for MoveIt planners.
Definition: planning_interface.h:51
planning_interface::MotionPlanDetailedResponse::planner_id_
std::string planner_id_
Definition: planning_response.h:136
planning_interface::MotionPlanDetailedResponse::error_code_
moveit::core::MoveItErrorCode error_code_
Definition: planning_response.h:134
planning_interface::MotionPlanResponse::planner_id_
std::string planner_id_
Definition: planning_response.h:116
planning_interface::MotionPlanResponse::planning_time_
double planning_time_
Definition: planning_response.h:113
planning_interface::MotionPlanDetailedResponse::description_
std::vector< std::string > description_
Definition: planning_response.h:132
planning_interface::MotionPlanDetailedResponse::getMessage
void getMessage(moveit_msgs::MotionPlanDetailedResponse &msg) const
Definition: planning_response.cpp:52
planning_interface::MotionPlanDetailedResponse::processing_time_
std::vector< double > processing_time_
Definition: planning_response.h:133
planning_interface::MotionPlanResponse::start_state
const moveit_msgs::RobotState & start_state
Definition: planning_response.h:121


moveit_core
Author(s): Ioan Sucan , Sachin Chitta , Acorn Pooley
autogenerated on Thu Nov 21 2024 03:23:41