Skip to content
Open
7 changes: 4 additions & 3 deletions CMakeLists.txt
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please swap back to my Slicer repo, also why did you remove the system dependencies?

Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ ExternalProject_Add(
${EP_SLIC3R}

PREFIX ${EP_SLIC3R}
GIT_REPOSITORY https://github.com/ClemensElflein/Slic3r
GIT_TAG 026c1380e0ad12176dd2fc8cdf8f6f181deeb071
GIT_REPOSITORY https://github.com/HoverMower/Slic3r
#GIT_TAG 026c1380e0ad12176dd2fc8cdf8f6f181deeb071
GIT_SHALLOW OFF


BUILD_ALWAYS OFF

INSTALL_COMMAND cmake -E echo "Skipping install step."
Expand All @@ -39,7 +40,7 @@ ExternalProject_Add(


## System dependencies are found with CMake's conventions
find_package(Boost REQUIRED COMPONENTS system thread)
# find_package(Boost REQUIRED COMPONENTS system thread)


## Uncomment this if the package has a setup.py. This macro ensures
Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,13 @@
# slic3r_coverage_planner
A coverage planner for ROS using libslic3r as core logic

# Parameter
## Clockwise
By default, outer perimeter gets followed counter clockwise.
With the optional parameter clockwise, (true/false) you can change the direction.

```
<node pkg="slic3r_coverage_planner" type="slic3r_coverage_planner" name="slic3r_coverage_planner" output="screen">
<param name="clockwise" type="bool" value="true" />
</node>
```
11 changes: 11 additions & 0 deletions src/coverage_planner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@


bool visualize_plan;
bool doPerimeterClockwise;
ros::Publisher marker_array_publisher;


Expand Down Expand Up @@ -410,6 +411,9 @@ bool planPath(slic3r_coverage_planner::PlanPathRequest &req, slic3r_coverage_pla


auto equally_spaced_points = line.equally_spaced_points(scale_(0.1));
if (doPerimeterClockwise == true) {
std::reverse(equally_spaced_points.begin(), equally_spaced_points.end());
}
if (equally_spaced_points.size() < 2) {
ROS_INFO("Skipping single dot");
continue;
Expand Down Expand Up @@ -462,6 +466,7 @@ bool planPath(slic3r_coverage_planner::PlanPathRequest &req, slic3r_coverage_pla


auto equally_spaced_points = line.equally_spaced_points(scale_(0.1));

if (equally_spaced_points.size() < 2) {
ROS_INFO("Skipping single dot");
continue;
Expand Down Expand Up @@ -524,6 +529,10 @@ bool planPath(slic3r_coverage_planner::PlanPathRequest &req, slic3r_coverage_pla


auto equally_spaced_points = line.equally_spaced_points(scale_(0.1));
if (doPerimeterClockwise == true) {
std::reverse(equally_spaced_points.begin(), equally_spaced_points.end());
}

if (equally_spaced_points.size() < 2) {
ROS_INFO("Skipping single dot");
continue;
Expand Down Expand Up @@ -578,6 +587,8 @@ int main(int argc, char **argv) {
ros::NodeHandle paramNh("~");

visualize_plan = paramNh.param("visualize_plan", true);
doPerimeterClockwise = paramNh.param("clockwise", false);
ROS_INFO_STREAM("Perimeter Clockwise: " << doPerimeterClockwise);

if (visualize_plan) {
marker_array_publisher = n.advertise<visualization_msgs::MarkerArray>(
Expand Down