-
Notifications
You must be signed in to change notification settings - Fork 36
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
1 parent
ae03d6c
commit ebf3d7a
Showing
8 changed files
with
516 additions
and
0 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,55 @@ | ||
# 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 Navigation2/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_nav2: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="Navigation2 demo" | ||
LABEL org.label-schema.description="Preview version of the Navigation2/Space ROS platform" | ||
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/docker" | ||
LABEL org.label-schema.vcs-ref=${VCS_REF} | ||
|
||
# Disable prompting during package installation | ||
ARG DEBIAN_FRONTEND=noninteractive | ||
|
||
# Define workspace locations | ||
ENV NAVIGATION2_WS=${HOME_DIR}/nav2_ws | ||
ENV NAV2_DEPS_WS=${HOME_DIR}/nav2_deps_ws | ||
|
||
# Setup mars_rover demo | ||
# Install map file for localization | ||
COPY mars_map* /home/spaceros-user/nav2_ws | ||
|
||
# Install nav2 config file for mars rover demo | ||
COPY nav2_params.yaml /home/spaceros-user/nav2_ws | ||
|
||
# Set up the entrypoint | ||
COPY ./entrypoint.sh / | ||
ENTRYPOINT ["/entrypoint.sh"] | ||
CMD ["bash"] |
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,51 @@ | ||
# This folder contains the necessary files for running Nav2 on the Mars Rover demo | ||
|
||
# This demo is a preliminary release, please file any issues found | ||
|
||
## First build this container using the build script | ||
|
||
``` | ||
build.sh | ||
``` | ||
|
||
There will now be a docker image called "osrf/space_nav2_demo:latest". | ||
|
||
# Run the Mars Rover demo with Nav2 and SLAM toolbox | ||
|
||
## Terminal 1 - launch the mars_rover demo | ||
|
||
Follow instructions on space-ros/docker/space-robots/README.md. | ||
|
||
## Terminal 2 - launch Nav2 | ||
|
||
Start the space_nav2 container and launch the navigation2 nodes: | ||
|
||
``` | ||
./run.sh | ||
ros2 launch nav2_bringup navigation_launch.py use_sim_time:=True params_file:=nav2_params.yaml | ||
``` | ||
|
||
## Terminal 3 - launch localization with map | ||
|
||
``` | ||
docker exec -it osrf_space_nav2_demo bash | ||
source install/setup.bash | ||
ros2 launch nav2_bringup localization_launch.py use_sim_time:=True map:=mars_map.yaml | ||
``` | ||
|
||
## Terminal 4 - launch Rviz | ||
|
||
Exec into the same space_nav2 container and launch Rviz2: | ||
|
||
``` | ||
docker exec -it -e DISPLAY=:0 osrf_space_nav2_demo bash | ||
source /opt/ros/humble/setup.bash | ||
source install/setup.bash | ||
ros2 launch nav2_bringup rviz_launch.py | ||
``` | ||
|
||
## Localize the robot and send a Nav2 goal | ||
|
||
In the Rviz GUI, localize robot in Rviz using 2D Pose estimate tool, with an arrow pointing up at the center of the grid. | ||
Wait for Nav2 to initialize / costmaps to appear. | ||
When the costmap appears, send a goal using the "Nav2 goal" tool in Rviz |
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,23 @@ | ||
#!/usr/bin/env bash | ||
|
||
ORG=osrf | ||
IMAGE=space_nav2_demo | ||
TAG=latest | ||
|
||
VCS_REF="" | ||
VERSION=preview | ||
|
||
# Exit script with failure if build fails | ||
set -eo pipefail | ||
|
||
echo "" | ||
echo "##### Building Navigation2/Space ROS Docker Image #####" | ||
echo "" | ||
|
||
docker build -t $ORG/$IMAGE:$TAG \ | ||
--build-arg VCS_REF="$VCS_REF" \ | ||
--build-arg VERSION="$VERSION" . | ||
|
||
echo "" | ||
echo "##### Done! #####" | ||
|
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,6 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
# Setup the Navigation2 environment | ||
source "/home/spaceros-user/nav2_ws/install/setup.bash" | ||
exec "$@" |
Large diffs are not rendered by default.
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,7 @@ | ||
image: mars_map.pgm | ||
mode: trinary | ||
resolution: 0.05 | ||
origin: [-28.2, -22.1, 0] | ||
negate: 0 | ||
occupied_thresh: 0.65 | ||
free_thresh: 0.25 |
Oops, something went wrong.