Skip to content

Commit 26589b5

Browse files
authored
Merge pull request #11 from johnwason/pr/UpstreamChanges2
Update to upstream changes
2 parents 112ee04 + 09d261c commit 26589b5

10 files changed

+112
-28
lines changed

tesseract_python/swig/tesseract_command_language_python.i

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,16 @@
3434
%import "tesseract_common_python.i"
3535

3636
%{
37+
3738
// tesseract_command_language
3839
#include <tesseract_command_language/core/waypoint.h>
3940
#include <tesseract_command_language/core/instruction.h>
4041
#include <tesseract_command_language/command_language.h>
4142
#include <tesseract_command_language/serialize.h>
4243
#include <tesseract_command_language/deserialize.h>
4344

45+
#include <tesseract_command_language/profile_dictionary.h>
46+
4447
#include <tesseract_command_language/utils/utils.h>
4548
#include <tesseract_command_language/utils/get_instruction_utils.h>
4649
#include <tesseract_command_language/utils/filter_functions.h>
@@ -50,6 +53,7 @@
5053
#include <tesseract_common/resource.h>
5154

5255
#include "tesseract_command_language_python_std_functions.h"
56+
#include "tesseract_command_language_python_profile_dictionary_functions.h"
5357
%}
5458

5559
%include "tesseract_vector_reference_wrapper_instruction_typemaps.i"
@@ -82,6 +86,8 @@
8286
%tesseract_std_function(locateFilterFn,tesseract_planning,bool,const tesseract_planning::Instruction&,a,const tesseract_planning::CompositeInstruction&,b,bool,c);
8387

8488
%include "tesseract_command_language/types.h"
89+
%include "tesseract_command_language/profile_dictionary.h"
90+
%include "tesseract_command_language_python_profile_dictionary_functions.h"
8591
%include "tesseract_command_language/core/waypoint.h"
8692
%include "tesseract_command_language/core/instruction.h"
8793
%include "tesseract_command_language/command_language.h"
@@ -91,3 +97,23 @@
9197
%include "tesseract_command_language/utils/utils.h"
9298
%include "tesseract_command_language/utils/get_instruction_utils.h"
9399
%include "tesseract_command_language/utils/flatten_utils.h"
100+
101+
%define %tesseract_command_language_add_profile_type( TYPE )
102+
%template(ProfileDictionary_hasProfileEntry_##TYPE) tesseract_planning::ProfileDictionary_hasProfileEntry<tesseract_planning::TYPE>;
103+
%template(ProfileDictionary_removeProfileEntry_##TYPE) tesseract_planning::ProfileDictionary_removeProfileEntry<tesseract_planning::TYPE>;
104+
%template(ProfileDictionary_getProfileEntry_##TYPE) tesseract_planning::ProfileDictionary_getProfileEntry<tesseract_planning::TYPE>;
105+
%template(ProfileDictionary_addProfile_##TYPE) tesseract_planning::ProfileDictionary_addProfile<tesseract_planning::TYPE>;
106+
%template(ProfileDictionary_getProfile_##TYPE) tesseract_planning::ProfileDictionary_getProfile<tesseract_planning::TYPE>;
107+
%template(ProfileDictionary_hasProfile_##TYPE) tesseract_planning::ProfileDictionary_hasProfile<tesseract_planning::TYPE>;
108+
%template(ProfileDictionary_removeProfile_##TYPE) tesseract_planning::ProfileDictionary_removeProfile<tesseract_planning::TYPE>;
109+
%enddef
110+
111+
%define %tesseract_command_language_add_profile_type2(NAME, TYPE )
112+
%template(ProfileDictionary_hasProfileEntry_##NAME) tesseract_planning::ProfileDictionary_hasProfileEntry<tesseract_planning::TYPE>;
113+
%template(ProfileDictionary_removeProfileEntry_##NAME) tesseract_planning::ProfileDictionary_removeProfileEntry<tesseract_planning::TYPE>;
114+
%template(ProfileDictionary_getProfileEntry_##NAME) tesseract_planning::ProfileDictionary_getProfileEntry<tesseract_planning::TYPE>;
115+
%template(ProfileDictionary_addProfile_##NAME) tesseract_planning::ProfileDictionary_addProfile<tesseract_planning::TYPE>;
116+
%template(ProfileDictionary_getProfile_##NAME) tesseract_planning::ProfileDictionary_getProfile<tesseract_planning::TYPE>;
117+
%template(ProfileDictionary_hasProfile_##NAME) tesseract_planning::ProfileDictionary_hasProfile<tesseract_planning::TYPE>;
118+
%template(ProfileDictionary_removeProfile_##NAME) tesseract_planning::ProfileDictionary_removeProfile<tesseract_planning::TYPE>;
119+
%enddef
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
/**
2+
* @file tesseract_command_language_python_profile_dictionary_functions.h
3+
* @brief Utility functions for template types in tesseract_planning::ProfileDictionary
4+
*
5+
* @author John Wason
6+
* @date March 21, 2021
7+
* @version TODO
8+
* @bug No known bugs
9+
*
10+
* @copyright Copyright (c) 2021, Wason Technology, LLC
11+
*
12+
* @par License
13+
* Software License Agreement (Apache License)
14+
* @par
15+
* Licensed under the Apache License, Version 2.0 (the "License");
16+
* you may not use this file except in compliance with the License.
17+
* You may obtain a copy of the License at
18+
* http://www.apache.org/licenses/LICENSE-2.0
19+
* @par
20+
* Unless required by applicable law or agreed to in writing, software
21+
* distributed under the License is distributed on an "AS IS" BASIS,
22+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23+
* See the License for the specific language governing permissions and
24+
* limitations under the License.
25+
*/
26+
27+
namespace tesseract_planning
28+
{
29+
template<typename T>
30+
bool ProfileDictionary_hasProfileEntry(std::shared_ptr<tesseract_planning::ProfileDictionary> profile_dictionary)
31+
{
32+
return profile_dictionary->hasProfileEntry<T>();
33+
}
34+
35+
template<typename T>
36+
void ProfileDictionary_removeProfileEntry(std::shared_ptr<tesseract_planning::ProfileDictionary> profile_dictionary)
37+
{
38+
profile_dictionary->removeProfileEntry<T>();
39+
}
40+
41+
template<typename T>
42+
std::unordered_map<std::string, std::shared_ptr<const T>> ProfileDictionary_getProfileEntry(std::shared_ptr<tesseract_planning::ProfileDictionary> profile_dictionary)
43+
{
44+
return profile_dictionary->getProfileEntry<T>();
45+
}
46+
47+
template<typename T>
48+
void ProfileDictionary_addProfile(std::shared_ptr<tesseract_planning::ProfileDictionary> profile_dictionary, const std::string& profile_name, std::shared_ptr<const T> profile)
49+
{
50+
profile_dictionary->addProfile(profile_name, profile);
51+
}
52+
53+
template<typename T>
54+
bool ProfileDictionary_hasProfile(std::shared_ptr<tesseract_planning::ProfileDictionary> profile_dictionary, const std::string& profile_name)
55+
{
56+
return profile_dictionary->hasProfile<T>(profile_name);
57+
}
58+
59+
template<typename T>
60+
std::shared_ptr<const T> ProfileDictionary_getProfile(std::shared_ptr<tesseract_planning::ProfileDictionary> profile_dictionary, const std::string& profile_name)
61+
{
62+
return profile_dictionary->getProfile<T>(profile_name);
63+
}
64+
65+
template<typename T>
66+
void ProfileDictionary_removeProfile(std::shared_ptr<tesseract_planning::ProfileDictionary> profile_dictionary, const std::string& profile_name)
67+
{
68+
profile_dictionary->removeProfile<T>(profile_name);
69+
}
70+
71+
}

tesseract_python/swig/tesseract_common_python.i

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
#include <tesseract_common/resource.h>
4343
#include <tesseract_common/manipulator_info.h>
4444
#include <tesseract_common/joint_state.h>
45+
#include <tesseract_common/collision_margin_data.h>
4546

4647
%}
4748

@@ -135,6 +136,7 @@ namespace tesseract_common
135136
%include "tesseract_common/resource.h"
136137
%include "tesseract_common/manipulator_info.h"
137138
%include "tesseract_common/joint_state.h"
139+
%include "tesseract_common/collision_margin_data.h"
138140

139141

140142

tesseract_python/swig/tesseract_motion_planners_descartes_python.i

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
#include <tesseract_common/resource.h>
4949

5050
#include "tesseract_command_language_python_std_functions.h"
51+
#include "tesseract_command_language_python_profile_dictionary_functions.h"
5152

5253
#include "tesseract_environment_python_std_functions.h"
5354
#include <tesseract_kinematics/core/rep_inverse_kinematics.h>

tesseract_python/swig/tesseract_motion_planners_ompl_python.i

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
#include <tesseract_common/resource.h>
5050

5151
#include "tesseract_command_language_python_std_functions.h"
52+
#include "tesseract_command_language_python_profile_dictionary_functions.h"
5253

5354
#include "tesseract_environment_python_std_functions.h"
5455
#include <tesseract_kinematics/core/rep_inverse_kinematics.h>

tesseract_python/swig/tesseract_motion_planners_simple_python.i

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@
4848
#include "tesseract_environment_python_std_functions.h"
4949
#include <tesseract_kinematics/core/rep_inverse_kinematics.h>
5050
#include <tesseract_kinematics/core/rop_inverse_kinematics.h>
51+
52+
#include "tesseract_command_language_python_profile_dictionary_functions.h"
5153
%}
5254

5355
// tesseract_motion_planners_simple

tesseract_python/swig/tesseract_motion_planners_trajopt_python.i

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
#include <tesseract_common/resource.h>
5454

5555
#include "tesseract_command_language_python_std_functions.h"
56+
#include "tesseract_command_language_python_profile_dictionary_functions.h"
5657

5758
#include "tesseract_environment_python_std_functions.h"
5859
#include <tesseract_kinematics/core/rep_inverse_kinematics.h>

tesseract_python/swig/tesseract_process_managers_python.i

Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@
3838

3939
%{
4040

41-
// tesseract_motion_planners
42-
#include <tesseract_motion_planners/core/profile_dictionary.h>
43-
4441
// tesseract_motion_planners_simple
4542
#include <tesseract_motion_planners/simple/profile/simple_planner_utils.h>
4643
#include <tesseract_motion_planners/simple/profile/simple_planner_profile.h>
@@ -92,50 +89,31 @@
9289

9390
#include <tesseract_process_managers/task_generators/profile_switch_task_generator.h>
9491
#include <tesseract_process_managers/task_generators/iterative_spline_parameterization_task_generator.h>
92+
#include "tesseract_process_managers/task_generators/time_optimal_trajectory_generation_task_generator.h"
9593

9694
#include <tesseract_common/status_code.h>
9795
#include <tesseract_common/resource.h>
9896

9997
#include "tesseract_command_language_python_std_functions.h"
98+
#include "tesseract_command_language_python_profile_dictionary_functions.h"
10099

101100
#include "tesseract_environment_python_std_functions.h"
102101
#include <tesseract_kinematics/core/rep_inverse_kinematics.h>
103102
#include <tesseract_kinematics/core/rop_inverse_kinematics.h>
104103

105104
%}
106105

107-
%define %tesseract_process_managers_add_profile_type( TYPE )
108-
%template(hasProfileEntry_##TYPE) tesseract_planning::ProfileDictionary::hasProfileEntry<tesseract_planning::TYPE>;
109-
%template(removeProfileEntry_##TYPE) tesseract_planning::ProfileDictionary::removeProfileEntry<tesseract_planning::TYPE>;
110-
%template(getProfileEntry_##TYPE) tesseract_planning::ProfileDictionary::getProfileEntry<tesseract_planning::TYPE>;
111-
%template(addProfile_##TYPE) tesseract_planning::ProfileDictionary::addProfile<tesseract_planning::TYPE>;
112-
%template(getProfile_##TYPE) tesseract_planning::ProfileDictionary::getProfile<tesseract_planning::TYPE>;
113-
%template(hasProfile_##TYPE) tesseract_planning::ProfileDictionary::hasProfile<tesseract_planning::TYPE>;
114-
%template(removeProfile_##TYPE) tesseract_planning::ProfileDictionary::removeProfile<tesseract_planning::TYPE>;
115-
%enddef
116-
117-
%define %tesseract_process_managers_add_profile_type2(NAME, TYPE )
118-
%template(hasProfileEntry_##NAME) tesseract_planning::ProfileDictionary::hasProfileEntry<tesseract_planning::TYPE>;
119-
%template(removeProfileEntry_##NAME) tesseract_planning::ProfileDictionary::removeProfileEntry<tesseract_planning::TYPE>;
120-
%template(getProfileEntry_##NAME) tesseract_planning::ProfileDictionary::getProfileEntry<tesseract_planning::TYPE>;
121-
%template(addProfile_##NAME) tesseract_planning::ProfileDictionary::addProfile<tesseract_planning::TYPE>;
122-
%template(getProfile_##NAME) tesseract_planning::ProfileDictionary::getProfile<tesseract_planning::TYPE>;
123-
%template(hasProfile_##NAME) tesseract_planning::ProfileDictionary::hasProfile<tesseract_planning::TYPE>;
124-
%template(removeProfile_##NAME) tesseract_planning::ProfileDictionary::removeProfile<tesseract_planning::TYPE>;
125-
%enddef
126-
127106
%shared_ptr(tesseract_planning::IterativeSplineParameterizationProfile)
128107
%shared_ptr(tesseract_planning::ProfileSwitchProfile);
129108

130-
%include "tesseract_motion_planners/core/profile_dictionary.h"
131-
132109
%include "tesseract_process_managers/core/task_info.h"
133110
%include "tesseract_process_managers/core/taskflow_interface.h"
134111
%include "tesseract_process_managers/core/process_planning_request.h"
135112
%include "tesseract_process_managers/core/process_planning_future.h"
136113
%include "tesseract_process_managers/core/process_planning_server.h"
137114

138-
//%include "tesseract_process_managers/task_generators/profile_switch_task_generator.h"
139-
//%include "tesseract_process_managers/task_generators/iterative_spline_parameterization_task_generator.h"
115+
%include "tesseract_process_managers/task_generators/profile_switch_task_generator.h"
116+
%include "tesseract_process_managers/task_generators/iterative_spline_parameterization_task_generator.h"
117+
%include "tesseract_process_managers/task_generators/time_optimal_trajectory_generation_task_generator.h"
140118

141119

tesseract_python/swig/tesseract_time_parameterization_python.i

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,12 @@
3939

4040
// tesseract_time_parameterization
4141
#include <tesseract_time_parameterization/iterative_spline_parameterization.h>
42+
#include <tesseract_time_parameterization/time_optimal_trajectory_generation.h>
4243
%}
4344

4445
// tesseract_time_parameterization
4546
#define TESSERACT_TIME_PARAMETERIZATION_PUBLIC
4647
%include "tesseract_time_parameterization/iterative_spline_parameterization.h"
48+
%include "tesseract_time_parameterization/time_optimal_trajectory_generation.h"
4749

4850

tesseract_python/tests/tesseract_collision/test_collision_box_cone_unit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def run_test(checker):
8585

8686
# Test when object is in collision
8787
checker.setActiveCollisionObjects(["box_link", "cone_link"])
88-
checker.setCollisionMarginData(tesseract_collision.CollisionMarginData(0.1))
88+
checker.setCollisionMarginData(tesseract_common.CollisionMarginData(0.1))
8989
nptest.assert_almost_equal(checker.getCollisionMarginData().getMaxCollisionMargin(), 0.1)
9090

9191
# Set the collision object transforms

0 commit comments

Comments
 (0)