Skip to content

Commit d75def8

Browse files
Remove getStaticKey from profiles
1 parent 768aaa7 commit d75def8

File tree

31 files changed

+30
-274
lines changed

31 files changed

+30
-274
lines changed

tesseract_motion_planners/descartes/include/tesseract_motion_planners/descartes/profile/descartes_profile.h

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
#include <tesseract_common/macros.h>
3030
TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
3131
#include <memory>
32-
#include <typeindex>
3332
#include <Eigen/Geometry>
3433
TESSERACT_COMMON_IGNORE_WARNINGS_POP
3534

@@ -53,13 +52,7 @@ class DescartesSolverProfile : public tesseract_common::Profile
5352
using Ptr = std::shared_ptr<DescartesSolverProfile<FloatType>>;
5453
using ConstPtr = std::shared_ptr<const DescartesSolverProfile<FloatType>>;
5554

56-
DescartesSolverProfile() : Profile(DescartesSolverProfile<FloatType>::getStaticKey()) {}
57-
58-
/**
59-
* @brief A utility function for getting profile ID
60-
* @return The profile ID used when storing in profile dictionary
61-
*/
62-
static std::size_t getStaticKey() { return std::type_index(typeid(DescartesSolverProfile<FloatType>)).hash_code(); }
55+
DescartesSolverProfile() : Profile(createKey<DescartesSolverProfile<FloatType>>()) {}
6356

6457
virtual std::unique_ptr<descartes_light::Solver<FloatType>> create() const = 0;
6558
};
@@ -71,13 +64,7 @@ class DescartesMoveProfile : public tesseract_common::Profile
7164
using Ptr = std::shared_ptr<DescartesMoveProfile<FloatType>>;
7265
using ConstPtr = std::shared_ptr<const DescartesMoveProfile<FloatType>>;
7366

74-
DescartesMoveProfile() : Profile(DescartesMoveProfile<FloatType>::getStaticKey()) {}
75-
76-
/**
77-
* @brief A utility function for getting profile ID
78-
* @return The profile ID used when storing in profile dictionary
79-
*/
80-
static std::size_t getStaticKey() { return std::type_index(typeid(DescartesMoveProfile<FloatType>)).hash_code(); }
67+
DescartesMoveProfile() : Profile(createKey<DescartesMoveProfile<FloatType>>()) {}
8168

8269
std::shared_ptr<const tesseract_kinematics::KinematicGroup>
8370
createKinematicGroup(const tesseract_common::ManipulatorInfo& manip_info,

tesseract_motion_planners/ompl/include/tesseract_motion_planners/ompl/profile/ompl_profile.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,6 @@ class OMPLMoveProfile : public tesseract_common::Profile
6565

6666
OMPLMoveProfile();
6767

68-
/**
69-
* @brief A utility function for getting profile ID
70-
* @return The profile ID used when storing in profile dictionary
71-
*/
72-
static std::size_t getStaticKey();
73-
7468
/**
7569
* @brief Create the OMPL Parallel Plan Solver Config
7670
* @return The OMPL Parallel Plan Solver Config

tesseract_motion_planners/ompl/src/profile/ompl_profile.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,10 @@
2525
*/
2626

2727
#include <tesseract_motion_planners/ompl/profile/ompl_profile.h>
28-
#include <typeindex>
2928
#include <yaml-cpp/yaml.h>
3029
#include <tesseract_common/profile_plugin_factory.h>
3130

3231
namespace tesseract_planning
3332
{
34-
OMPLMoveProfile::OMPLMoveProfile() : Profile(OMPLMoveProfile::getStaticKey()) {}
35-
36-
std::size_t OMPLMoveProfile::getStaticKey() { return std::type_index(typeid(OMPLMoveProfile)).hash_code(); }
37-
33+
OMPLMoveProfile::OMPLMoveProfile() : Profile(createKey<OMPLMoveProfile>()) {}
3834
} // namespace tesseract_planning

tesseract_motion_planners/simple/include/tesseract_motion_planners/simple/profile/simple_planner_profile.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,6 @@ class SimplePlannerMoveProfile : public tesseract_common::Profile
5151

5252
SimplePlannerMoveProfile();
5353

54-
/**
55-
* @brief A utility function for getting profile ID
56-
* @return The profile ID used when storing in profile dictionary
57-
*/
58-
static std::size_t getStaticKey();
59-
6054
/**
6155
* @brief Generate a seed for the provided base_instruction
6256
* @brief This should not include the prev_instruction but must include the base_instruction
@@ -84,12 +78,6 @@ class SimplePlannerCompositeProfile : public tesseract_common::Profile
8478
using ConstPtr = std::shared_ptr<const SimplePlannerCompositeProfile>;
8579

8680
SimplePlannerCompositeProfile();
87-
88-
/**
89-
* @brief A utility function for getting profile ID
90-
* @return The profile ID used when storing in profile dictionary
91-
*/
92-
static std::size_t getStaticKey();
9381
};
9482

9583
} // namespace tesseract_planning

tesseract_motion_planners/simple/src/profile/simple_planner_profile.cpp

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,24 +24,10 @@
2424
* limitations under the License.
2525
*/
2626
#include <tesseract_motion_planners/simple/profile/simple_planner_profile.h>
27-
#include <typeindex>
2827

2928
namespace tesseract_planning
3029
{
31-
SimplePlannerMoveProfile::SimplePlannerMoveProfile() : Profile(SimplePlannerMoveProfile::getStaticKey()) {}
32-
33-
std::size_t SimplePlannerMoveProfile::getStaticKey()
34-
{
35-
return std::type_index(typeid(SimplePlannerMoveProfile)).hash_code();
36-
}
37-
38-
SimplePlannerCompositeProfile::SimplePlannerCompositeProfile() : Profile(SimplePlannerCompositeProfile::getStaticKey())
39-
{
40-
}
41-
42-
std::size_t SimplePlannerCompositeProfile::getStaticKey()
43-
{
44-
return std::type_index(typeid(SimplePlannerCompositeProfile)).hash_code();
45-
}
30+
SimplePlannerMoveProfile::SimplePlannerMoveProfile() : Profile(createKey<SimplePlannerMoveProfile>()) {}
4631

32+
SimplePlannerCompositeProfile::SimplePlannerCompositeProfile() : Profile(createKey<SimplePlannerCompositeProfile>()) {}
4733
} // namespace tesseract_planning

tesseract_motion_planners/trajopt/include/tesseract_motion_planners/trajopt/profile/trajopt_profile.h

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,6 @@ class TrajOptMoveProfile : public tesseract_common::Profile
7171
const std::shared_ptr<const tesseract_environment::Environment>& env,
7272
const std::vector<std::string>& active_links,
7373
int index) const = 0;
74-
75-
/**
76-
* @brief A utility function for getting profile ID
77-
* @return The profile ID used when storing in profile dictionary
78-
*/
79-
static std::size_t getStaticKey();
8074
};
8175

8276
class TrajOptCompositeProfile : public tesseract_common::Profile
@@ -92,12 +86,6 @@ class TrajOptCompositeProfile : public tesseract_common::Profile
9286
const std::vector<int>& fixed_indices,
9387
int start_index,
9488
int end_index) const = 0;
95-
96-
/**
97-
* @brief A utility function for getting profile ID
98-
* @return The profile ID used when storing in profile dictionary
99-
*/
100-
static std::size_t getStaticKey();
10189
};
10290

10391
class TrajOptSolverProfile : public tesseract_common::Profile
@@ -122,12 +110,6 @@ class TrajOptSolverProfile : public tesseract_common::Profile
122110

123111
/** @brief Optimization callbacks */
124112
virtual std::vector<sco::Optimizer::Callback> createOptimizationCallbacks() const;
125-
126-
/**
127-
* @brief A utility function for getting profile ID
128-
* @return The profile ID used when storing in profile dictionary
129-
*/
130-
static std::size_t getStaticKey();
131113
};
132114

133115
} // namespace tesseract_planning

tesseract_motion_planners/trajopt/src/profile/trajopt_profile.cpp

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,24 +24,14 @@
2424
* limitations under the License.
2525
*/
2626
#include <tesseract_motion_planners/trajopt/profile/trajopt_profile.h>
27-
#include <typeindex>
2827

2928
namespace tesseract_planning
3029
{
31-
TrajOptMoveProfile::TrajOptMoveProfile() : Profile(TrajOptMoveProfile::getStaticKey()) {}
30+
TrajOptMoveProfile::TrajOptMoveProfile() : Profile(createKey<TrajOptMoveProfile>()) {}
3231

33-
std::size_t TrajOptMoveProfile::getStaticKey() { return std::type_index(typeid(TrajOptMoveProfile)).hash_code(); }
32+
TrajOptCompositeProfile::TrajOptCompositeProfile() : Profile(createKey<TrajOptCompositeProfile>()) {}
3433

35-
TrajOptCompositeProfile::TrajOptCompositeProfile() : Profile(TrajOptCompositeProfile::getStaticKey()) {}
36-
37-
std::size_t TrajOptCompositeProfile::getStaticKey()
38-
{
39-
return std::type_index(typeid(TrajOptCompositeProfile)).hash_code();
40-
}
41-
42-
TrajOptSolverProfile::TrajOptSolverProfile() : Profile(TrajOptSolverProfile::getStaticKey()) {}
43-
44-
std::size_t TrajOptSolverProfile::getStaticKey() { return std::type_index(typeid(TrajOptSolverProfile)).hash_code(); }
34+
TrajOptSolverProfile::TrajOptSolverProfile() : Profile(createKey<TrajOptSolverProfile>()) {}
4535

4636
sco::BasicTrustRegionSQPParameters TrajOptSolverProfile::createOptimizationParameters() const { return opt_params; }
4737

tesseract_motion_planners/trajopt_ifopt/include/tesseract_motion_planners/trajopt_ifopt/profile/trajopt_ifopt_profile.h

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,6 @@ class TrajOptIfoptMoveProfile : public tesseract_common::Profile
7777
const tesseract_common::ManipulatorInfo& composite_manip_info,
7878
const std::shared_ptr<const tesseract_environment::Environment>& env,
7979
int index) const = 0;
80-
81-
/**
82-
* @brief A utility function for getting profile ID
83-
* @return The profile ID used when storing in profile dictionary
84-
*/
85-
static std::size_t getStaticKey();
8680
};
8781

8882
class TrajOptIfoptCompositeProfile : public tesseract_common::Profile
@@ -97,12 +91,6 @@ class TrajOptIfoptCompositeProfile : public tesseract_common::Profile
9791
const std::shared_ptr<const tesseract_environment::Environment>& env,
9892
const std::vector<std::shared_ptr<const trajopt_ifopt::JointPosition>>& vars,
9993
const std::vector<int>& fixed_indices) const = 0;
100-
101-
/**
102-
* @brief A utility function for getting profile ID
103-
* @return The profile ID used when storing in profile dictionary
104-
*/
105-
static std::size_t getStaticKey();
10694
};
10795

10896
class TrajOptIfoptSolverProfile : public tesseract_common::Profile
@@ -117,12 +105,6 @@ class TrajOptIfoptSolverProfile : public tesseract_common::Profile
117105
trajopt_sqp::SQPParameters opt_params{};
118106

119107
virtual std::unique_ptr<trajopt_sqp::TrustRegionSQPSolver> create(bool verbose = false) const = 0;
120-
121-
/**
122-
* @brief A utility function for getting profile ID
123-
* @return The profile ID used when storing in profile dictionary
124-
*/
125-
static std::size_t getStaticKey();
126108
};
127109

128110
} // namespace tesseract_planning

tesseract_motion_planners/trajopt_ifopt/src/profile/trajopt_ifopt_profile.cpp

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -24,29 +24,13 @@
2424
* limitations under the License.
2525
*/
2626
#include <tesseract_motion_planners/trajopt_ifopt/profile/trajopt_ifopt_profile.h>
27-
#include <typeindex>
2827

2928
namespace tesseract_planning
3029
{
31-
TrajOptIfoptMoveProfile::TrajOptIfoptMoveProfile() : Profile(TrajOptIfoptMoveProfile::getStaticKey()) {}
30+
TrajOptIfoptMoveProfile::TrajOptIfoptMoveProfile() : Profile(createKey<TrajOptIfoptMoveProfile>()) {}
3231

33-
std::size_t TrajOptIfoptMoveProfile::getStaticKey()
34-
{
35-
return std::type_index(typeid(TrajOptIfoptMoveProfile)).hash_code();
36-
}
37-
38-
TrajOptIfoptCompositeProfile::TrajOptIfoptCompositeProfile() : Profile(TrajOptIfoptCompositeProfile::getStaticKey()) {}
39-
40-
std::size_t TrajOptIfoptCompositeProfile::getStaticKey()
41-
{
42-
return std::type_index(typeid(TrajOptIfoptCompositeProfile)).hash_code();
43-
}
44-
45-
TrajOptIfoptSolverProfile::TrajOptIfoptSolverProfile() : Profile(TrajOptIfoptSolverProfile::getStaticKey()) {}
32+
TrajOptIfoptCompositeProfile::TrajOptIfoptCompositeProfile() : Profile(createKey<TrajOptIfoptCompositeProfile>()) {}
4633

47-
std::size_t TrajOptIfoptSolverProfile::getStaticKey()
48-
{
49-
return std::type_index(typeid(TrajOptIfoptSolverProfile)).hash_code();
50-
}
34+
TrajOptIfoptSolverProfile::TrajOptIfoptSolverProfile() : Profile(createKey<TrajOptIfoptSolverProfile>()) {}
5135

5236
} // namespace tesseract_planning

tesseract_task_composer/planning/include/tesseract_task_composer/planning/profiles/contact_check_profile.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,6 @@ struct ContactCheckProfile : public tesseract_common::Profile
5151
ContactCheckProfile(double longest_valid_segment_length, double contact_distance);
5252
ContactCheckProfile(const YAML::Node& config, const tesseract_common::ProfilePluginFactory& plugin_factory);
5353

54-
/**
55-
* @brief A utility function for getting profile ID
56-
* @return The profile ID used when storing in profile dictionary
57-
*/
58-
static std::size_t getStaticKey();
59-
6054
/** @brief The contact manager config */
6155
tesseract_collision::ContactManagerConfig contact_manager_config;
6256

0 commit comments

Comments
 (0)