moveit2
The MoveIt Motion Planning Framework for ROS 2.
testdata_loader.h
Go to the documentation of this file.
1 /*********************************************************************
2  * Software License Agreement (BSD License)
3  *
4  * Copyright (c) 2018 Pilz GmbH & Co. KG
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 Pilz GmbH & Co. KG 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 #pragma once
36 
37 #include <string>
38 #include <utility>
39 
41 
42 #include "jointconfiguration.h"
43 #include "cartesianconfiguration.h"
44 #include "command_types_typedef.h"
45 #include "sequence.h"
46 #include "gripper.h"
47 
49 {
55 {
56 public:
57  TestdataLoader() = default;
58 
59  TestdataLoader(moveit::core::RobotModelConstPtr robot_model) : robot_model_(std::move(robot_model))
60  {
61  }
62 
63  TestdataLoader(const TestdataLoader&) = default;
67  virtual ~TestdataLoader() = default;
68 
69 public:
70  void setRobotModel(moveit::core::RobotModelConstPtr robot_model);
71 
72  virtual JointConfiguration getJoints(const std::string& pos_name, const std::string& group_name) const = 0;
73 
74  virtual CartesianConfiguration getPose(const std::string& pos_name, const std::string& group_name) const = 0;
75 
79  virtual PtpJoint getPtpJoint(const std::string& cmd_name) const = 0;
80  virtual PtpCart getPtpCart(const std::string& cmd_name) const = 0;
81  virtual PtpJointCart getPtpJointCart(const std::string& cmd_name) const = 0;
82 
86  virtual LinJoint getLinJoint(const std::string& cmd_name) const = 0;
87  virtual LinCart getLinCart(const std::string& cmd_name) const = 0;
88  virtual LinJointCart getLinJointCart(const std::string& cmd_name) const = 0;
89 
93  virtual CircCenterCart getCircCartCenterCart(const std::string& cmd_name) const = 0;
94  virtual CircJointCenterCart getCircJointCenterCart(const std::string& cmd_name) const = 0;
95  virtual CircInterimCart getCircCartInterimCart(const std::string& cmd_name) const = 0;
96  virtual CircJointInterimCart getCircJointInterimCart(const std::string& cmd_name) const = 0;
97 
101  virtual Sequence getSequence(const std::string& cmd_name) const = 0;
102 
106  virtual Gripper getGripper(const std::string& cmd_name) const = 0;
107 
108 protected:
109  moveit::core::RobotModelConstPtr robot_model_;
110 };
111 
112 inline void TestdataLoader::setRobotModel(moveit::core::RobotModelConstPtr robot_model)
113 {
114  robot_model_ = std::move(robot_model);
115 }
116 
117 using TestdataLoaderUPtr = std::unique_ptr<TestdataLoader>;
118 } // namespace pilz_industrial_motion_planner_testutils
Class to define a robot configuration in space with the help of cartesian coordinates.
Data class storing all information regarding a Circ command.
Definition: circ.h:49
Class to define a robot configuration in space with the help of joint values.
Data class storing all information regarding a linear command.
Definition: lin.h:48
Data class storing all information regarding a Sequence command.
Definition: sequence.h:54
Abstract base class describing the interface to access test data like robot poses and robot commands.
virtual PtpJointCart getPtpJointCart(const std::string &cmd_name) const =0
virtual LinCart getLinCart(const std::string &cmd_name) const =0
TestdataLoader(moveit::core::RobotModelConstPtr robot_model)
virtual CircCenterCart getCircCartCenterCart(const std::string &cmd_name) const =0
Returns the command with the specified name from the test data.
TestdataLoader & operator=(TestdataLoader &&)=default
virtual JointConfiguration getJoints(const std::string &pos_name, const std::string &group_name) const =0
virtual LinJointCart getLinJointCart(const std::string &cmd_name) const =0
virtual Gripper getGripper(const std::string &cmd_name) const =0
Returns the command with the specified name from the test data.
virtual PtpJoint getPtpJoint(const std::string &cmd_name) const =0
Returns the command with the specified name from the test data.
virtual PtpCart getPtpCart(const std::string &cmd_name) const =0
virtual Sequence getSequence(const std::string &cmd_name) const =0
Returns the command with the specified name from the test data.
virtual CircInterimCart getCircCartInterimCart(const std::string &cmd_name) const =0
virtual LinJoint getLinJoint(const std::string &cmd_name) const =0
Returns the command with the specified name from the test data.
virtual CartesianConfiguration getPose(const std::string &pos_name, const std::string &group_name) const =0
virtual CircJointInterimCart getCircJointInterimCart(const std::string &cmd_name) const =0
virtual CircJointCenterCart getCircJointCenterCart(const std::string &cmd_name) const =0
void setRobotModel(moveit::core::RobotModelConstPtr robot_model)
TestdataLoader & operator=(const TestdataLoader &)=default
std::unique_ptr< TestdataLoader > TestdataLoaderUPtr