Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .claude/settings.local.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"permissions": {
"allow": [
"Bash(source:*)",
"Bash(xacro:*)",
"Bash(ros2 pkg:*)",
"Bash(sudo apt install:*)",
"Bash(dpkg:*)",
"Bash(apt list:*)",
"Bash(colcon build:*)",
"Bash(sudo docker ps:*)",
"Bash(grep:*)",
"Bash(ros2 topic echo:*)",
"Bash(ros2 node info:*)",
"Bash(ros2 service call:*)",
"Bash(ros2 node list:*)",
"Bash(ros2 topic list:*)"
]
}
}
72 changes: 72 additions & 0 deletions COMMUNICATION_ARCHITECTURE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# MoveGroupInterface ↔ move_group Node Communication

## Overview
`MoveGroupInterface` (C++ class) communicates with the `move_group` node (ROS2 node) using **Action clients**.

## Communication Flow

```
GUI (arpa_gui)
↓
Services: /plan_to_pose, /execute_plan
↓
motion_control_node
↓
MoveGroupInterface::plan() [C++ class]
↓
Action Client: /move_group/plan [action]
↓
move_group node [ROS2 node]
↓
OMPL Planner → IK Solver → Planning Scene
↓
Action Server Response
↓
MoveGroupInterface returns result
```

## How MoveGroupInterface Works

1. **Action Clients** (internal to MoveGroupInterface):
- `/move_group/plan` - Action for planning
- `/move_group/execute` - Action for execution
- `/move_group/move` - Action for planning + execution

2. **Topics** (monitored by MoveGroupInterface):
- `/joint_states` - Current robot state
- `/planning_scene` - Current planning scene
- `/monitored_planning_scene` - Monitored scene updates

3. **Services** (used by MoveGroupInterface):
- `/get_planning_scene` - Get current planning scene
- `/check_state_validity` - Validate robot states
- `/compute_ik` - IK solving (if needed)

## Key Code Location
- `MoveGroupInterface::plan()` creates an action client to `/move_group/plan`
- The action client sends a `MoveGroupInterface::Plan` request
- `move_group` node processes the request and returns a trajectory

## To Debug Planning Issues, We Need:

1. **IK Solver Test**: Can the IK solver solve the target pose?
- Use `/compute_ik` service directly
- Or check MoveIt logs for IK failures

2. **Current Robot State**: What are current joint values?
- Check `/joint_states` topic
- Use `ros2 topic echo /joint_states`

3. **Target Pose Validation**: Is the target pose reachable?
- Compare with workspace limits
- Check joint limits

4. **Planning Scene**: Are there collisions?
- Use `/get_planning_scene` service
- Check for self-collisions or environment collisions

5. **Compare with RViz**: What's different?
- RViz uses same `move_group` node, so configuration should match
- Check if RViz uses different tolerances or constraints


18 changes: 16 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,14 @@ RUN apt update && apt install -y \
ros-humble-gazebo-msgs \
ros-humble-ros2-control \
ros-humble-ros2-controllers \
ros-humble-moveit-configs-utils \
ros-humble-topic-tools \
gazebo \
python3-colcon-common-extensions \
git build-essential cmake
python3-pip \
git build-essential cmake \
libqt5core5a libqt5gui5 libqt5widgets5 qtbase5-dev \
x11-apps xvfb

# -------------------------------
# 2. Install BehaviorTree.CPP v4
Expand All @@ -49,9 +54,18 @@ RUN source /opt/ros/humble/setup.bash && \
WORKDIR /root/ros2_ws
RUN mkdir -p src

COPY src/arpa_behavior_trees/ src/arpa_behavior_trees/
# Copy all ARPA packages
COPY src/arpa_bringup/ src/arpa_bringup/
COPY src/arpa_description/ src/arpa_description/
COPY src/arpa_moveit_config/ src/arpa_moveit_config/
COPY src/arpa_gui/ src/arpa_gui/
COPY src/arpa_ethernet_motor/ src/arpa_ethernet_motor/
COPY src/custom_ros_messages/ src/custom_ros_messages/
COPY src/ur_manipulation/ src/ur_manipulation/
COPY src/ur16e_rest/ src/ur16e_rest/
COPY src/cl_realsense/ src/cl_realsense/
# Copy Universal Robots packages
COPY src/Universal_Robots_ROS2_Description/ src/Universal_Robots_ROS2_Description/
COPY src/Universal_Robots_ROS2_Driver/ src/Universal_Robots_ROS2_Driver/
COPY src/Universal_Robots_ROS2_Gazebo_Simulation/ src/Universal_Robots_ROS2_Gazebo_Simulation/

Expand Down
139 changes: 139 additions & 0 deletions Gazebo fi.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
# Summary of All Changes to Get ARPA Simulation Working

Complete summary of changes made from the initial state to get the Gazebo simulation working.

---

## 1. Docker Configuration (`docker-compose.yaml`)

**Change:** Commented out NVIDIA GPU runtime (made optional for systems without NVIDIA GPUs)

- **Lines 20-23:** Commented out `runtime: nvidia` and NVIDIA environment variables
- **Reason:** Make Docker compatible with systems that don't have NVIDIA Docker runtime installed

---

## 2. Build Fix (`src/ur_manipulation/CMakeLists.txt`)

**Change:** Removed non-existent `launch` directory from install command

- **Before:** `install(DIRECTORY launch include ...)`
- **After:** `install(DIRECTORY include ...)` (line 53)
- **Reason:** Build was failing because `launch` directory doesn't exist in `ur_manipulation` package

---

## 3. URDF File Location (`src/arpa_description/urdf/`)

**Created:** Copied `arpa_system.urdf.xacro` from `arpa_moveit_config/urdf/` to `arpa_description/urdf/`

- **Reason:** Launch files expected the URDF file in `arpa_description` package, not `arpa_moveit_config`
- **Result:** Launch files can now find the robot description file

---

## 4. URDF Simulation Support (`src/arpa_moveit_config/urdf/arpa_system.urdf.xacro`)

**Added:** Simulation arguments and Gazebo plugin

- **Line 9:** Added `sim_gazebo` argument: `<xacro:arg name="sim_gazebo" default="false"/>`
- **Line 51:** Added `simulation_controllers` argument: `<xacro:arg name="simulation_controllers" default="" />`
- **Line 86:** Changed to pass `sim_gazebo` to macro: `sim_gazebo="$(arg sim_gazebo)"`
- **Lines 90-97:** Added Gazebo ros2_control plugin:
```xml
<!-- Gazebo plugins for simulation -->
<xacro:if value="$(arg sim_gazebo)">
<gazebo>
<plugin filename="libgazebo_ros2_control.so" name="gazebo_ros2_control">
<parameters>$(arg simulation_controllers)</parameters>
</plugin>
</gazebo>
</xacro:if>
```
- **Reason:** Enable Gazebo simulation mode and connect ros2_control to Gazebo

---

## 5. Launch File Updates (`src/arpa_bringup/launch/arpa_sim.launch.py`)

**Added:** Simulation parameters to xacro command

- **Line 77:** Added `sim_gazebo:=true` parameter
- **Lines 76-78:** Added `simulation_controllers` parameter pointing to controller config file
- **Reason:** Enable Gazebo simulation mode when launching

---

## 6. MoveIt Configuration (`src/arpa_moveit_config/launch/arpa_move_group.launch.py`)

**Changed:** Multiple fixes to configuration file paths and SRDF loading

- **Lines 72-83:** Changed config file paths from `arpa_description/config/ur16e/` to `ur_description/config/ur16e/`
- `joint_limit_params` → `ur_description/config/ur16e/joint_limits.yaml`
- `kinematics_params` → `ur_description/config/ur16e/default_kinematics.yaml`
- `physical_params` → `ur_description/config/ur16e/physical_parameters.yaml`
- `visual_params` → `ur_description/config/ur16e/visual_parameters.yaml`

- **Lines 137-146:** Fixed SRDF file loading:
- Switched from `xacro` command to `cat` command (since `arpa_system.srdf` is plain SRDF, not xacro)
- Wrapped output in `ParameterValue(..., value_type=str)` to ensure proper string parsing
- Changed path from `srdf/ur.srdf.xacro` to `config/arpa_system.srdf`

- **Line 366:** Changed default value from `ur.srdf.xacro` to `arpa_system.srdf`

- **Reason:** Correct file paths and fix parameter parsing issues

---

## 7. Controller Configuration (`src/arpa_moveit_config/config/ros2_controllers.yaml`)

**Created/Updated:** Complete ros2_control configuration file

- **Added:** `joint_trajectory_controller` configuration
- **Added:** `joint_state_broadcaster` configuration
- **Includes:**
- Controller manager settings (update_rate: 100 Hz)
- Joint definitions for all 6 UR16e joints
- Command interfaces (position)
- State interfaces (position, velocity)
- Publish rates and constraints

- **Reason:** Provide controller configuration for Gazebo simulation via ros2_control

---

## 8. Documentation Files Created

The following documentation files were created to help users:

- **`DOCKER_SETUP_GUIDE.md`** - Comprehensive Docker setup instructions
- **`INSTALL_DOCKER.md`** - Docker installation guide
- **`QUICKSTART.md`** - Quick start guide for simulation
- **`START_HERE.md`** - Overview document
- **`FIX_DOCKER_PERMISSIONS.md`** - Guide for fixing Docker permissions
- **`BUILD_FIXED.md`** - Documentation of build error fixes
- **`FIX_URDF.md`** - Documentation of URDF file location fix
- **`HOW_DOCKER_WORKS.md`** - Explanation of Docker isolation

---

## Current Status

✅ **Working:**
- Gazebo Classic launches successfully
- Robot spawns in Gazebo
- ros2_control plugin loads correctly
- MoveIt2 initializes successfully
- Controllers are configured properly

⚠️ **Minor Issues (Non-Blocking):**
- Some controller manager warnings about state transitions (system still works)
- MoveIt kinematics warnings (doesn't prevent planning)

---

## Result

The simulation is now **fully functional** - the robot spawns in Gazebo and is ready for motion planning with MoveIt2!


Loading