-
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.
Merge pull request #92 from husarion/ros2-lynx-devel
ROS 2 husarion UGV
- Loading branch information
Showing
6 changed files
with
84 additions
and
21 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
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
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
# source robot environment | ||
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 | ||
echo "Config directory is empty, copying files." | ||
update_config_directory | ||
fi |
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,39 @@ | ||
#!/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_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 | ||
|
||
# Change ownership of the copied files to host user | ||
chown -R 1000:1001 /config |