Skip to content

Commit

Permalink
Fix Realtime
Browse files Browse the repository at this point in the history
  • Loading branch information
rafal-gorecki committed Mar 4, 2024
1 parent e59cc3c commit 48429fd
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 41 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ros-docker-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
with:
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }}
main_branch_name: ros2-devel
main_branch_name: ros2
dockerfile: ${{ matrix.dockerfile }}
repo_name: ${{ matrix.repo_name }}
build_type: ${{ inputs.build_type }}
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.hardware
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ RUN apt-get update && \
# 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 src && \
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/*

COPY ./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
ENTRYPOINT ["/ros_entrypoint.sh"]
23 changes: 23 additions & 0 deletions demo/compose.rviz.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
x-common-config:
&common-config
network_mode: host
ipc: host
restart: always

x-cpu-config:
&cpu-config
env_file: .env.cpu

x-gpu-config:
&gpu-config
runtime: nvidia
env_file: .env.gpu

rviz:
image: husarion/rviz2:humble
<<:
- *common-config
- *cpu-config
volumes:
- /tmp/.X11-unix:/tmp/.X11-unix:rw
- ./panther.rviz:/root/.rviz2/default.rviz
13 changes: 2 additions & 11 deletions demo/compose.simulation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,12 @@ services:
panther:
image: husarion/panther-gazebo:humble
# build:
# context: ..
# dockerfile: Dockerfile.simulation
# context: ..
# dockerfile: Dockerfile.simulation
<<:
- *common-config
- *cpu-config
volumes:
- /tmp/.X11-unix:/tmp/.X11-unix:rw
command: >
ros2 launch panther_gazebo simulation.launch.py
rviz:
image: husarion/rviz2:humble
<<:
- *common-config
- *cpu-config
volumes:
- /tmp/.X11-unix:/tmp/.X11-unix:rw
- ./panther.rviz:/root/.rviz2/default.rviz
25 changes: 12 additions & 13 deletions demo/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ x-gpu-config:

services:
panther:
image: husarion/panther:humble
# build:
# context: ..
# dockerfile: Dockerfile.hardware
# image: husarion/panther:humble
build:
context: ..
dockerfile: Dockerfile.hardware
<<: *common-config
devices:
- /dev/bus/usb
Expand All @@ -30,6 +30,14 @@ services:
- /sys/bus/iio/devices:/sys/bus/iio/devices
- /run/husarion/panther_config.env:/run/husarion/panther_config.env
- /run/husarion/panther_config.yaml:/run/husarion/panther_config.yaml
# Realtime hardware (https://control.ros.org/master/doc/ros2_control/controller_manager/doc/userdoc.html#determinism)
ulimits:
rtprio:
soft: 99
hard: 99
memlock:
soft: 102400
hard: 102400
command: >
ros2 launch panther_bringup bringup.launch.py
Expand All @@ -43,12 +51,3 @@ services:
"ros2 launch
joy2twist gamepad_controller.launch.py
joy2twist_params_file:=$(ros2 pkg prefix joy2twist)/share/joy2twist/config/joy2twist_panther.yaml"
rviz:
image: husarion/rviz2:humble-11.2.8-20231122
<<:
- *common-config
- *cpu-config
volumes:
- /tmp/.X11-unix:/tmp/.X11-unix:rw
- ./panther.rviz:/root/.rviz2/default.rviz
14 changes: 0 additions & 14 deletions ros_entrypoint.sh

This file was deleted.

0 comments on commit 48429fd

Please sign in to comment.