From 8301c7dbdae7bc0d791a2c9877fab2417d1840e7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 25 Sep 2025 20:41:32 +0000 Subject: [PATCH 1/3] Initial plan From dc803f6f8b5f9e430c0b2ce90aa1c9779aa0e055 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 25 Sep 2025 20:46:55 +0000 Subject: [PATCH 2/3] Add rosdep.yaml and setup script for Ubuntu 22.04 Jammy dependencies Co-authored-by: chcorbato <9592617+chcorbato@users.noreply.github.com> --- README.md | 24 ++++++++++++++++++++++++ rosdep.yaml | 36 ++++++++++++++++++++++++++++++++++++ setup_rosdep.sh | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 93 insertions(+) create mode 100644 rosdep.yaml create mode 100755 setup_rosdep.sh diff --git a/README.md b/README.md index 2c82fa2..b7c117b 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,8 @@ This is still a work in progress, therefore the repository is unstable. This package was tested with ROS 2 Humble and TypeDB 2.27.0 +**Note for Ubuntu 22.04 (Jammy) users:** If you're using ROS 2 Rolling on Ubuntu 22.04, please see the special rosdep setup instructions below to resolve missing dependency definitions. + ## Installing [Install ROS 2 Humble](https://docs.ros.org/en/humble/Installation.html) @@ -39,6 +41,10 @@ Install dependencies: ```Bash cd ~/rosa_ws/ source /opt/ros/humble/setup.bash + +# For Ubuntu 22.04 (Jammy) with ROS 2 Rolling, setup custom rosdep dependencies first: +./src/rosa/setup_rosdep.sh + rosdep install --from-paths src --ignore-src -r -y ``` @@ -49,6 +55,24 @@ source /opt/ros/humble/setup.bash colcon build --symlink-install ``` +### Troubleshooting Ubuntu 22.04 (Jammy) with ROS 2 Rolling + +If you encounter rosdep errors about missing definitions for packages like `behaviortree_cpp`, `popf`, `launch_pytest`, `rclcpp_cascade_lifecycle`, or `tf_transformations`, you can manually add the custom rosdep source: + +```Bash +# Create rosdep sources directory +mkdir -p ~/.ros/rosdep/sources.list.d/ + +# Add ROSA custom rosdep definitions +echo "yaml file://$(pwd)/src/rosa/rosdep.yaml" > ~/.ros/rosdep/sources.list.d/50-rosa.list + +# Update rosdep database +rosdep update + +# Now retry the rosdep install +rosdep install --from-paths src --ignore-src -r -y +``` + ## Running Start typedb: diff --git a/rosdep.yaml b/rosdep.yaml new file mode 100644 index 0000000..68cb02d --- /dev/null +++ b/rosdep.yaml @@ -0,0 +1,36 @@ +# Custom rosdep definitions for ROSA dependencies on Ubuntu 22.04 (Jammy) +# This file provides missing rosdep keys for dependencies not available in the standard rosdep database + +behaviortree_cpp: + ubuntu: + jammy: [ros-rolling-behaviortree-cpp] + +rclcpp_cascade_lifecycle: + ubuntu: + jammy: [ros-rolling-rclcpp-cascade-lifecycle] + +launch_pytest: + ubuntu: + jammy: [ros-rolling-launch-pytest] + +tf_transformations: + ubuntu: + jammy: [python3-tf-transformations] + +popf: + ubuntu: + jammy: [ros-rolling-popf] + +# External dependencies from kas-lab organization +# These packages need to be built from source as specified in rosa.repos +ros_pytest: + ubuntu: + jammy: [python3-pytest] + +ros_typedb: + ubuntu: + jammy: [] # Built from source, no system dependency + +ros_typedb_msgs: + ubuntu: + jammy: [] # Built from source, no system dependency \ No newline at end of file diff --git a/setup_rosdep.sh b/setup_rosdep.sh new file mode 100755 index 0000000..81df1a3 --- /dev/null +++ b/setup_rosdep.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +# Setup script for ROSA rosdep dependencies on Ubuntu 22.04 (Jammy) with ROS 2 Rolling +# This script adds the custom rosdep.yaml file to the rosdep sources list + +set -e + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +ROSDEP_FILE="$SCRIPT_DIR/rosdep.yaml" + +echo "Setting up ROSA rosdep dependencies..." + +# Check if rosdep.yaml exists +if [ ! -f "$ROSDEP_FILE" ]; then + echo "Error: rosdep.yaml not found at $ROSDEP_FILE" + exit 1 +fi + +# Create rosdep sources directory if it doesn't exist +mkdir -p ~/.ros/rosdep/sources.list.d/ + +# Add the custom rosdep source +echo "yaml file://$ROSDEP_FILE" > ~/.ros/rosdep/sources.list.d/50-rosa.list + +echo "Added ROSA rosdep source to ~/.ros/rosdep/sources.list.d/50-rosa.list" + +# Update rosdep database +echo "Updating rosdep database..." +rosdep update + +echo "ROSA rosdep setup complete!" +echo "" +echo "You can now run: rosdep install --from-paths src --ignore-src -r -y" \ No newline at end of file From db75581aa9240cc711f3f9d62d2bb3e727552f15 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 25 Sep 2025 20:48:40 +0000 Subject: [PATCH 3/3] Add validation script and improve rosdep setup with better error handling Co-authored-by: chcorbato <9592617+chcorbato@users.noreply.github.com> --- README.md | 5 +++++ rosdep.yaml | 3 +++ setup_rosdep.sh | 32 ++++++++++++++++++++++++++------ validate_rosdep.sh | 42 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 76 insertions(+), 6 deletions(-) create mode 100755 validate_rosdep.sh diff --git a/README.md b/README.md index b7c117b..743eff5 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,9 @@ source /opt/ros/humble/setup.bash # For Ubuntu 22.04 (Jammy) with ROS 2 Rolling, setup custom rosdep dependencies first: ./src/rosa/setup_rosdep.sh +# Optional: Validate that the rosdep setup worked correctly +./src/rosa/validate_rosdep.sh + rosdep install --from-paths src --ignore-src -r -y ``` @@ -73,6 +76,8 @@ rosdep update rosdep install --from-paths src --ignore-src -r -y ``` +**Note:** The `rosdep.yaml` file in this repository provides custom definitions for packages that are not available in the standard rosdep database for Ubuntu 22.04 (Jammy). Some dependencies like `ros_typedb` and `ros_typedb_msgs` are built from source as specified in `rosa.repos`, so they don't require system packages. + ## Running Start typedb: diff --git a/rosdep.yaml b/rosdep.yaml index 68cb02d..3c1332d 100644 --- a/rosdep.yaml +++ b/rosdep.yaml @@ -4,6 +4,8 @@ behaviortree_cpp: ubuntu: jammy: [ros-rolling-behaviortree-cpp] + # Alternative for other distributions if needed + # focal: [ros-foxy-behaviortree-cpp] rclcpp_cascade_lifecycle: ubuntu: @@ -16,6 +18,7 @@ launch_pytest: tf_transformations: ubuntu: jammy: [python3-tf-transformations] + # This package is generally available across Ubuntu versions popf: ubuntu: diff --git a/setup_rosdep.sh b/setup_rosdep.sh index 81df1a3..abeeea9 100755 --- a/setup_rosdep.sh +++ b/setup_rosdep.sh @@ -7,8 +7,9 @@ set -e SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" ROSDEP_FILE="$SCRIPT_DIR/rosdep.yaml" +ROSDEP_SOURCE_FILE="$HOME/.ros/rosdep/sources.list.d/50-rosa.list" -echo "Setting up ROSA rosdep dependencies..." +echo "Setting up ROSA rosdep dependencies for Ubuntu 22.04 (Jammy)..." # Check if rosdep.yaml exists if [ ! -f "$ROSDEP_FILE" ]; then @@ -16,18 +17,37 @@ if [ ! -f "$ROSDEP_FILE" ]; then exit 1 fi +# Check if rosdep is installed +if ! command -v rosdep &> /dev/null; then + echo "Error: rosdep is not installed. Please install it with:" + echo " sudo apt update && sudo apt install python3-rosdep" + exit 1 +fi + # Create rosdep sources directory if it doesn't exist mkdir -p ~/.ros/rosdep/sources.list.d/ # Add the custom rosdep source -echo "yaml file://$ROSDEP_FILE" > ~/.ros/rosdep/sources.list.d/50-rosa.list +echo "yaml file://$ROSDEP_FILE" > "$ROSDEP_SOURCE_FILE" + +echo "✓ Added ROSA rosdep source to $ROSDEP_SOURCE_FILE" -echo "Added ROSA rosdep source to ~/.ros/rosdep/sources.list.d/50-rosa.list" +# Initialize rosdep if not already done (ignore errors if already initialized) +echo "Initializing rosdep (if needed)..." +rosdep init 2>/dev/null || echo "rosdep already initialized" # Update rosdep database echo "Updating rosdep database..." -rosdep update +if rosdep update; then + echo "✓ rosdep database updated successfully" +else + echo "⚠ Warning: rosdep update encountered issues, but continuing..." +fi -echo "ROSA rosdep setup complete!" echo "" -echo "You can now run: rosdep install --from-paths src --ignore-src -r -y" \ No newline at end of file +echo "🎉 ROSA rosdep setup complete!" +echo "" +echo "You can now run:" +echo " rosdep install --from-paths src --ignore-src -r -y" +echo "" +echo "If you encounter any issues, check the troubleshooting section in README.md" \ No newline at end of file diff --git a/validate_rosdep.sh b/validate_rosdep.sh new file mode 100755 index 0000000..c3bd7f8 --- /dev/null +++ b/validate_rosdep.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +# Validation script to check if ROSA rosdep dependencies are properly configured +# This helps users verify that the rosdep setup worked correctly + +echo "Validating ROSA rosdep configuration..." + +# Check if rosdep sources file exists +ROSDEP_SOURCE_FILE="$HOME/.ros/rosdep/sources.list.d/50-rosa.list" +if [ ! -f "$ROSDEP_SOURCE_FILE" ]; then + echo "✗ ROSA rosdep source file not found at $ROSDEP_SOURCE_FILE" + echo " Please run ./setup_rosdep.sh first" + exit 1 +fi + +echo "✓ ROSA rosdep source file found" + +# Test key dependencies to see if rosdep can resolve them +TEST_DEPS=("behaviortree_cpp" "popf" "launch_pytest" "rclcpp_cascade_lifecycle" "tf_transformations") +FAILED_DEPS=() + +echo "Testing dependency resolution..." + +for dep in "${TEST_DEPS[@]}"; do + if rosdep resolve "$dep" >/dev/null 2>&1; then + echo " ✓ $dep - resolved" + else + echo " ✗ $dep - failed to resolve" + FAILED_DEPS+=("$dep") + fi +done + +if [ ${#FAILED_DEPS[@]} -eq 0 ]; then + echo "" + echo "🎉 All ROSA dependencies are properly configured!" + echo "You can now run: rosdep install --from-paths src --ignore-src -r -y" +else + echo "" + echo "⚠ Some dependencies failed to resolve: ${FAILED_DEPS[*]}" + echo "This might be normal if you're not on Ubuntu 22.04 (Jammy) with ROS 2 Rolling" + echo "Try running: rosdep update" +fi \ No newline at end of file