cartesianpathconstraintsbuilder.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019 Pilz GmbH & Co. KG
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef CARTESIANPATHCONSTRAINTSBUILDER_H
18 #define CARTESIANPATHCONSTRAINTSBUILDER_H
19 
20 #include <string>
21 
22 #include <moveit_msgs/Constraints.h>
23 
24 #include "cartesianconfiguration.h"
25 
27 {
28 
34 {
35 public:
36  CartesianPathConstraintsBuilder& setConstraintName(const std::string& constraint_name);
38 
39  moveit_msgs::Constraints toPathConstraints() const;
40 
41 private:
42  std::string constraint_name_;
44 };
45 
47 {
48  constraint_name_ = constraint_name;
49  return *this;
50 }
51 
53 {
54  configuration_ = configuration;
55  return *this;
56 }
57 
58 inline moveit_msgs::Constraints CartesianPathConstraintsBuilder::toPathConstraints() const
59 {
60  moveit_msgs::PositionConstraint pos_constraint;
61  pos_constraint.link_name = configuration_.getLinkName();
62  pos_constraint.constraint_region.primitive_poses.push_back(configuration_.getPose());
63 
64  moveit_msgs::Constraints path_constraints;
65  path_constraints.name = constraint_name_;
66  path_constraints.position_constraints.push_back(pos_constraint);
67  return path_constraints;
68 }
69 
70 }
71 
72 #endif // CARTESIANPATHCONSTRAINTSBUILDER_H
path_constraints
Helper class to build moveit_msgs::Constraints from a given configuration.
CartesianPathConstraintsBuilder & setConstraintName(const std::string &constraint_name)
CartesianPathConstraintsBuilder & setConfiguration(const CartesianConfiguration &configuration)
Class to define a robot configuration in space with the help of cartesian coordinates.


pilz_industrial_motion_testutils
Author(s):
autogenerated on Mon Apr 6 2020 03:17:28