Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NASA_Challenge_[@RBinson]_[Lunar Pole Exploration Rover & Plugins] #43

Open
wants to merge 23 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
a618cb0
Add lunar_pole_exploration_rover demo (fix issue #36)
RBinsonB Sep 6, 2024
167c069
Add documentation on the lunar pole exploration demo (fix issue #36)
RBinsonB Sep 6, 2024
f928aae
Add license (fix issue #36)
stevedanomodolor Sep 6, 2024
180e3e3
Add licence (fix issue #36)
stevedanomodolor Sep 6, 2024
7391144
Include power consumption info #36
stevedanomodolor Sep 6, 2024
5c56110
Change Dockerfile and add build and run scripts (fix issue #36)
RBinsonB Sep 6, 2024
201d2a6
update dockerfile #36
stevedanomodolor Sep 6, 2024
a3ad3e1
update dockerfile #36
stevedanomodolor Sep 6, 2024
2bee392
fix typo (fixes issue #36)
stevedanomodolor Sep 6, 2024
7576771
fix build (fixes issue #36)
stevedanomodolor Sep 7, 2024
bbae28e
fix build.sh file (fixes issue #36)
stevedanomodolor Sep 7, 2024
62eac35
move docker file (fix issue #36)
stevedanomodolor Sep 7, 2024
94984ad
include topic for activating/deactivating sensors (fix issue #36)
stevedanomodolor Sep 8, 2024
1dfd437
add missing topic (fix issue #36)
stevedanomodolor Sep 8, 2024
ca9a333
Fix build path issue(fix issue #36)
stevedanomodolor Sep 9, 2024
a0a14d4
Include new topics to README (fix issue #36)
stevedanomodolor Sep 9, 2024
aa17a2b
add missing dependencies (fix issue #36)
stevedanomodolor Sep 10, 2024
1c7f5ad
Add hazcam info and warning (fix issue #36)
RBinsonB Sep 10, 2024
a563ec7
Use lower speeds (fix issue #36)
RBinsonB Sep 10, 2024
9448fb0
Fix error in Freelancer name (fix issue #36)
RBinsonB Sep 10, 2024
9d40a47
Add missing package to docker build
RBinsonB Sep 10, 2024
2151349
Add missing packages for RViz build (fix issue #36)
RBinsonB Sep 11, 2024
2636d01
Fix docker naming (fix issue #22)
RBinsonB Sep 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions lunar_pole_exploration_rover/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
cmake_minimum_required(VERSION 3.8)
project(lunar_pole_exploration_rover)

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()

# find dependencies
find_package(ament_cmake REQUIRED)
find_package(ament_cmake_python REQUIRED)
find_package(control_msgs REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(rclcpp REQUIRED)
find_package(rclcpp_action REQUIRED)
find_package(rclpy REQUIRED)
find_package(simulation REQUIRED)
find_package(std_msgs REQUIRED)
# uncomment the following section in order to fill in
# further dependencies manually.
# find_package(<dependency> REQUIRED)

if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
# the following line skips the linter which checks for copyrights
# comment the line when a copyright and license is added to all source files
set(ament_cmake_copyright_FOUND TRUE)
# the following line skips cpplint (only works in a git repo)
# comment the line when this package is in a git repo and when
# a copyright and license is added to all source files
set(ament_cmake_cpplint_FOUND TRUE)
ament_lint_auto_find_test_dependencies()
endif()

install(DIRECTORY
config
launch
worlds
DESTINATION share/${PROJECT_NAME}
)

ament_python_install_package(${PROJECT_NAME})

install(PROGRAMS
nodes/move_mast
nodes/move_wheel
nodes/run_demo
nodes/odom_tf_publisher
DESTINATION lib/${PROJECT_NAME}
)

ament_package()
153 changes: 153 additions & 0 deletions lunar_pole_exploration_rover/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
# Copyright 2021 Open Source Robotics Foundation, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# A Docker configuration script to build the Space ROS image.
#
# The script provides the following build arguments:
#
# VCS_REF - The git revision of the Space ROS source code (no default value).
# VERSION - The version of Space ROS (default: "preview")

FROM osrf/space-ros:latest

# Define arguments used in the metadata definition
ARG VCS_REF
ARG VERSION="preview"

# Specify the docker image metadata
LABEL org.label-schema.schema-version="1.0"
LABEL org.label-schema.name="Lunar Pole Exploration Rover"
LABEL org.label-schema.description="Lunar Pole Exploration Rover entry for the NASA Space ROS Sim Summer Sprint Challenge"
LABEL org.label-schema.vendor="Open Robotics"
LABEL org.label-schema.version=${VERSION}
LABEL org.label-schema.url="https://github.com/space-ros"
LABEL org.label-schema.vcs-url="https://github.com/space-ros/demos"
LABEL org.label-schema.vcs-ref=${VCS_REF}

# Disable prompting during package installation
ARG DEBIAN_FRONTEND=noninteractive

# Define a few key variables
ENV DEMO_DIR=${HOME_DIR}/demos_ws
ENV IGNITION_VERSION=fortress
ENV GZ_VERSION=fortress

# Clone all space-ros sources
RUN mkdir ${SPACEROS_DIR}/src \
&& vcs import ${SPACEROS_DIR}/src < ${SPACEROS_DIR}/exact.repos

# Define key locations
RUN mkdir -p ${DEMO_DIR}/src
WORKDIR ${DEMO_DIR}


# Make sure the latest versions of packages are installed
# Using Docker BuildKit cache mounts for /var/cache/apt and /var/lib/apt ensures that
# the cache won't make it into the built image but will be maintained between steps.
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
sudo apt-get update
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
sudo apt-get dist-upgrade -y
RUN rosdep update

# Install the various build and test tools
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
sudo apt install -y \
build-essential \
clang-format \
cmake \
git \
libbullet-dev \
python3-colcon-common-extensions \
python3-flake8 \
python3-pip \
python3-pytest-cov \
python3-rosdep \
python3-setuptools \
python3-vcstool \
wget

# Install some pip packages needed for testing
RUN python3 -m pip install -U \
argcomplete \
flake8-blind-except \
flake8-builtins \
flake8-class-newline \
flake8-comprehensions \
flake8-deprecated \
flake8-docstrings \
flake8-import-order \
flake8-quotes \
pytest-repeat \
pytest-rerunfailures \
pytest

# Get rosinstall_generator
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
sudo apt-get update -y && sudo apt-get install -y python3-rosinstall-generator


# Generate repos file for dependencies, excluding packages from Space ROS core.
COPY --chown=${USERNAME}:${USERNAME} demo-pkgs.txt /tmp/
COPY --chown=${USERNAME}:${USERNAME} excluded-pkgs.txt /tmp/
RUN rosinstall_generator \
--upstream \
--rosdistro ${ROSDISTRO} \
--deps \
--exclude-path ${SPACEROS_DIR}/src \
--exclude $(cat /tmp/excluded-pkgs.txt) -- \
-- $(cat /tmp/demo-pkgs.txt) \
> /tmp/demo_generated_pkgs.repos

RUN vcs import src < /tmp/demo_generated_pkgs.repos

# Get the source for the dependencies
COPY --chown=${USERNAME}:${USERNAME} demo_manual_pkgs.repos /tmp/
RUN vcs import src < /tmp/demo_manual_pkgs.repos && /bin/bash -c 'source "${SPACEROS_DIR}/install/setup.bash"'

RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
sudo apt-get update -y \
&& /bin/bash -c 'source "${SPACEROS_DIR}/install/setup.bash"' \
&& rosdep install --from-paths src --ignore-src -r -y --rosdistro ${ROSDISTRO}

ENV MAKEFLAGS="-j1"

# build demo
RUN /bin/bash -c 'source ${SPACEROS_DIR}/install/setup.bash \
&& colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=ON --event-handlers desktop_notification- status-'


# Add the user to the render group so that the user can access /dev/dri/renderD128
RUN sudo usermod -aG render $USERNAME

# Add a couple sample GUI apps for testing
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
sudo apt-get install -y \
firefox \
glmark2 \
libcanberra-gtk3-0 \
libpci-dev \
xauth \
xterm

# Setup the entrypoint
COPY ./entrypoint.sh /
ENTRYPOINT ["/entrypoint.sh"]
CMD ["bash"]
Loading
Loading