Skip to content

Commit fa31fe6

Browse files
committed
Initial dump from main repo
0 parents  commit fa31fe6

29 files changed

+1550
-0
lines changed

.clang-format

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
---
2+
BasedOnStyle: Google
3+
AccessModifierOffset: -2
4+
ConstructorInitializerIndentWidth: 2
5+
AlignEscapedNewlinesLeft: false
6+
AlignTrailingComments: true
7+
AllowAllParametersOfDeclarationOnNextLine: false
8+
AllowShortIfStatementsOnASingleLine: false
9+
AllowShortLoopsOnASingleLine: false
10+
AllowShortFunctionsOnASingleLine: None
11+
AlwaysBreakTemplateDeclarations: true
12+
AlwaysBreakBeforeMultilineStrings: false
13+
BreakBeforeBinaryOperators: false
14+
BreakBeforeTernaryOperators: false
15+
BreakConstructorInitializersBeforeComma: true
16+
BinPackParameters: true
17+
ColumnLimit: 120
18+
ConstructorInitializerAllOnOneLineOrOnePerLine: true
19+
DerivePointerBinding: false
20+
PointerBindsToType: true
21+
ExperimentalAutoDetectBinPacking: false
22+
IndentCaseLabels: true
23+
MaxEmptyLinesToKeep: 1
24+
NamespaceIndentation: None
25+
ObjCSpaceBeforeProtocolList: true
26+
PenaltyBreakBeforeFirstCallParameter: 19
27+
PenaltyBreakComment: 60
28+
PenaltyBreakString: 1
29+
PenaltyBreakFirstLessLess: 1000
30+
PenaltyExcessCharacter: 1000
31+
PenaltyReturnTypeOnItsOwnLine: 90
32+
SpacesBeforeTrailingComments: 2
33+
Cpp11BracedListStyle: false
34+
Standard: Auto
35+
IndentWidth: 2
36+
TabWidth: 2
37+
UseTab: Never
38+
IndentFunctionDeclarationAfterType: false
39+
SpacesInParentheses: false
40+
SpacesInAngles: false
41+
SpaceInEmptyParentheses: false
42+
SpacesInCStyleCastParentheses: false
43+
SpaceAfterControlStatementKeyword: true
44+
SpaceBeforeAssignmentOperators: true
45+
ContinuationIndentWidth: 4
46+
SortIncludes: false
47+
SpaceAfterCStyleCast: false
48+
49+
# Configure each individual brace in BraceWrapping
50+
BreakBeforeBraces: Custom
51+
52+
# Control of individual brace wrapping cases
53+
BraceWrapping: {
54+
AfterClass: 'true'
55+
AfterControlStatement: 'true'
56+
AfterEnum : 'true'
57+
AfterFunction : 'true'
58+
AfterNamespace : 'true'
59+
AfterStruct : 'true'
60+
AfterUnion : 'true'
61+
BeforeCatch : 'true'
62+
BeforeElse : 'true'
63+
IndentBraces : 'false'
64+
}
65+
...

.clang-tidy

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
Checks: '*,
3+
-llvm-header-guard,
4+
-google-build-using-namespace,
5+
-clang-analyzer-alpha.clone.CloneChecker,
6+
-google-runtime-int,
7+
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
8+
-cppcoreguidelines-pro-bounds-constant-array-index,
9+
-clang-analyzer-alpha.deadcode.UnreachableCode,
10+
-misc-use-after-move,
11+
-cppcoreguidelines-pro-type-vararg,
12+
-modernize-use-emplace,
13+
-android-*,
14+
-absel-*,
15+
-cert-*,
16+
-objc-*,
17+
-zircon-*,
18+
-hicpp-vararg,
19+
-hicpp-no-array-decay,
20+
-google-runtime-references,
21+
-llvm-include-order,
22+
-fuchsia-*,
23+
-misc-unused-parameters'
24+
25+
WarningsAsErrors: '*'
26+
HeaderFilterRegex: ''
27+
AnalyzeTemporaryDtors: false
28+
CheckOptions:
29+
- key: llvm-namespace-comment.ShortNamespaceLines
30+
value: '10'
31+
- key: llvm-namespace-comment.SpacesBeforeComments
32+
value: '2'
33+
- key: readability-braces-around-statements.ShortStatementLines
34+
value: '2'
35+
# type names
36+
- key: readability-identifier-naming.ClassCase
37+
value: CamelCase
38+
- key: readability-identifier-naming.EnumCase
39+
value: CamelCase
40+
- key: readability-identifier-naming.UnionCase
41+
value: CamelCase
42+
# method names are camelCase
43+
- key: readability-identifier-naming.MethodCase
44+
value: camelBack
45+
# variable names are snake_case
46+
- key: readability-identifier-naming.VariableCase
47+
value: lower_case
48+
- key: readability-identifier-naming.ParameterCase
49+
value: lower_case
50+
- key: readability-identifier-naming.ClassMemberSuffix
51+
value: '_'
52+
# global variables are g_snake_case
53+
- key: readability-identifier-naming.GlobalVariablePrefix
54+
value: g_
55+
- key: readability-identifier-naming.GlobalVariableCase
56+
value: lower_case
57+
# namespaces are snake_case
58+
- key: readability-identifier-naming.NamespaceCase
59+
value: lower_case
60+
...

.gitignore

Whitespace-only changes.

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Boustrophedon Planner
2+
Boustrophedon Planner is a coverage path planner that implements the [Boustrophedon Cell Decomposition](https://en.wikipedia.org/wiki/Boustrophedon_cell_decomposition) algorithm.
3+
4+
## Overview
5+
The path planner is an actionlib server that takes in a `geometry_msgs/PolygonStamped` and a `geometry_msgs/PoseStamped`,
6+
and returns a `StripingPlan` message which contains a list of waypoints to stripe the passed in polygon.

boustrophedon_msgs/CMakeLists.txt

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
cmake_minimum_required(VERSION 2.8.3)
2+
project(boustrophedon_msgs)
3+
4+
set(CMAKE_CXX_STANDARD 14)
5+
6+
find_package(catkin REQUIRED
7+
genmsg
8+
std_msgs
9+
geometry_msgs
10+
actionlib_msgs
11+
nav_msgs
12+
)
13+
14+
add_message_files(
15+
DIRECTORY msg
16+
FILES
17+
StripingPoint.msg
18+
StripingPlan.msg
19+
)
20+
21+
add_service_files(
22+
FILES
23+
ConvertPlanToPath.srv
24+
)
25+
26+
add_action_files(
27+
DIRECTORY action
28+
FILES
29+
PlanMowingPath.action
30+
)
31+
32+
generate_messages(
33+
DEPENDENCIES
34+
std_msgs
35+
geometry_msgs
36+
actionlib_msgs
37+
nav_msgs
38+
)
39+
40+
catkin_package()
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
geometry_msgs/PolygonStamped property
2+
geometry_msgs/PoseStamped robot_position
3+
---
4+
boustrophedon_msgs/StripingPlan plan
5+
---
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Header header
2+
boustrophedon_msgs/StripingPoint[] points
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
geometry_msgs/Point point
2+
uint8 type
3+
4+
uint8 OUTLINE=0
5+
uint8 STRIPE_START=1
6+
uint8 STRIPE_END=2

boustrophedon_msgs/package.xml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0"?>
2+
<package format="2">
3+
<name>boustrophedon_msgs</name>
4+
<version>0.0.1</version>
5+
<description>Custom messages for the Boustrophedon Planner</description>
6+
7+
<maintainer email="[email protected]">Charles Brian Quinn</maintainer>
8+
<maintainer email="[email protected]">Oswin So</maintainer>
9+
10+
<license>TODO</license>
11+
12+
<author email="[email protected]">Charles Brian Quinn</author>
13+
<author email="[email protected]">Oswin So</author>
14+
15+
<depend>actionlib_msgs</depend>
16+
<depend>nav_msgs</depend>
17+
<depend>geometry_msgs</depend>
18+
19+
<build_depend>message_generation</build_depend>
20+
21+
<buildtool_depend>catkin</buildtool_depend>
22+
23+
<export>
24+
</export>
25+
</package>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
boustrophedon_msgs/StripingPlan plan
2+
---
3+
nav_msgs/Path path

boustrophedon_server/CMakeLists.txt

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
cmake_minimum_required(VERSION 2.8.3)
2+
project(boustrophedon_server)
3+
4+
set(CMAKE_CXX_STANDARD 14)
5+
set(CMAKE_CXX_CLANG_TIDY clang-tidy)
6+
7+
find_package(catkin REQUIRED COMPONENTS
8+
roscpp
9+
boustrophedon_msgs
10+
actionlib
11+
tf
12+
geometry_msgs
13+
nav_msgs
14+
rosparam_shortcuts
15+
)
16+
17+
find_package(CGAL REQUIRED COMPONENTS Core)
18+
catkin_package(
19+
INCLUDE_DIRS include
20+
CATKIN_DEPENDS
21+
roscpp
22+
boustrophedon_msgs
23+
actionlib
24+
tf
25+
geometry_msgs
26+
nav_msgs
27+
rosparam_shortcuts
28+
)
29+
30+
include_directories(
31+
include
32+
${catkin_INCLUDE_DIRS}
33+
)
34+
35+
add_executable(boustrophedon_planner_server
36+
src/boustrophedon_server/boustrophedon_planner_node.cpp
37+
src/boustrophedon_server/boustrophedon_planner_server.cpp
38+
src/boustrophedon_server/striping_planner.cpp
39+
src/boustrophedon_server/outline_planner.cpp
40+
src/boustrophedon_server/cgal_utils.cpp
41+
src/boustrophedon_server/boustrophedon_types.cpp
42+
src/boustrophedon_server/cellular_decomposition/polygon_decomposer.cpp
43+
src/boustrophedon_server/cellular_decomposition/cell.cpp
44+
)
45+
target_link_libraries(boustrophedon_planner_server
46+
${catkin_LIBRARIES}
47+
CGAL::CGAL
48+
CGAL::CGAL_Core)
49+
add_dependencies(boustrophedon_planner_server ${catkin_EXPORTED_TARGETS})
50+
51+
install(
52+
TARGETS
53+
boustrophedon_planner_server
54+
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
55+
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
56+
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
57+
)
58+
59+
install(DIRECTORY launch/
60+
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch
61+
)
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#ifndef SRC_BOUSTROPHEDON_PLANNER_SERVER_H
2+
#define SRC_BOUSTROPHEDON_PLANNER_SERVER_H
3+
4+
#include <ros/ros.h>
5+
#include <actionlib/server/simple_action_server.h>
6+
#include <tf/transform_listener.h>
7+
8+
#include <boustrophedon_msgs/PlanMowingPathAction.h>
9+
#include <boustrophedon_msgs/ConvertPlanToPath.h>
10+
11+
#include "cgal_utils.h"
12+
#include "striping_planner.h"
13+
#include "outline_planner.h"
14+
#include "cellular_decomposition/polygon_decomposer.h"
15+
16+
class BoustrophedonPlannerServer
17+
{
18+
public:
19+
BoustrophedonPlannerServer();
20+
21+
void executePlanPathAction(const boustrophedon_msgs::PlanMowingPathGoalConstPtr& goal);
22+
23+
private:
24+
using Server = actionlib::SimpleActionServer<boustrophedon_msgs::PlanMowingPathAction>;
25+
26+
ros::NodeHandle node_handle_;
27+
ros::NodeHandle private_node_handle_;
28+
Server action_server_;
29+
ros::ServiceServer conversion_server_;
30+
31+
StripingPlanner striping_planner_;
32+
OutlinePlanner outline_planner_;
33+
34+
int outline_layer_count_{};
35+
double stripe_separation_{};
36+
double stripe_angle_{};
37+
tf::TransformListener transform_listener_{};
38+
39+
bool convertStripingPlanToPath(boustrophedon_msgs::ConvertPlanToPath::Request& request,
40+
boustrophedon_msgs::ConvertPlanToPath::Response& response);
41+
boustrophedon_msgs::PlanMowingPathResult toResult(std::vector<NavPoint>&& path, const std::string& frame) const;
42+
Polygon fromBoundary(const geometry_msgs::PolygonStamped& boundary) const;
43+
Point fromPositionWithFrame(const geometry_msgs::PoseStamped& pose, const std::string& target_frame) const;
44+
};
45+
46+
#endif // SRC_BOUSTROPHEDON_PLANNER_SERVER_H
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#ifndef SRC_BOUSTROPHEDON_TYPES_H
2+
#define SRC_BOUSTROPHEDON_TYPES_H
3+
4+
#include "cgal_types.h"
5+
6+
enum class PointType
7+
{
8+
Outline = 0,
9+
StripeStart = 1,
10+
StripeEnd = 2,
11+
Travel = 3
12+
};
13+
14+
struct NavPoint
15+
{
16+
PointType type{};
17+
Point point{};
18+
19+
NavPoint(PointType type, Point point);
20+
};
21+
22+
#endif // SRC_BOUSTROPHEDON_TYPES_H

0 commit comments

Comments
 (0)