moveit2
The MoveIt Motion Planning Framework for ROS 2.
parameter_descriptor_builder.cpp
Go to the documentation of this file.
1 // Copyright 2021 PickNik Inc.
2 //
3 // Redistribution and use in source and binary forms, with or without
4 // modification, are permitted provided that the following conditions are met:
5 //
6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer.
8 //
9 // * Redistributions in binary form must reproduce the above copyright
10 // notice, this list of conditions and the following disclaimer in the
11 // documentation and/or other materials provided with the distribution.
12 //
13 // * Neither the name of the PickNik Inc. nor the names of its
14 // contributors may be used to endorse or promote products derived from
15 // this software without specific prior written permission.
16 //
17 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
21 // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 // POSSIBILITY OF SUCH DAMAGE.
28 
29 /* Author : Tyler Weaver
30  Desc : Creates a parameter descriptor message used to describe parameters
31  Title : parameter_descriptor_builder.cpp
32  Project : moveit_servo
33 */
34 
36 
37 namespace moveit_servo
38 {
40 {
41  msg_.type = type;
42  return *this;
43 }
44 
46 {
47  msg_.description = description;
48  return *this;
49 }
50 
52 {
53  msg_.additional_constraints = additional_constraints;
54  return *this;
55 }
56 
58 {
59  msg_.read_only = read_only;
60  return *this;
61 }
62 
63 // In rolling (not in Foxy)
65 {
66  msg_.dynamic_typing = dynamic_typing;
67  return *this;
68 }
69 
71 ParameterDescriptorBuilder::floatingPointRange(double from_value /*= std::numeric_limits<double>::min()*/,
72  double to_value /*= std::numeric_limits<double>::max()*/,
73  double step /*= 0*/)
74 {
75  msg_.floating_point_range.resize(1);
76  msg_.floating_point_range[0].from_value = from_value;
77  msg_.floating_point_range[0].to_value = to_value;
78  msg_.floating_point_range[0].step = step;
79  return *this;
80 }
81 
83 ParameterDescriptorBuilder::integerRange(int64_t from_value /*= std::numeric_limits<int64_t>::min()*/,
84  int64_t to_value /*= std::numeric_limits<int64_t>::max()*/,
85  int64_t step /*= 0*/)
86 {
87  msg_.integer_range.resize(1);
88  msg_.integer_range[0].from_value = from_value;
89  msg_.integer_range[0].to_value = to_value;
90  msg_.integer_range[0].step = step;
91  return *this;
92 }
93 
94 } // namespace moveit_servo
ParameterDescriptorBuilder & integerRange(int64_t from_value=std::numeric_limits< int64_t >::min(), int64_t to_value=std::numeric_limits< int64_t >::max(), int64_t step=0)
Set the integer range.
ParameterDescriptorBuilder & floatingPointRange(double from_value=std::numeric_limits< double >::min(), double to_value=std::numeric_limits< double >::max(), double step=0)
Set floating point range.
ParameterDescriptorBuilder & readOnly(bool read_only)
Sets the read only flag.
ParameterDescriptorBuilder & additionalConstraints(const std::string &additional_constraints)
Set the additional constraints string (a description of any additional constraints which cannot be ex...
ParameterDescriptorBuilder & description(const std::string &description)
Set the description string.
ParameterDescriptorBuilder & type(uint8_t type)
Set the type.
ParameterDescriptorBuilder & dynamicTyping(bool dynamic_typing)
Set the dynamic typing flag (rolling only)
description
Definition: setup.py:19