Skip to content

Commit 63d1f0b

Browse files
Levi ArmstrongLevi-Armstrong
authored andcommitted
Make changes to better support python wrapping
1 parent deff6c5 commit 63d1f0b

File tree

62 files changed

+1182
-851
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+1182
-851
lines changed

tesseract/tesseract_planning/tesseract_command_language/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ add_library(${PROJECT_NAME}
4040
src/null_waypoint.cpp
4141
src/state_waypoint.cpp
4242
src/utils/flatten_utils.cpp
43+
src/utils/filter_functions.cpp
4344
src/utils/get_instruction_utils.cpp
4445
src/utils/utils.cpp)
4546
target_link_libraries(${PROJECT_NAME} PUBLIC console_bridge::console_bridge tesseract::tesseract_common ${Boost_LIBRARIES})

tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/utils/filter_functions.h

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@
2626
#ifndef TESSERACT_COMMAND_LANGUAGE_UTILS_FILTER_FUNCTIONS_H
2727
#define TESSERACT_COMMAND_LANGUAGE_UTILS_FILTER_FUNCTIONS_H
2828

29-
#include <tesseract_command_language/plan_instruction.h>
30-
#include <tesseract_command_language/move_instruction.h>
3129
#include <tesseract_command_language/composite_instruction.h>
3230

3331
namespace tesseract_planning
@@ -45,29 +43,9 @@ using flattenFilterFn =
4543
using locateFilterFn =
4644
std::function<bool(const Instruction&, const CompositeInstruction&, bool parent_is_first_composite)>;
4745

48-
static locateFilterFn moveFilter =
49-
[](const Instruction& i, const CompositeInstruction& /*composite*/, bool parent_is_first_composite) {
50-
if (isMoveInstruction(i))
51-
{
52-
if (i.cast_const<MoveInstruction>()->isStart())
53-
return (parent_is_first_composite);
46+
bool moveFilter(const Instruction& instruction, const CompositeInstruction& composite, bool parent_is_first_composite);
5447

55-
return true;
56-
}
57-
return false;
58-
};
59-
60-
static locateFilterFn planFilter =
61-
[](const Instruction& i, const CompositeInstruction& /*composite*/, bool parent_is_first_composite) {
62-
if (isPlanInstruction(i))
63-
{
64-
if (i.cast_const<PlanInstruction>()->isStart())
65-
return (parent_is_first_composite);
66-
67-
return true;
68-
}
69-
return false;
70-
};
48+
bool planFilter(const Instruction& instruction, const CompositeInstruction& composite, bool parent_is_first_composite);
7149

7250
} // namespace tesseract_planning
7351

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/**
2+
* @file filter_functions.cpp
3+
* @brief Contains filter functions used for flattening and locating instructions in composites
4+
*
5+
* @author Levi Armstrong
6+
* @date June 15, 2020
7+
* @version TODO
8+
* @bug No known bugs
9+
*
10+
* @copyright Copyright (c) 2020, Southwest Research Institute
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+
#include <tesseract_command_language/plan_instruction.h>
28+
#include <tesseract_command_language/move_instruction.h>
29+
#include <tesseract_command_language/utils/filter_functions.h>
30+
31+
namespace tesseract_planning
32+
{
33+
bool moveFilter(const Instruction& instruction,
34+
const CompositeInstruction& /*composite*/,
35+
bool parent_is_first_composite)
36+
{
37+
if (isMoveInstruction(instruction))
38+
{
39+
if (instruction.cast_const<MoveInstruction>()->isStart())
40+
return (parent_is_first_composite);
41+
42+
return true;
43+
}
44+
return false;
45+
}
46+
47+
bool planFilter(const Instruction& instruction,
48+
const CompositeInstruction& /*composite*/,
49+
bool parent_is_first_composite)
50+
{
51+
if (isPlanInstruction(instruction))
52+
{
53+
if (instruction.cast_const<PlanInstruction>()->isStart())
54+
return (parent_is_first_composite);
55+
56+
return true;
57+
}
58+
return false;
59+
}
60+
} // namespace tesseract_planning

tesseract/tesseract_planning/tesseract_motion_planners/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,10 @@ add_library(${PROJECT_NAME}_descartes
5959
src/descartes/descartes_collision_edge_evaluator.cpp
6060
src/descartes/descartes_robot_sampler.cpp
6161
src/descartes/descartes_motion_planner_status_category.cpp
62-
src/descartes/profile/descartes_default_plan_profile.cpp
6362
src/descartes/serialize.cpp
64-
src/descartes/deserialize.cpp)
63+
src/descartes/deserialize.cpp
64+
src/descartes/descartes_utils.cpp
65+
src/descartes/profile/descartes_default_plan_profile.cpp)
6566
target_link_libraries(${PROJECT_NAME}_descartes PUBLIC ${PROJECT_NAME}_core descartes::descartes_light descartes::descartes_samplers ${Boost_LIBRARIES})
6667
target_compile_options(${PROJECT_NAME}_descartes PRIVATE ${TESSERACT_COMPILE_OPTIONS_PRIVATE})
6768
target_compile_options(${PROJECT_NAME}_descartes PUBLIC ${TESSERACT_COMPILE_OPTIONS_PUBLIC})

0 commit comments

Comments
 (0)