Skip to content

Commit

Permalink
chore: cleaned up ROS sourcing & building scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
AugustDG committed Dec 29, 2024
1 parent 0eefe08 commit c22aa8e
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 27 deletions.
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[submodule "ros/newton_ros"]
path = ros/newton_ros
path = ros/pkgs/newton_ros
url = https://github.com/TheNewtonCapstone/newton-ros
[submodule "ros/newton_sim_ros"]
path = ros/newton_sim_ros
path = ros/pkgs/newton_sim_ros
url = https://github.com/TheNewtonCapstone/newton-sim-ros
2 changes: 2 additions & 0 deletions .idea/newton-isaac-sim.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions ros/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# ROS package-specifics
build/
install/
log/
20 changes: 7 additions & 13 deletions ros/build_pkgs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,12 @@ if [ -z "$ROS_DISTRO" ]; then
exit 1
fi

# Go in each package directory (within the "ros" directory) and build it
shopt -s nullglob

for dir in ./*/; do
cd "$dir" || exit

if [ -d "build" ]; then
echo "Cleaning previous build files in $dir ..."
rm -rf "build" "install" "log"
fi
# Clean previous ROS2 packages builds
if [ -d "build" ]; then
echo "Cleaning previous build files..."
rm -rf "build" "install" "log"
fi

echo "Building package in $dir ..."
colcon build --cmake-args -DPython3_EXECUTABLE:INTERNAL="$(which python3)" -DPython3_FIND_STRATEGY=LOCATION -DPython3_FIND_UNVERSIONED_NAMES=FIRST
cd - || exit
done
# Build ROS2 packages
colcon build --symlink-install --cmake-args -DPython3_EXECUTABLE:INTERNAL="$(which python3)" -DPython3_FIND_STRATEGY=LOCATION -DPython3_FIND_UNVERSIONED_NAMES=FIRST
13 changes: 3 additions & 10 deletions ros/source_pkgs.sh
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
#!/bin/bash

# Purpose
# This script is used to build all ROS packages for Newton
# This script is used to source all ROS packages for Newton

# Check if ROS2 is sourced
if [ -z "$ROS_DISTRO" ]; then
echo "ROS2 is not sourced. Please source ROS2."
exit 1
fi

# Go in each package directory (within the "ros" directory) and build it
shopt -s nullglob

for dir in ./*/; do
echo "Sourcing package in $dir ..."
cd "$dir" || exit
source install/setup.bash
cd - || exit
done
# Source ROS2 packages
source install/local_setup.bash

0 comments on commit c22aa8e

Please sign in to comment.