From cba325a5743d6673d29e1ad70fa50a1e9c76b0d3 Mon Sep 17 00:00:00 2001 From: KmakD Date: Fri, 30 Aug 2024 09:23:13 +0000 Subject: [PATCH 01/17] change branch --- Dockerfile.hardware | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile.hardware b/Dockerfile.hardware index a16c142..b53dbfc 100644 --- a/Dockerfile.hardware +++ b/Dockerfile.hardware @@ -13,7 +13,7 @@ RUN apt-get update && \ apt-get install -y \ ros-dev-tools && \ # Setup workspace - git clone -b ros2-devel https://github.com/husarion/panther_ros.git src/panther_ros && \ + git clone -b ros2-lynx-alpha https://github.com/husarion/panther_ros.git src/panther_ros && \ vcs import src < src/panther_ros/panther/panther_${HUSARION_ROS_BUILD_TYPE}.repos && \ cp -r src/ros2_controllers/diff_drive_controller src && \ cp -r src/ros2_controllers/imu_sensor_broadcaster src && \ From 7c68025fbde14a56c9ca8c0ffd90ea679b4692b0 Mon Sep 17 00:00:00 2001 From: KmakD Date: Fri, 30 Aug 2024 09:42:33 +0000 Subject: [PATCH 02/17] update compose --- demo/compose.minimal-setup.yaml | 10 ++++++---- demo/joy2twist_lynx.yaml | 31 +++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 4 deletions(-) create mode 100644 demo/joy2twist_lynx.yaml diff --git a/demo/compose.minimal-setup.yaml b/demo/compose.minimal-setup.yaml index 5365304..f49016c 100644 --- a/demo/compose.minimal-setup.yaml +++ b/demo/compose.minimal-setup.yaml @@ -4,11 +4,11 @@ x-common-config: &common-config restart: always environment: - RMW_IMPLEMENTATION=rmw_cyclonedds_cpp # Default FastDDS do not work - - ROBOT_NAMESPACE=panther + - ROBOT_NAMESPACE=lynx - ROS_DOMAIN_ID=${ROS_DOMAIN_ID:-0} services: panther_ros: - image: husarion/panther:humble-2.1.0-20240723 + image: husarion/panther:humble-ros2-lynx-alpha container_name: panther_ros <<: *common-config devices: @@ -34,16 +34,18 @@ services: soft: 102400 hard: 102400 command: > - ros2 launch panther_bringup bringup.launch.py + ros2 launch lynx_bringup bringup.launch.py gamepad_controller: image: husarion/joy2twist:humble-1.0.0-20240725-stable container_name: gamepad_controller <<: *common-config + volumes: + - ./joy2twist_lynx.yaml:/joy2twist.yaml devices: - /dev/input/js0 device_cgroup_rules: - 'c 13:0 rmw' # gamepad stop_signal: SIGINT command: > - bash -c "ros2 launch joy2twist gamepad_controller.launch.py joy2twist_params_file:=$(ros2 pkg prefix joy2twist)/share/joy2twist/config/joy2twist_panther.yaml namespace:=panther" + bash -c "ros2 launch joy2twist gamepad_controller.launch.py joy2twist_params_file:=/joy2twist.yaml namespace:=lynx" \ No newline at end of file diff --git a/demo/joy2twist_lynx.yaml b/demo/joy2twist_lynx.yaml new file mode 100644 index 0000000..131f407 --- /dev/null +++ b/demo/joy2twist_lynx.yaml @@ -0,0 +1,31 @@ +/**: + ros__parameters: + linear_velocity_factor: + fast: 2.0 + regular: 1.2 + slow: 0.4 + + angular_velocity_factor: + fast: 1.88 + regular: 0.78 + slow: 0.39 + + e_stop: + present: true + topic: /lynx/hardware/e_stop + reset_srv: /lynx/hardware/e_stop_reset + trigger_srv: /lynx/hardware/e_stop_trigger + + # This button mapping should be adjusted to the specific controller + # The following map is suited for Logitech F710 + button_index_map: + axis: + angular_z: 2 # Right joystick + linear_x: 1 # Left joystick + linear_y: 0 # Left joystick + dead_man_switch: 4 # LB + fast_mode: 7 # RT + slow_mode: 5 # RB + e_stop_reset: 1 # A + e_stop_trigger: 2 # B + enable_e_stop_reset: 6 # LT \ No newline at end of file From 2e37eb0892852bdc551a83767de853540424747f Mon Sep 17 00:00:00 2001 From: KmakD Date: Mon, 2 Sep 2024 09:04:52 +0000 Subject: [PATCH 03/17] fix naming --- demo/compose.minimal-setup.yaml | 4 ++-- demo/joy2twist_lynx.yaml | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/demo/compose.minimal-setup.yaml b/demo/compose.minimal-setup.yaml index f49016c..efed9ef 100644 --- a/demo/compose.minimal-setup.yaml +++ b/demo/compose.minimal-setup.yaml @@ -7,9 +7,9 @@ x-common-config: &common-config - ROBOT_NAMESPACE=lynx - ROS_DOMAIN_ID=${ROS_DOMAIN_ID:-0} services: - panther_ros: + lynx_ros: image: husarion/panther:humble-ros2-lynx-alpha - container_name: panther_ros + container_name: lynx_ros <<: *common-config devices: - /dev/bus/usb diff --git a/demo/joy2twist_lynx.yaml b/demo/joy2twist_lynx.yaml index 131f407..aa13504 100644 --- a/demo/joy2twist_lynx.yaml +++ b/demo/joy2twist_lynx.yaml @@ -1,14 +1,14 @@ /**: ros__parameters: linear_velocity_factor: - fast: 2.0 - regular: 1.2 - slow: 0.4 + fast: 1.5 + regular: 0.9 + slow: 0.3 angular_velocity_factor: - fast: 1.88 - regular: 0.78 - slow: 0.39 + fast: 1.4 + regular: 0.58 + slow: 0.3 e_stop: present: true From ec5222d02e57c3d01689ec6f10f8e5afaff557b1 Mon Sep 17 00:00:00 2001 From: kmakd Date: Mon, 16 Sep 2024 09:52:18 +0000 Subject: [PATCH 04/17] rename config files --- Dockerfile.hardware | 2 +- demo/compose.minimal-setup.yaml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile.hardware b/Dockerfile.hardware index 198b39f..eb19eec 100644 --- a/Dockerfile.hardware +++ b/Dockerfile.hardware @@ -38,4 +38,4 @@ RUN apt-get update && \ rm -rf /var/lib/apt/lists/* # Setup envs from eeprom -RUN sed -i "/# /i set -e -a && source /run/husarion/panther_config.env" /*_entrypoint.sh +RUN sed -i "/# /i set -e -a && source /run/husarion/robot_config.env" /*_entrypoint.sh diff --git a/demo/compose.minimal-setup.yaml b/demo/compose.minimal-setup.yaml index 507bd5d..3451da6 100644 --- a/demo/compose.minimal-setup.yaml +++ b/demo/compose.minimal-setup.yaml @@ -21,8 +21,8 @@ services: - 'c 254:0 rmw' # gpiochip0 - 'c 153:* rmw' # spiled-channel1, spiled-channel2 volumes: - - /run/husarion/panther_config.env:/run/husarion/panther_config.env - - /run/husarion/panther_config.yaml:/run/husarion/panther_config.yaml + - /run/husarion/robot_config.env:/run/husarion/robot_config.env + - /run/husarion/robot_config.yaml:/run/husarion/robot_config.yaml - /sys/bus/iio/devices:/sys/bus/iio/devices:ro # Read-only access to IIO devices - ~/.ssh/id_rsa:/root/.ssh/id_rsa # Realtime hardware (https://control.ros.org/master/doc/ros2_control/controller_manager/doc/userdoc.html#determinism) From 64f89245fbc771ac2622e2cfe70eda2d4d682ffb Mon Sep 17 00:00:00 2001 From: kmakd Date: Fri, 11 Oct 2024 09:18:55 +0000 Subject: [PATCH 05/17] Update packages names --- Dockerfile.hardware | 6 +++--- Dockerfile.simulation | 6 +++--- demo/compose.minimal-setup.yaml | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Dockerfile.hardware b/Dockerfile.hardware index eb19eec..3e26b9b 100644 --- a/Dockerfile.hardware +++ b/Dockerfile.hardware @@ -16,7 +16,7 @@ RUN apt-get update && \ ros-dev-tools && \ # Setup workspace git clone -b ${BRANCH_NAME} https://github.com/husarion/panther_ros.git src/panther_ros && \ - vcs import src < src/panther_ros/panther/panther_${HUSARION_ROS_BUILD_TYPE}.repos && \ + vcs import src < src/panther_ros/husarion_ugv/${HUSARION_ROS_BUILD_TYPE}_deps.repos && \ cp -r src/ros2_controllers/diff_drive_controller src && \ cp -r src/ros2_controllers/imu_sensor_broadcaster src && \ rm -rf src/ros2_controllers && \ @@ -26,9 +26,9 @@ RUN apt-get update && \ rosdep install --from-paths src -y -i && \ # Build source /opt/ros/$ROS_DISTRO/setup.bash && \ - colcon build --symlink-install --packages-up-to panther --cmake-args -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=$BUILD_TEST && \ + colcon build --symlink-install --packages-up-to husarion_ugv --cmake-args -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=$BUILD_TEST && \ # Get version - echo $(cat /ros2_ws/src/panther_ros/panther/package.xml | grep '' | sed -r 's/.*([0-9]+.[0-9]+.[0-9]+)<\/version>/\1/g') >> /version.txt && \ + echo $(cat /ros2_ws/src/panther_ros/husarion_ugv/package.xml | grep '' | sed -r 's/.*([0-9]+.[0-9]+.[0-9]+)<\/version>/\1/g') >> /version.txt && \ # Size optimalization export SUDO_FORCE_REMOVE=yes && \ apt-get remove -y \ diff --git a/Dockerfile.simulation b/Dockerfile.simulation index 222c5cc..881af7b 100644 --- a/Dockerfile.simulation +++ b/Dockerfile.simulation @@ -16,7 +16,7 @@ RUN apt-get update && \ ros-dev-tools && \ # Setup workspace git clone -b ${BRANCH_NAME} https://github.com/husarion/panther_ros.git src/panther_ros && \ - vcs import src < src/panther_ros/panther/panther_${HUSARION_ROS_BUILD_TYPE}.repos && \ + vcs import src < src/panther_ros/husarion_ugv/${HUSARION_ROS_BUILD_TYPE}_deps.repos && \ cp -r src/ros2_controllers/diff_drive_controller src && \ cp -r src/ros2_controllers/imu_sensor_broadcaster src && \ rm -rf src/ros2_controllers && \ @@ -26,9 +26,9 @@ RUN apt-get update && \ rosdep install --from-paths src -y -i && \ # Build source /opt/ros/$ROS_DISTRO/setup.bash && \ - colcon build --symlink-install --packages-up-to panther --cmake-args -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=$BUILD_TEST && \ + colcon build --symlink-install --packages-up-to husarion_ugv --cmake-args -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=$BUILD_TEST && \ # Get version - echo $(cat /ros2_ws/src/panther_ros/panther/package.xml | grep '' | sed -r 's/.*([0-9]+.[0-9]+.[0-9]+)<\/version>/\1/g') >> /version.txt && \ + echo $(cat /ros2_ws/src/panther_ros/husarion_ugv/package.xml | grep '' | sed -r 's/.*([0-9]+.[0-9]+.[0-9]+)<\/version>/\1/g') >> /version.txt && \ # Size optimalization export SUDO_FORCE_REMOVE=yes && \ apt-get remove -y \ diff --git a/demo/compose.minimal-setup.yaml b/demo/compose.minimal-setup.yaml index 3451da6..c96aab3 100644 --- a/demo/compose.minimal-setup.yaml +++ b/demo/compose.minimal-setup.yaml @@ -8,7 +8,7 @@ x-common-config: &common-config - ROS_DOMAIN_ID=${ROS_DOMAIN_ID:-0} services: lynx_ros: - image: husarion/panther:humble-ros2-lynx-alpha + image: husarion/panther:humble-ros2-lynx-devel container_name: lynx_ros <<: *common-config devices: @@ -34,7 +34,7 @@ services: soft: 102400 hard: 102400 command: > - ros2 launch lynx_bringup bringup.launch.py + ros2 launch husarion_ugv_bringup bringup.launch.py gamepad_controller: image: husarion/joy2twist:humble-1.0.0-20240725-stable From dbf7cbea04a99d82fcee9752a5b9a60ce55b864a Mon Sep 17 00:00:00 2001 From: kmakd Date: Wed, 20 Nov 2024 11:03:39 +0000 Subject: [PATCH 06/17] add config setup --- Dockerfile.hardware | 7 +++++-- demo/compose.minimal-setup.yaml | 12 +++++------ setup_environment.sh | 13 ++++++++++++ update_config_directory.sh | 35 +++++++++++++++++++++++++++++++++ 4 files changed, 59 insertions(+), 8 deletions(-) create mode 100755 setup_environment.sh create mode 100755 update_config_directory.sh diff --git a/Dockerfile.hardware b/Dockerfile.hardware index 3e26b9b..a2be1e1 100644 --- a/Dockerfile.hardware +++ b/Dockerfile.hardware @@ -37,5 +37,8 @@ RUN apt-get update && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* -# Setup envs from eeprom -RUN sed -i "/# /i set -e -a && source /run/husarion/robot_config.env" /*_entrypoint.sh +COPY update_config_directory.sh /usr/local/sbin/update_config_directory +COPY setup_environment.sh /usr/local/sbin/setup_environment + +# # Setup envs from eeprom +RUN sed -i "/# /i setup_environment" /*_entrypoint.sh diff --git a/demo/compose.minimal-setup.yaml b/demo/compose.minimal-setup.yaml index c96aab3..bfc655c 100644 --- a/demo/compose.minimal-setup.yaml +++ b/demo/compose.minimal-setup.yaml @@ -2,14 +2,13 @@ x-common-config: &common-config network_mode: host ipc: host restart: always - environment: - - RMW_IMPLEMENTATION=rmw_cyclonedds_cpp # Default FastDDS do not work - - ROBOT_NAMESPACE=lynx - - ROS_DOMAIN_ID=${ROS_DOMAIN_ID:-0} + env_file: + - ./config/.env + services: - lynx_ros: + husarion_ugv_ros: image: husarion/panther:humble-ros2-lynx-devel - container_name: lynx_ros + container_name: husarion_ugv_ros <<: *common-config devices: - /dev/bus/usb @@ -25,6 +24,7 @@ services: - /run/husarion/robot_config.yaml:/run/husarion/robot_config.yaml - /sys/bus/iio/devices:/sys/bus/iio/devices:ro # Read-only access to IIO devices - ~/.ssh/id_rsa:/root/.ssh/id_rsa + - ./config:/config # Realtime hardware (https://control.ros.org/master/doc/ros2_control/controller_manager/doc/userdoc.html#determinism) ulimits: rtprio: diff --git a/setup_environment.sh b/setup_environment.sh new file mode 100755 index 0000000..7319ec4 --- /dev/null +++ b/setup_environment.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -e + +# source robot environment +source /run/husarion/robot_config.env + +# Copy files to /config directory if the directory is empty except for .env file +if [ "$(ls /config | grep -v '^\.env$')" ]; then + echo "Config directory is not empty, skipping file copy." +else + echo "Config directory is empty, copying files." + update_config_directory +fi diff --git a/update_config_directory.sh b/update_config_directory.sh new file mode 100755 index 0000000..2c74060 --- /dev/null +++ b/update_config_directory.sh @@ -0,0 +1,35 @@ +#!/bin/bash +set -e + +# method to copy directory/file using package name +copy_package_file() { + local package_name=$1 + local file_name=$2 + local package_file_path=$(ros2 pkg prefix $package_name)/share/$package_name/$file_name + + if [ ! -d "/config/$package_name" ]; then + mkdir -p /config/$package_name + fi + + # create subdirectories for files with subdirectories + if [[ $file_name == */* ]]; then + local subdirectory=$(dirname $file_name) + if [ ! -d "/config/$package_name/$subdirectory" ]; then + mkdir -p /config/$package_name/$subdirectory + fi + fi + + if [ -d "$package_file_path" ]; then + cp -rL $package_file_path /config/$package_name || true + else + cp -L $package_file_path /config/$package_name/$file_name || true + fi +} + +copy_package_file husarion_ugv_controller config +# copy_package_file husarion_ugv_description config/components.yaml +copy_package_file husarion_ugv_lights config/user_animations.yaml +copy_package_file husarion_ugv_localization config +rm /config/husarion_ugv_localization/config/nmea_navsat.yaml || true +copy_package_file husarion_ugv_manager behavior_trees/lights.xml +copy_package_file husarion_ugv_manager behavior_trees/LightsBT.btproj From aa393790d8ff61de0bb44160c475ec2da9b64ae1 Mon Sep 17 00:00:00 2001 From: kmakd Date: Fri, 22 Nov 2024 07:54:21 +0000 Subject: [PATCH 07/17] update scripts --- setup_environment.sh | 6 ++---- update_config_directory.sh | 3 ++- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/setup_environment.sh b/setup_environment.sh index 7319ec4..33187db 100755 --- a/setup_environment.sh +++ b/setup_environment.sh @@ -4,10 +4,8 @@ set -e # source robot environment source /run/husarion/robot_config.env -# Copy files to /config directory if the directory is empty except for .env file -if [ "$(ls /config | grep -v '^\.env$')" ]; then - echo "Config directory is not empty, skipping file copy." -else +# Copy files to /config directory if the directory is empty except for .env and cyclonedds.xml +if [ "! $(ls /config | grep -v '^\.env$' | grep -v '^\cyclonedds.xml$')" ]; then echo "Config directory is empty, copying files." update_config_directory fi diff --git a/update_config_directory.sh b/update_config_directory.sh index 2c74060..6560703 100755 --- a/update_config_directory.sh +++ b/update_config_directory.sh @@ -27,9 +27,10 @@ copy_package_file() { } copy_package_file husarion_ugv_controller config -# copy_package_file husarion_ugv_description config/components.yaml copy_package_file husarion_ugv_lights config/user_animations.yaml copy_package_file husarion_ugv_localization config rm /config/husarion_ugv_localization/config/nmea_navsat.yaml || true copy_package_file husarion_ugv_manager behavior_trees/lights.xml copy_package_file husarion_ugv_manager behavior_trees/LightsBT.btproj +copy_package_file panther_description config/components.yaml +copy_package_file lynx_description config/components.yaml From d2ba16de90456314e18cd69c471a5b2e829a3461 Mon Sep 17 00:00:00 2001 From: kmakd Date: Fri, 22 Nov 2024 10:17:25 +0000 Subject: [PATCH 08/17] fix condition --- setup_environment.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup_environment.sh b/setup_environment.sh index 33187db..3a4e091 100755 --- a/setup_environment.sh +++ b/setup_environment.sh @@ -5,7 +5,7 @@ set -e source /run/husarion/robot_config.env # Copy files to /config directory if the directory is empty except for .env and cyclonedds.xml -if [ "! $(ls /config | grep -v '^\.env$' | grep -v '^\cyclonedds.xml$')" ]; then +if [ -z "$(find /config -type f | grep -v '/\.env$' | grep -v '/cyclonedds.xml$')" ]; then echo "Config directory is empty, copying files." update_config_directory fi From 56e749807452928a4eb6a4d7dd20d0f14cfd04dd Mon Sep 17 00:00:00 2001 From: kmakd Date: Fri, 22 Nov 2024 11:04:00 +0000 Subject: [PATCH 09/17] change ownership of copied files --- update_config_directory.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/update_config_directory.sh b/update_config_directory.sh index 6560703..aabd778 100755 --- a/update_config_directory.sh +++ b/update_config_directory.sh @@ -34,3 +34,6 @@ copy_package_file husarion_ugv_manager behavior_trees/lights.xml copy_package_file husarion_ugv_manager behavior_trees/LightsBT.btproj copy_package_file panther_description config/components.yaml copy_package_file lynx_description config/components.yaml + +# Change ownership of the copied files to host user +chown -R 1000:1001 /config From 8c3315b56e9383f894484ad3e58f5d81c73a7819 Mon Sep 17 00:00:00 2001 From: kmakd Date: Fri, 22 Nov 2024 11:04:00 +0000 Subject: [PATCH 10/17] change ownership of copied files --- Dockerfile.hardware | 2 +- update_config_directory.sh | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Dockerfile.hardware b/Dockerfile.hardware index a2be1e1..300d6da 100644 --- a/Dockerfile.hardware +++ b/Dockerfile.hardware @@ -40,5 +40,5 @@ RUN apt-get update && \ COPY update_config_directory.sh /usr/local/sbin/update_config_directory COPY setup_environment.sh /usr/local/sbin/setup_environment -# # Setup envs from eeprom +# Setup envs from eeprom RUN sed -i "/# /i setup_environment" /*_entrypoint.sh diff --git a/update_config_directory.sh b/update_config_directory.sh index 6560703..aabd778 100755 --- a/update_config_directory.sh +++ b/update_config_directory.sh @@ -34,3 +34,6 @@ copy_package_file husarion_ugv_manager behavior_trees/lights.xml copy_package_file husarion_ugv_manager behavior_trees/LightsBT.btproj copy_package_file panther_description config/components.yaml copy_package_file lynx_description config/components.yaml + +# Change ownership of the copied files to host user +chown -R 1000:1001 /config From eb601a2749e1486bfed422de129c3670e3c95ac4 Mon Sep 17 00:00:00 2001 From: kmakd Date: Fri, 22 Nov 2024 12:37:56 +0000 Subject: [PATCH 11/17] fix entrypoint --- Dockerfile.hardware | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile.hardware b/Dockerfile.hardware index 300d6da..3e83abc 100644 --- a/Dockerfile.hardware +++ b/Dockerfile.hardware @@ -41,4 +41,4 @@ COPY update_config_directory.sh /usr/local/sbin/update_config_directory COPY setup_environment.sh /usr/local/sbin/setup_environment # Setup envs from eeprom -RUN sed -i "/# /i setup_environment" /*_entrypoint.sh +RUN sed -i "/# /i source setup_environment" /*_entrypoint.sh From c407be68ac420b61a9237d03d8add35d00370682 Mon Sep 17 00:00:00 2001 From: kmakd Date: Mon, 25 Nov 2024 14:32:30 +0000 Subject: [PATCH 12/17] fix entrypoint --- Dockerfile.hardware | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile.hardware b/Dockerfile.hardware index 3e83abc..0ef0d06 100644 --- a/Dockerfile.hardware +++ b/Dockerfile.hardware @@ -41,4 +41,4 @@ COPY update_config_directory.sh /usr/local/sbin/update_config_directory COPY setup_environment.sh /usr/local/sbin/setup_environment # Setup envs from eeprom -RUN sed -i "/# /i source setup_environment" /*_entrypoint.sh +RUN sed -i "/# /i set -e -a && source setup_environment" /*_entrypoint.sh From 4d06557b0db997ab46d4c2458de72879900bf120 Mon Sep 17 00:00:00 2001 From: kmakd Date: Mon, 25 Nov 2024 14:43:53 +0000 Subject: [PATCH 13/17] Update README --- README.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9ba248d..cfc3bac 100644 --- a/README.md +++ b/README.md @@ -32,13 +32,22 @@ cd panther-docker/demo ### 🤖 Robot -1. Activate Panther +1. (Optional) Updating configuration files. + + > [!NOTE] + > This may overwrite your changes made in the `config` directory. If you want to keep your configuration you should skip this step or create backup of the `config` directory. + + ```bash + docker run --rm -v /home/husarion/config:/config husarion/panther:humble- update_config_directory + ``` + +2. Activate Panther ```bash docker compose -f compose.minimal-setup.yaml up ``` -2. Launch Visualization on PC +3. Launch Visualization on PC ```bash xhost local:root From 086e43931b24c9fe689a5ed94263fee151ed1782 Mon Sep 17 00:00:00 2001 From: kmakd Date: Fri, 29 Nov 2024 07:31:49 +0000 Subject: [PATCH 14/17] add comment --- demo/compose.minimal-setup.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demo/compose.minimal-setup.yaml b/demo/compose.minimal-setup.yaml index bfc655c..992c276 100644 --- a/demo/compose.minimal-setup.yaml +++ b/demo/compose.minimal-setup.yaml @@ -3,7 +3,7 @@ x-common-config: &common-config ipc: host restart: always env_file: - - ./config/.env + - ./config/.env # env configuration including namespace, domain id, DDS, etc. services: husarion_ugv_ros: From 8663503a3e74f5964288496e2dc881465620b5af Mon Sep 17 00:00:00 2001 From: kmakd Date: Wed, 4 Dec 2024 14:39:30 +0000 Subject: [PATCH 15/17] make general compose --- demo/compose.minimal-setup.yaml | 6 +++--- demo/joy2twist_lynx.yaml | 31 ------------------------------- setup_environment.sh | 8 ++++---- 3 files changed, 7 insertions(+), 38 deletions(-) delete mode 100644 demo/joy2twist_lynx.yaml diff --git a/demo/compose.minimal-setup.yaml b/demo/compose.minimal-setup.yaml index 67d2b53..30bc4e1 100644 --- a/demo/compose.minimal-setup.yaml +++ b/demo/compose.minimal-setup.yaml @@ -3,7 +3,7 @@ x-common-config: &common-config ipc: host restart: always env_file: - - ./config/.env # env configuration including namespace, domain id, DDS, etc. + - ./config/common/.env # env configuration including namespace, domain id, DDS, etc. services: husarion_ugv_ros: @@ -41,12 +41,12 @@ services: container_name: gamepad_controller <<: *common-config volumes: - - ./joy2twist_lynx.yaml:/joy2twist.yaml + - /config/common/joy2twist.yaml:/joy2twist.yaml devices: - /dev/input/js0 device_cgroup_rules: - 'c 13:0 rmw' # gamepad stop_signal: SIGINT command: > - bash -c "ros2 launch joy2twist gamepad_controller.launch.py joy2twist_params_file:=$(ros2 pkg prefix joy2twist)/share/joy2twist/config/joy2twist_ugv.yaml" + bash -c "ros2 launch joy2twist gamepad_controller.launch.py joy2twist_params_file:=/joy2twist.yaml" diff --git a/demo/joy2twist_lynx.yaml b/demo/joy2twist_lynx.yaml deleted file mode 100644 index aa13504..0000000 --- a/demo/joy2twist_lynx.yaml +++ /dev/null @@ -1,31 +0,0 @@ -/**: - ros__parameters: - linear_velocity_factor: - fast: 1.5 - regular: 0.9 - slow: 0.3 - - angular_velocity_factor: - fast: 1.4 - regular: 0.58 - slow: 0.3 - - e_stop: - present: true - topic: /lynx/hardware/e_stop - reset_srv: /lynx/hardware/e_stop_reset - trigger_srv: /lynx/hardware/e_stop_trigger - - # This button mapping should be adjusted to the specific controller - # The following map is suited for Logitech F710 - button_index_map: - axis: - angular_z: 2 # Right joystick - linear_x: 1 # Left joystick - linear_y: 0 # Left joystick - dead_man_switch: 4 # LB - fast_mode: 7 # RT - slow_mode: 5 # RB - e_stop_reset: 1 # A - e_stop_trigger: 2 # B - enable_e_stop_reset: 6 # LT \ No newline at end of file diff --git a/setup_environment.sh b/setup_environment.sh index 3a4e091..13e3c6a 100755 --- a/setup_environment.sh +++ b/setup_environment.sh @@ -4,8 +4,8 @@ set -e # source robot environment source /run/husarion/robot_config.env -# Copy files to /config directory if the directory is empty except for .env and cyclonedds.xml -if [ -z "$(find /config -type f | grep -v '/\.env$' | grep -v '/cyclonedds.xml$')" ]; then - echo "Config directory is empty, copying files." - update_config_directory +# check if /config directory is empty except it may contain common directory inside +if [ "$(ls -A /config | grep -v common)" ]; then + echo "Config directory is empty, copying files." + update_config_directory fi From a6fcd38bc62c3f4eb3ab2708db880ade2e4b6567 Mon Sep 17 00:00:00 2001 From: kmakd Date: Thu, 5 Dec 2024 13:19:25 +0000 Subject: [PATCH 16/17] fix setup and compose --- demo/compose.minimal-setup.yaml | 4 ++-- setup_environment.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/demo/compose.minimal-setup.yaml b/demo/compose.minimal-setup.yaml index 30bc4e1..4c5d751 100644 --- a/demo/compose.minimal-setup.yaml +++ b/demo/compose.minimal-setup.yaml @@ -3,7 +3,7 @@ x-common-config: &common-config ipc: host restart: always env_file: - - ./config/common/.env # env configuration including namespace, domain id, DDS, etc. + - /home/husarion/config/common/.env # env configuration including namespace, domain id, DDS, etc. services: husarion_ugv_ros: @@ -24,7 +24,7 @@ services: - /run/husarion/robot_config.yaml:/run/husarion/robot_config.yaml - /sys/bus/iio/devices:/sys/bus/iio/devices:ro # Read-only access to IIO devices - ~/.ssh/id_rsa:/root/.ssh/id_rsa - - ./config:/config + - /home/husarion/config:/config # Realtime hardware (https://control.ros.org/master/doc/ros2_control/controller_manager/doc/userdoc.html#determinism) ulimits: rtprio: diff --git a/setup_environment.sh b/setup_environment.sh index 13e3c6a..4a2d6c2 100755 --- a/setup_environment.sh +++ b/setup_environment.sh @@ -5,7 +5,7 @@ set -e source /run/husarion/robot_config.env # check if /config directory is empty except it may contain common directory inside -if [ "$(ls -A /config | grep -v common)" ]; then +if [ ! "$(ls -A /config | grep -v common)" ]; then echo "Config directory is empty, copying files." update_config_directory fi From c3702ba9c95c809f522a9532a495601900f35ed6 Mon Sep 17 00:00:00 2001 From: kmakd Date: Thu, 5 Dec 2024 14:43:22 +0000 Subject: [PATCH 17/17] remove bash -c --- demo/compose.minimal-setup.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demo/compose.minimal-setup.yaml b/demo/compose.minimal-setup.yaml index 4c5d751..b63399f 100644 --- a/demo/compose.minimal-setup.yaml +++ b/demo/compose.minimal-setup.yaml @@ -48,5 +48,5 @@ services: - 'c 13:0 rmw' # gamepad stop_signal: SIGINT command: > - bash -c "ros2 launch joy2twist gamepad_controller.launch.py joy2twist_params_file:=/joy2twist.yaml" + ros2 launch joy2twist gamepad_controller.launch.py joy2twist_params_file:=/joy2twist.yaml