-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
290 changed files
with
175,154 additions
and
4,193 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
# Get an image with git and apt-get update | ||
FROM docker.io/ros:noetic-ros-base-focal as base | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
RUN apt-get update && \ | ||
apt-get install --yes git | ||
RUN rosdep update | ||
|
||
# Install mosquitto broker | ||
RUN apt-get install --yes mosquitto | ||
|
||
# Install our config | ||
COPY --link ./assets/mosquitto.conf /etc/mosquitto/mosquitto.conf | ||
|
||
# Install nginx for hosting the app | ||
RUN apt-get install --yes nginx | ||
|
||
# Remove default nginx config (else it will run on port 80) | ||
RUN rm /etc/nginx/sites-enabled/* | ||
|
||
# Install nginx config | ||
COPY --link ./assets/nginx.conf /etc/nginx/conf.d/default.conf | ||
|
||
# First stage: Pull the git and all submodules, other stages depend on it | ||
FROM base as fetch | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
COPY --link ./ /opt/open_mower_ros | ||
#RUN git clone https://github.com/ClemensElflein/open_mower_ros /opt/open_mower_ros | ||
|
||
WORKDIR /opt/open_mower_ros | ||
|
||
RUN git submodule update --init --recursive | ||
|
||
|
||
# Get slic3r_coverage_planner and build that. We will pull the finished install folder from this. | ||
# This stage should cache most of the time, that's why it's not derived from the fetch stage, but copies stuff instead. | ||
FROM base as slic3r | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
# Fetch the slic3r planner from the repo (this will cache if unchanged) | ||
COPY --link --from=fetch /opt/open_mower_ros/src/lib/slic3r_coverage_planner /opt/slic3r_coverage_planner_workspace/src | ||
|
||
WORKDIR /opt/slic3r_coverage_planner_workspace | ||
RUN rosdep install --from-paths src --ignore-src --simulate | \ | ||
sed --expression '1d' --expression 's/apt-get install/apt-get install --no-install-recommends --yes/g' | \ | ||
bash \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
RUN bash -c "source /opt/ros/$ROS_DISTRO/setup.bash && catkin_make -j`nproc`" | ||
RUN bash -c "source /opt/ros/$ROS_DISTRO/setup.bash && source /opt/slic3r_coverage_planner_workspace/devel/setup.bash && catkin_make -DCMAKE_INSTALL_PREFIX=/opt/prebuilt/slic3r_coverage_planner install" | ||
|
||
|
||
# Fetch the repo and assemble the list of dependencies. We will pull these in the next step and actually run install on them | ||
# If the package list is the same as last time, the apt install step is cached as well which saves a lot of time. | ||
# Since the list gets sorted, it will be the same each time and the cache will know that by file checksum in the COPY command. | ||
# We can't use this stage as base for the next, because this stage is run every time and would therefore invalidate the cache of the next stage. | ||
FROM fetch as dependencies | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
WORKDIR /opt/open_mower_ros | ||
|
||
# This creates the sorted list of apt-get install commands. | ||
RUN apt-get update && \ | ||
rosdep install --from-paths src --ignore-src --simulate | \ | ||
sed --expression '1d' --expression 's/apt-get install/apt-get install --no-install-recommends --yes/g' | sort > /apt-install.sh | ||
|
||
|
||
# We can't derive this from "dependencies" because "dependencies" will be rebuilt every time, but apt install should only be done if needed | ||
FROM base as assemble | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
#Fetch the slic3r built earlier, this only changes if slic3r was changed (probably never) | ||
COPY --link --from=slic3r /opt/prebuilt/slic3r_coverage_planner /opt/prebuilt/slic3r_coverage_planner | ||
|
||
#Fetch the list of packages, this only changes if new dependencies have been added (only sometimes) | ||
COPY --link --from=dependencies /apt-install.sh /apt-install.sh | ||
RUN apt-get update && \ | ||
bash /apt-install.sh && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# This will already have the submodules initialized, no need to clone again | ||
COPY --link --from=fetch /opt/open_mower_ros /opt/open_mower_ros | ||
|
||
#delete prebuilt libs (so that they won't shadow the preinstalled ones) | ||
RUN rm -rf /opt/open_mower_ros/src/lib/slic3r_coverage_planner | ||
|
||
#RUN git clone https://github.com/ClemensElflein/open_mower_ros /opt/open_mower_ros | ||
|
||
WORKDIR /opt/open_mower_ros | ||
|
||
RUN bash -c "source /opt/ros/$ROS_DISTRO/setup.bash && cd /opt/open_mower_ros/src && catkin_init_workspace && cd .. && source /opt/prebuilt/slic3r_coverage_planner/setup.bash && catkin_make -DCATKIN_BLACKLIST_PACKAGES=slic3r_coverage_planner" | ||
|
||
COPY .github/assets/openmower_entrypoint.sh /openmower_entrypoint.sh | ||
RUN chmod +x /openmower_entrypoint.sh | ||
|
||
ENTRYPOINT ["/openmower_entrypoint.sh"] | ||
CMD ["bash", "-c", "service nginx start; service mosquitto start; roslaunch open_mower open_mower.launch --screen"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# toplevel CMakeLists.txt for a catkin workspace | ||
# catkin/cmake/toplevel.cmake | ||
|
||
cmake_minimum_required(VERSION 3.0.2) | ||
|
||
project(Project) | ||
|
||
set(CATKIN_TOPLEVEL TRUE) | ||
|
||
# search for catkin within the workspace | ||
set(_cmd "catkin_find_pkg" "catkin" "${CMAKE_SOURCE_DIR}") | ||
execute_process(COMMAND ${_cmd} | ||
RESULT_VARIABLE _res | ||
OUTPUT_VARIABLE _out | ||
ERROR_VARIABLE _err | ||
OUTPUT_STRIP_TRAILING_WHITESPACE | ||
ERROR_STRIP_TRAILING_WHITESPACE | ||
) | ||
if(NOT _res EQUAL 0 AND NOT _res EQUAL 2) | ||
# searching fot catkin resulted in an error | ||
string(REPLACE ";" " " _cmd_str "${_cmd}") | ||
message(FATAL_ERROR "Search for 'catkin' in workspace failed (${_cmd_str}): ${_err}") | ||
endif() | ||
|
||
# include catkin from workspace or via find_package() | ||
if(_res EQUAL 0) | ||
set(catkin_EXTRAS_DIR "${CMAKE_SOURCE_DIR}/${_out}/cmake") | ||
# include all.cmake without add_subdirectory to let it operate in same scope | ||
include(${catkin_EXTRAS_DIR}/all.cmake NO_POLICY_SCOPE) | ||
add_subdirectory("${_out}") | ||
|
||
else() | ||
# use either CMAKE_PREFIX_PATH explicitly passed to CMake as a command line argument | ||
# or CMAKE_PREFIX_PATH from the environment | ||
if(NOT DEFINED CMAKE_PREFIX_PATH) | ||
if(NOT "$ENV{CMAKE_PREFIX_PATH}" STREQUAL "") | ||
if(NOT WIN32) | ||
string(REPLACE ":" ";" CMAKE_PREFIX_PATH $ENV{CMAKE_PREFIX_PATH}) | ||
else() | ||
set(CMAKE_PREFIX_PATH $ENV{CMAKE_PREFIX_PATH}) | ||
endif() | ||
endif() | ||
endif() | ||
|
||
# list of catkin workspaces | ||
set(catkin_search_path "") | ||
foreach(path ${CMAKE_PREFIX_PATH}) | ||
if(EXISTS "${path}/.catkin") | ||
list(FIND catkin_search_path ${path} _index) | ||
if(_index EQUAL -1) | ||
list(APPEND catkin_search_path ${path}) | ||
endif() | ||
endif() | ||
endforeach() | ||
|
||
# search for catkin in all workspaces | ||
set(CATKIN_TOPLEVEL_FIND_PACKAGE TRUE) | ||
find_package(catkin QUIET | ||
NO_POLICY_SCOPE | ||
PATHS ${catkin_search_path} | ||
NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) | ||
unset(CATKIN_TOPLEVEL_FIND_PACKAGE) | ||
|
||
if(NOT catkin_FOUND) | ||
message(FATAL_ERROR "find_package(catkin) failed. catkin was neither found in the workspace nor in the CMAKE_PREFIX_PATH. One reason may be that no ROS setup.sh was sourced before.") | ||
endif() | ||
endif() | ||
|
||
catkin_workspace() |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,6 @@ | ||
# FTCLocalPlanner | ||
|
||
This repository contains a very simple "follow the carrot" local planner implementation. | ||
A very simple "follow the carrot" local planner implementation. | ||
|
||
## Description | ||
The planner follows a given path as exactly as possible. It calculate the position of the carrot by | ||
taking robots velocity limits into account. If deviation between carrot and robot is above a given | ||
threshold, the planner stops. | ||
|
||
Also it checks for collisions of carrot with obstacles as well as collisions of robot footprint at actual robot pose. It doesn't implement obstacle aviodance but obstacle detection. Following situation will cause the | ||
planner to exit: | ||
- goal reached | ||
- goal (pose) timeout reached | ||
- deviation between carrot and robot | ||
- collision of carrot with obstacles | ||
- collision of robot footprint with obstacles | ||
|
||
## Published Topics | ||
- **`global_point`** (geometry_msgs/PoseStamped) pose of carrot | ||
- **`global_plan`** (nav_msgs/Path) global path to follow | ||
- **`debug_pid`** (ftc_local_planner/PID) debug information of PID calculation | ||
- **`costmap_marker`** (visualization_msgs/Marker) debug information of costmap check | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.