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