diff --git a/README.md b/README.md index 2c82fa2..743eff5 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,13 @@ 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 + +# Optional: Validate that the rosdep setup worked correctly +./src/rosa/validate_rosdep.sh + rosdep install --from-paths src --ignore-src -r -y ``` @@ -49,6 +58,26 @@ 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 +``` + +**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 new file mode 100644 index 0000000..3c1332d --- /dev/null +++ b/rosdep.yaml @@ -0,0 +1,39 @@ +# 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] + # Alternative for other distributions if needed + # focal: [ros-foxy-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] + # This package is generally available across Ubuntu versions + +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..abeeea9 --- /dev/null +++ b/setup_rosdep.sh @@ -0,0 +1,53 @@ +#!/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" +ROSDEP_SOURCE_FILE="$HOME/.ros/rosdep/sources.list.d/50-rosa.list" + +echo "Setting up ROSA rosdep dependencies for Ubuntu 22.04 (Jammy)..." + +# Check if rosdep.yaml exists +if [ ! -f "$ROSDEP_FILE" ]; then + echo "Error: rosdep.yaml not found at $ROSDEP_FILE" + 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" > "$ROSDEP_SOURCE_FILE" + +echo "✓ Added ROSA rosdep source to $ROSDEP_SOURCE_FILE" + +# 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..." +if rosdep update; then + echo "✓ rosdep database updated successfully" +else + echo "⚠ Warning: rosdep update encountered issues, but continuing..." +fi + +echo "" +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