-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Simplify * fix * docker build pass * Fix Realtime * Formatting * Fix build * Readme, last fixes * Typos * rename * Without lib lely * Dawid Suggestions * pre-commit suggestions * remove odom * Build Release * undo rm * Update compose.yaml * Update compose.rviz.yaml * Add suggestions * Build Type and Test * revert panther_lights * Use build up-to * typo * Update README.md Co-authored-by: Dawid Kmak <73443304+KmakD@users.noreply.github.com> * Update demo/compose.rviz.yaml Co-authored-by: Dawid Kmak <73443304+KmakD@users.noreply.github.com> --------- Co-authored-by: Dawid Kmak <73443304+KmakD@users.noreply.github.com>
- Loading branch information
1 parent
658057f
commit 0156b69
Showing
16 changed files
with
276 additions
and
176 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 |
---|---|---|
|
@@ -5,4 +5,4 @@ | |
.dockerignore | ||
.gitignore | ||
Dockerfile.* | ||
README.md | ||
README.md |
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 |
---|---|---|
|
@@ -25,4 +25,4 @@ pyenv | |
Vagrantfile | ||
|
||
.vscode | ||
__pycache__/ | ||
__pycache__/ |
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,37 @@ | ||
--- | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.5.0 | ||
hooks: | ||
- id: check-merge-conflict | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
- id: check-yaml | ||
- id: check-xml | ||
- id: check-added-large-files | ||
- id: check-ast | ||
- id: check-json | ||
- id: name-tests-test | ||
files: ^.*\/test\/.*$ | ||
args: [--pytest-test-first] | ||
|
||
- repo: https://github.com/codespell-project/codespell | ||
rev: v2.2.6 | ||
hooks: | ||
- id: codespell | ||
entry: codespell | ||
|
||
- repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt | ||
rev: 0.2.3 | ||
hooks: | ||
- id: yamlfmt | ||
files: ^(?!.*compose).*$ | ||
args: [--mapping, '2', --sequence, '4', --offset, '2', --width, '100'] | ||
|
||
# Docs - RestructuredText hooks | ||
- repo: https://github.com/PyCQA/doc8 | ||
rev: v1.1.1 | ||
hooks: | ||
- id: doc8 | ||
args: [--max-line-length=100, --ignore=D001] | ||
exclude: ^.*\/CHANGELOG\.rst/.*$ |
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,47 +1,35 @@ | ||
FROM ros:humble-ros-core | ||
ARG ROS_DISTRO=humble | ||
ARG BUILD_TEST=OFF | ||
|
||
SHELL ["/bin/bash", "-c"] | ||
FROM husarnet/ros:${ROS_DISTRO}-ros-core | ||
|
||
ENV HUSARION_ROS_BUILD_TYPE=hardware | ||
|
||
WORKDIR /ros2_ws | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y \ | ||
git \ | ||
python3-dev \ | ||
python3-pip \ | ||
python3-colcon-common-extensions \ | ||
# required for lely instalation | ||
software-properties-common && \ | ||
pip3 install \ | ||
rosdep \ | ||
vcstool && \ | ||
# ---------------------------------- | ||
# Install Lely CANOpen - later to be removed | ||
add-apt-repository ppa:lely/ppa && \ | ||
apt-get update && \ | ||
apt-get install -y \ | ||
liblely-coapp-dev \ | ||
liblely-co-tools \ | ||
python3-dcf-tools && \ | ||
# ---------------------------------- | ||
git clone https://github.com/husarion/panther_ros.git src/panther_ros -b ros2-control && \ | ||
ros-dev-tools && \ | ||
# Setup workspace | ||
git clone -b ros2-devel https://github.com/husarion/panther_ros.git src/panther_ros && \ | ||
vcs import src < src/panther_ros/panther/panther_hardware.repos && \ | ||
rm -r src/panther_ros/panther_gazebo && \ | ||
cd src/panther_msgs && \ | ||
git checkout origin/ros2-control && \ | ||
cd /ros2_ws && \ | ||
# Install dependencies | ||
rosdep init && \ | ||
rosdep update --rosdistro $ROS_DISTRO && \ | ||
rosdep install --from-paths src -y -i --skip-keys mecanum_drive_controller && \ | ||
rosdep install --from-paths src -y -i && \ | ||
# Build | ||
source /opt/ros/$ROS_DISTRO/setup.bash && \ | ||
colcon build --symlink-install --cmake-args "-DCMAKE_BUILD_TYPE=$BUILD_TYPE" "-DCMAKE_EXPORT_COMPILE_COMMANDS=On" -Wall -Wextra -Wpedantic && \ | ||
colcon build --symlink-install --packages-up-to panther --cmake-args -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=$BUILD_TEST && \ | ||
# Get version | ||
echo $(cat /ros2_ws/src/panther_ros/panther/package.xml | grep '<version>' | sed -r 's/.*<version>([0-9]+.[0-9]+.[0-9]+)<\/version>/\1/g') >> /version.txt && \ | ||
# Size optimalization | ||
rm -rf build log && \ | ||
export SUDO_FORCE_REMOVE=yes && \ | ||
apt-get remove -y \ | ||
ros-dev-tools && \ | ||
apt-get autoremove -y && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
RUN echo $(cat /ros2_ws/src/panther_ros/panther/package.xml | grep '<version>' | sed -r 's/.*<version>([0-9]+.[0-9]+.[0-9]+)<\/version>/\1/g') >> /version.txt | ||
|
||
COPY ./ros_entrypoint.sh / | ||
ENTRYPOINT ["/ros_entrypoint.sh"] | ||
# Setup envs from eeprom | ||
RUN sed -i "/# <additional-user-commands>/i set -e -a && source /run/husarion/panther_config.env" /*_entrypoint.sh |
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,38 +1,33 @@ | ||
FROM ros:humble-ros-core | ||
ARG ROS_DISTRO=humble | ||
ARG BUILD_TEST=OFF | ||
|
||
SHELL ["/bin/bash", "-c"] | ||
FROM husarnet/ros:${ROS_DISTRO}-ros-core | ||
|
||
ENV HUSARION_ROS_BUILD_TYPE=simulation | ||
|
||
WORKDIR /ros2_ws | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y \ | ||
git \ | ||
python3-dev \ | ||
python3-pip \ | ||
python3-colcon-common-extensions && \ | ||
pip3 install \ | ||
rosdep \ | ||
vcstool && \ | ||
git clone https://github.com/husarion/ros_components_description.git src/ros_components_description && \ | ||
git clone https://github.com/husarion/panther_ros.git -b ros2-devel && \ | ||
vcs import src < panther_ros/panther/panther_simulation.repos && \ | ||
mv panther_ros/panther_description/ src/panther_description && \ | ||
mv panther_ros/panther_controller/ src/panther_controller && \ | ||
mv panther_ros/panther_bringup/ src/panther_bringup && \ | ||
mv panther_ros/panther_gazebo/ src/panther_gazebo && \ | ||
rm -rf panther_ros && \ | ||
ros-dev-tools && \ | ||
# Setup workspace | ||
git clone -b ros2-devel https://github.com/husarion/panther_ros.git src/panther_ros && \ | ||
vcs import src < src/panther_ros/panther/panther_hardware.repos && \ | ||
vcs import src < src/panther_ros/panther/panther_simulation.repos && \ | ||
# Install dependencies | ||
rosdep init && \ | ||
rosdep update --rosdistro $ROS_DISTRO && \ | ||
rosdep install --from-paths src -y -i && \ | ||
# Build | ||
source /opt/ros/$ROS_DISTRO/setup.bash && \ | ||
colcon build --symlink-install --cmake-args "-DCMAKE_BUILD_TYPE=$BUILD_TYPE" "-DCMAKE_EXPORT_COMPILE_COMMANDS=On" -Wall -Wextra -Wpedantic && \ | ||
colcon build --symlink-install --packages-up-to panther --cmake-args -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=$BUILD_TEST && \ | ||
# Get version | ||
echo $(cat /ros2_ws/src/panther_ros/panther/package.xml | grep '<version>' | sed -r 's/.*<version>([0-9]+.[0-9]+.[0-9]+)<\/version>/\1/g') >> /version.txt && \ | ||
# Size optimalization | ||
rm -rf build log && \ | ||
export SUDO_FORCE_REMOVE=yes && \ | ||
apt-get remove -y \ | ||
ros-dev-tools && \ | ||
apt-get autoremove -y && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
RUN echo $(cat /ros2_ws/src/panther_gazebo/package.xml | grep '<version>' | sed -r 's/.*<version>([0-9]+.[0-9]+.[0-9]+)<\/version>/\1/g') >> /version.txt | ||
|
||
COPY ./ros_entrypoint.sh / | ||
ENTRYPOINT ["/ros_entrypoint.sh"] |
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,55 +1,60 @@ | ||
# panther-docker | ||
|
||
Docker images dedicated to Husarion Panther ROS system and simulation. | ||
|
||
## Docker Images | ||
|
||
Docker images are automatically deployed to Docker Hub. Image tag includes information about the ROS distribution, the version of the [panther_ros](https://github.com/husarion/panther_ros/tree/ros2-devel) repository, and the date of release. Additionally stable image versions are tagged with `stable` and recommended for production use. | ||
Docker images are automatically deployed to Docker Hub. Image tag includes information about the ROS distribution, the version of the [panther_ros](https://github.com/husarion/panther_ros/tree/ros2-devel) repository, and the date of release. Additionally stable image versions are tagged with `stable` and recommended for production use. | ||
Below, you can find a list of available Docker images. To access the latest tag, simply follow provided links: | ||
|
||
- [husarion/panther](https://hub.docker.com/r/husarion/panther) - ROS packages for Panther robot, | ||
- [husarion/panther](https://hub.docker.com/r/husarion/panther) - ROS packages for Panther robot, | ||
- [husarion/panther-gazebo](https://hub.docker.com/r/husarion/panther-gazebo) - Simulation for Panther robot in Gazebo-classic. | ||
|
||
## Updating Panther Software | ||
|
||
> **Note** | ||
> Latest Panther Docker images are compatible with Built-in Computer OS version 2.0.0 and newer. If your operating system is older, please ensure you update it before proceeding. **[COMMING SOON]** Follow [operating system reinstallation](ros2-os-instalation-link) for more info. | ||
> [!Note] Latest Panther Docker images are compatible with Built-in Computer OS version 2.0.0 and newer. If your operating system is older, please ensure you update it before proceeding. **[COMING SOON]** Follow [operating system reinstallation](ros2-os-instalation-link) for more info. | ||
Connect to Panther's Built-in Computer: | ||
|
||
```bash | ||
ssh husarion@10.15.20.2 | ||
``` | ||
|
||
Edit Docker compose file: | ||
```bash | ||
nano compose.yaml | ||
``` | ||
## Quick Start | ||
|
||
Update Docker image tag: | ||
```yaml | ||
panther_ros: | ||
image: husarion/panther:<newest-stable-tag> # example tag: humble-2.0.0-20231208-stable | ||
``` | ||
Depending on your needs, you can run Docker to quickly launch the physical robot or run a simulation. To do this, clone this repository to your robot or computer. | ||
|
||
Restart Docker containers: | ||
```bash | ||
docker compose up -d --force-recreate | ||
git clone -b ros2 https://github.com/husarion/panther-docker.git | ||
cd panther-docker/demo | ||
``` | ||
|
||
## Running Simulation | ||
### 🤖 Robot | ||
|
||
1. Activate Panther | ||
|
||
```bash | ||
docker compose -f compose.minimal-setup.yaml up | ||
``` | ||
|
||
2. Launch Visualization on PC | ||
|
||
```bash | ||
xhost local:root | ||
docker compose -f compose.rviz.yaml up | ||
``` | ||
|
||
> [!NOTE] | ||
> To use the latest version of the image, run the `docker compose pull` command and rerun above commands. | ||
### 💻 Gazebo Simulation | ||
|
||
To give Docker access to your screen run: | ||
```bash | ||
xhost local:docker | ||
``` | ||
|
||
Depending on your hardware configuration your `compose.yaml` file may differ. For Intel and AMD users you will need the following configuration: [compose.simulation.yaml](./demo/simulation/compose.simulation.yaml). | ||
To launch the simulation, from the directory containing Docker compose file run: | ||
```bash | ||
docker compose -f compose.simulation.yaml up | ||
xhost local:docker | ||
docker compose -f compose.simulation.yaml up | ||
``` | ||
|
||
Nvidia users have to install NVIDIA Container Toolkit. Installation steps can be found [here](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html). With NVIDIA Container Toolkit installed following Docker compose file will be needed: [compose.simulation-gpu.yaml](./demo/simulation/compose.simulation-gpu.yaml). | ||
To launch the simulation, from the directory containing Docker compose file run: | ||
```bash | ||
docker compose -f compose.simulation-gpu.yaml up | ||
``` | ||
> [!NOTE] | ||
> If you have an NVIDIA GPU, it is worth changing the compose configuration from cpu-config to gpu-config. For this purpose, it is necessary to install [NVIDIA Container Toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html). With NVIDIA Container Toolkit installed, modify following Docker compose file by replacing `*cpu-config` with `*gpu-config`: [compose.simulation.yaml](./demo/compose.simulation.yaml). |
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,3 @@ | ||
DISPLAY=${DISPLAY:?You need to define display env} | ||
LIBGL_ALWAYS_SOFTWARE=1 | ||
QT_X11_NO_MITSHM=1 |
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,3 @@ | ||
DISPLAY=${DISPLAY:?You need to define display env} | ||
NVIDIA_VISIBLE_DEVICES=all | ||
NVIDIA_DRIVER_CAPABILITIES=all |
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.