moveit2
The MoveIt Motion Planning Framework for ROS 2.
parameter_descriptor_builder.hpp
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.hpp
32  Project : moveit_servo
33 */
34 
35 // TODO(823): Move this into a separate message_builder package
36 
37 #pragma once
38 
39 #include <rcl_interfaces/msg/floating_point_range.hpp>
40 #include <rcl_interfaces/msg/integer_range.hpp>
41 #include <rcl_interfaces/msg/parameter_descriptor.hpp>
42 #include <rcl_interfaces/msg/parameter_type.hpp>
43 #include <limits>
44 #include <string>
45 
46 namespace moveit_servo
47 {
49 {
50  rcl_interfaces::msg::ParameterDescriptor msg_;
51 
52 public:
56  operator rcl_interfaces::msg::ParameterDescriptor() const
57  {
58  return msg_;
59  }
60 
69 
78 
87  ParameterDescriptorBuilder& additionalConstraints(const std::string& additional_constraints);
88 
96  ParameterDescriptorBuilder& readOnly(bool read_only);
97 
105  ParameterDescriptorBuilder& dynamicTyping(bool dynamic_typing);
106 
116  ParameterDescriptorBuilder& floatingPointRange(double from_value = std::numeric_limits<double>::min(),
117  double to_value = std::numeric_limits<double>::max(), double step = 0);
118 
128  ParameterDescriptorBuilder& integerRange(int64_t from_value = std::numeric_limits<int64_t>::min(),
129  int64_t to_value = std::numeric_limits<int64_t>::max(), int64_t step = 0);
130 };
131 
132 } // 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)