From c22aa8eae1131eabf0e1ab1466d086cb837a2d4a Mon Sep 17 00:00:00 2001 From: Augusto Mota Pinheiro Date: Sun, 29 Dec 2024 11:50:01 -0500 Subject: [PATCH] chore: cleaned up ROS sourcing & building scripts --- .gitmodules | 4 ++-- .idea/newton-isaac-sim.iml | 2 ++ .idea/vcs.xml | 4 ++-- ros/.gitignore | 4 ++++ ros/build_pkgs.sh | 20 +++++++------------- ros/{ => pkgs}/newton_ros | 0 ros/{ => pkgs}/newton_sim_ros | 0 ros/source_pkgs.sh | 13 +++---------- 8 files changed, 20 insertions(+), 27 deletions(-) create mode 100644 ros/.gitignore rename ros/{ => pkgs}/newton_ros (100%) rename ros/{ => pkgs}/newton_sim_ros (100%) diff --git a/.gitmodules b/.gitmodules index a706e75..418179e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -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 diff --git a/.idea/newton-isaac-sim.iml b/.idea/newton-isaac-sim.iml index 46a8135..4e5a1cf 100644 --- a/.idea/newton-isaac-sim.iml +++ b/.idea/newton-isaac-sim.iml @@ -347,6 +347,8 @@ + + diff --git a/.idea/vcs.xml b/.idea/vcs.xml index a5490c7..822b89f 100644 --- a/.idea/vcs.xml +++ b/.idea/vcs.xml @@ -2,7 +2,7 @@ - - + + \ No newline at end of file diff --git a/ros/.gitignore b/ros/.gitignore new file mode 100644 index 0000000..6bfdea6 --- /dev/null +++ b/ros/.gitignore @@ -0,0 +1,4 @@ +# ROS package-specifics +build/ +install/ +log/ \ No newline at end of file diff --git a/ros/build_pkgs.sh b/ros/build_pkgs.sh index 9c415de..c35bbcd 100644 --- a/ros/build_pkgs.sh +++ b/ros/build_pkgs.sh @@ -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 \ No newline at end of file +# Build ROS2 packages +colcon build --symlink-install --cmake-args -DPython3_EXECUTABLE:INTERNAL="$(which python3)" -DPython3_FIND_STRATEGY=LOCATION -DPython3_FIND_UNVERSIONED_NAMES=FIRST diff --git a/ros/newton_ros b/ros/pkgs/newton_ros similarity index 100% rename from ros/newton_ros rename to ros/pkgs/newton_ros diff --git a/ros/newton_sim_ros b/ros/pkgs/newton_sim_ros similarity index 100% rename from ros/newton_sim_ros rename to ros/pkgs/newton_sim_ros diff --git a/ros/source_pkgs.sh b/ros/source_pkgs.sh index f2b2811..fc099e0 100644 --- a/ros/source_pkgs.sh +++ b/ros/source_pkgs.sh @@ -1,7 +1,7 @@ #!/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 @@ -9,12 +9,5 @@ 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 - echo "Sourcing package in $dir ..." - cd "$dir" || exit - source install/setup.bash - cd - || exit -done \ No newline at end of file +# Source ROS2 packages +source install/local_setup.bash \ No newline at end of file