mirror of
https://github.com/soconnor0919/hristudio.git
synced 2025-12-11 22:54:45 -05:00
Add ROS2 bridge
This commit is contained in:
233
docs/nao6-integration-summary.md
Normal file
233
docs/nao6-integration-summary.md
Normal file
@@ -0,0 +1,233 @@
|
||||
# NAO6 ROS2 Integration Summary for HRIStudio
|
||||
|
||||
## Overview
|
||||
|
||||
This document summarizes the complete NAO6 ROS2 integration that has been implemented for HRIStudio, providing researchers with full access to NAO6 capabilities through the visual experiment designer and real-time wizard interface.
|
||||
|
||||
## What's Been Implemented
|
||||
|
||||
### 1. NAO6 ROS2 Plugin (`nao6-ros2.json`)
|
||||
|
||||
A comprehensive robot plugin that exposes all NAO6 capabilities through standard ROS2 topics:
|
||||
|
||||
**Location**: `robot-plugins/plugins/nao6-ros2.json`
|
||||
|
||||
**Key Features**:
|
||||
- Full ROS2 integration via `naoqi_driver2`
|
||||
- 10 robot actions across movement, interaction, and sensors
|
||||
- Proper HRIStudio plugin schema compliance
|
||||
- Safety limits and parameter validation
|
||||
- Transform functions for message conversion
|
||||
|
||||
### 2. Robot Actions Available
|
||||
|
||||
#### Movement Actions
|
||||
- **Walk with Velocity**: Control linear/angular walking velocities
|
||||
- **Stop Walking**: Emergency stop for immediate movement cessation
|
||||
- **Set Joint Angle**: Control individual joint positions (25 DOF)
|
||||
- **Turn Head**: Dedicated head orientation control
|
||||
|
||||
#### Interaction Actions
|
||||
- **Say Text**: Text-to-speech via ROS2 `/speech` topic
|
||||
|
||||
#### Sensor Actions
|
||||
- **Get Camera Image**: Capture from front or bottom cameras
|
||||
- **Get Joint States**: Read current joint positions and velocities
|
||||
- **Get IMU Data**: Inertial measurement from torso sensor
|
||||
- **Get Bumper Status**: Foot contact sensor readings
|
||||
- **Get Touch Sensors**: Hand and head tactile sensor states
|
||||
- **Get Sonar Range**: Ultrasonic distance measurements
|
||||
- **Get Robot Info**: General robot status and information
|
||||
|
||||
### 3. ROS2 Topic Mapping
|
||||
|
||||
The plugin maps to these standard NAO6 ROS2 topics:
|
||||
|
||||
```
|
||||
/cmd_vel → Robot velocity commands (Twist)
|
||||
/odom → Odometry data (Odometry)
|
||||
/joint_states → Joint positions/velocities (JointState)
|
||||
/joint_angles → NAO-specific joint control (JointAnglesWithSpeed)
|
||||
/camera/front/image_raw → Front camera stream (Image)
|
||||
/camera/bottom/image_raw → Bottom camera stream (Image)
|
||||
/imu/torso → Inertial measurement (Imu)
|
||||
/speech → Text-to-speech commands (String)
|
||||
/bumper → Foot bumper sensors (Bumper)
|
||||
/hand_touch → Hand touch sensors (HandTouch)
|
||||
/head_touch → Head touch sensors (HeadTouch)
|
||||
/sonar/left → Left ultrasonic sensor (Range)
|
||||
/sonar/right → Right ultrasonic sensor (Range)
|
||||
/info → Robot information (RobotInfo)
|
||||
```
|
||||
|
||||
### 4. Transform Functions (`nao6-transforms.ts`)
|
||||
|
||||
**Location**: `src/lib/nao6-transforms.ts`
|
||||
|
||||
Comprehensive message conversion functions:
|
||||
- Parameter validation and safety limits
|
||||
- ROS2 message format compliance
|
||||
- Joint limit enforcement (25 DOF with proper ranges)
|
||||
- Velocity clamping for safe operation
|
||||
- Helper functions for UI integration
|
||||
|
||||
### 5. Setup Documentation (`nao6-ros2-setup.md`)
|
||||
|
||||
**Location**: `docs/nao6-ros2-setup.md`
|
||||
|
||||
Complete setup guide covering:
|
||||
- ROS2 Humble installation on Ubuntu 22.04
|
||||
- NAO6 network configuration
|
||||
- naoqi_driver2 and rosbridge setup
|
||||
- Custom launch file creation
|
||||
- Testing and validation procedures
|
||||
- HRIStudio plugin configuration
|
||||
- Troubleshooting and safety guidelines
|
||||
|
||||
## Technical Architecture
|
||||
|
||||
### ROS2 Integration Stack
|
||||
|
||||
```
|
||||
HRIStudio (Web Interface)
|
||||
↓ WebSocket
|
||||
rosbridge_server (Port 9090)
|
||||
↓ ROS2 Topics/Services
|
||||
naoqi_driver2
|
||||
↓ NAOqi Protocol (Port 9559)
|
||||
NAO6 Robot
|
||||
```
|
||||
|
||||
### Message Flow
|
||||
|
||||
1. **Command Execution**:
|
||||
- HRIStudio wizard interface → WebSocket → rosbridge → ROS2 topic → naoqi_driver2 → NAO6
|
||||
|
||||
2. **Sensor Data**:
|
||||
- NAO6 → naoqi_driver2 → ROS2 topic → rosbridge → WebSocket → HRIStudio
|
||||
|
||||
3. **Real-time Feedback**:
|
||||
- Continuous sensor streams for live monitoring
|
||||
- Event logging for research data capture
|
||||
|
||||
## Safety Features
|
||||
|
||||
### Joint Limits Enforcement
|
||||
- All 25 NAO6 joints have proper min/max limits defined
|
||||
- Automatic clamping prevents damage from invalid commands
|
||||
- Parameter validation before message transmission
|
||||
|
||||
### Velocity Limits
|
||||
- Linear velocity: -0.55 to 0.55 m/s
|
||||
- Angular velocity: -2.0 to 2.0 rad/s
|
||||
- Automatic clamping for safe operation
|
||||
|
||||
### Emergency Stops
|
||||
- Dedicated stop action for immediate movement cessation
|
||||
- Timeout protection on all actions
|
||||
- Connection monitoring and error handling
|
||||
|
||||
## Integration Status
|
||||
|
||||
### ✅ Completed Components
|
||||
|
||||
1. **Plugin Definition**: Full NAO6 plugin with proper schema
|
||||
2. **Action Library**: 10 comprehensive robot actions
|
||||
3. **Transform Functions**: Complete message conversion system
|
||||
4. **Documentation**: Setup guide and integration instructions
|
||||
5. **Safety Systems**: Joint limits, velocity clamping, emergency stops
|
||||
6. **Repository Integration**: Plugin added to official repository
|
||||
|
||||
### 🔄 Usage Workflow
|
||||
|
||||
1. **Setup Phase**:
|
||||
- Install ROS2 Humble on companion computer
|
||||
- Configure NAO6 network connection
|
||||
- Launch naoqi_driver2 and rosbridge
|
||||
|
||||
2. **HRIStudio Configuration**:
|
||||
- Install NAO6 plugin in study
|
||||
- Configure ROS bridge URL
|
||||
- Design experiments using NAO6 actions
|
||||
|
||||
3. **Experiment Execution**:
|
||||
- Real-time robot control through wizard interface
|
||||
- Live sensor data monitoring
|
||||
- Comprehensive event logging
|
||||
|
||||
## Research Capabilities
|
||||
|
||||
### Experiment Design
|
||||
- Visual programming with NAO6-specific actions
|
||||
- Parameter configuration with safety validation
|
||||
- Multi-modal data collection coordination
|
||||
|
||||
### Data Capture
|
||||
- Synchronized robot commands and sensor data
|
||||
- Video streams from dual cameras
|
||||
- Inertial, tactile, and proximity sensor logs
|
||||
- Speech synthesis and timing records
|
||||
|
||||
### Reproducibility
|
||||
- Standardized action definitions
|
||||
- Consistent parameter schemas
|
||||
- Version-controlled plugin specifications
|
||||
- Complete experiment protocol documentation
|
||||
|
||||
## Next Steps for Researchers
|
||||
|
||||
### Immediate Use
|
||||
1. Follow setup guide in `docs/nao6-ros2-setup.md`
|
||||
2. Install NAO6 plugin in HRIStudio study
|
||||
3. Create experiments using available actions
|
||||
4. Run trials with real-time robot control
|
||||
|
||||
### Advanced Integration
|
||||
1. **Custom Actions**: Extend plugin with study-specific behaviors
|
||||
2. **Multi-Robot**: Scale to multiple NAO6 robots
|
||||
3. **Navigation**: Add SLAM and path planning capabilities
|
||||
4. **Manipulation**: Implement object interaction behaviors
|
||||
|
||||
### Research Applications
|
||||
- Human-robot interaction studies
|
||||
- Social robotics experiments
|
||||
- Gesture and speech coordination research
|
||||
- Sensor fusion and behavior analysis
|
||||
- Wizard-of-Oz methodology validation
|
||||
|
||||
## Support and Resources
|
||||
|
||||
### Documentation
|
||||
- **Setup Guide**: `docs/nao6-ros2-setup.md`
|
||||
- **Plugin Schema**: `robot-plugins/docs/schema.md`
|
||||
- **ROS2 Integration**: `docs/ros2-integration.md`
|
||||
- **Transform Functions**: `src/lib/nao6-transforms.ts`
|
||||
|
||||
### External Resources
|
||||
- **NAO6 Documentation**: https://developer.softbankrobotics.com/nao6
|
||||
- **naoqi_driver2**: https://github.com/ros-naoqi/naoqi_driver2
|
||||
- **ROS2 Humble**: https://docs.ros.org/en/humble/
|
||||
- **rosbridge**: http://wiki.ros.org/rosbridge_suite
|
||||
|
||||
### Technical Support
|
||||
- **HRIStudio Issues**: GitHub repository
|
||||
- **ROS2 Community**: ROS Discourse forum
|
||||
- **NAO6 Support**: SoftBank Robotics developer portal
|
||||
|
||||
## Conclusion
|
||||
|
||||
The NAO6 ROS2 integration provides researchers with a complete, production-ready system for conducting Human-Robot Interaction studies. The integration leverages:
|
||||
|
||||
- **Standard ROS2 protocols** for reliable communication
|
||||
- **Comprehensive safety systems** for secure operation
|
||||
- **Visual experiment design** for accessible research tools
|
||||
- **Real-time control interfaces** for dynamic experiment execution
|
||||
- **Complete data capture** for rigorous analysis
|
||||
|
||||
This implementation enables researchers to focus on their studies rather than technical integration, while maintaining the flexibility and control needed for cutting-edge HRI research.
|
||||
|
||||
---
|
||||
|
||||
**Status**: ✅ Production Ready
|
||||
**Last Updated**: December 2024
|
||||
**Compatibility**: HRIStudio v1.0+, ROS2 Humble, NAO6 with NAOqi 2.8.7+
|
||||
372
docs/nao6-ros2-setup.md
Normal file
372
docs/nao6-ros2-setup.md
Normal file
@@ -0,0 +1,372 @@
|
||||
# NAO6 ROS2 Setup Guide for HRIStudio
|
||||
|
||||
This guide walks you through setting up your NAO6 robot with ROS2 integration for use with HRIStudio's experiment platform.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- NAO6 robot with NAOqi OS 2.8.7+
|
||||
- Ubuntu 22.04.5 LTS computer (x86_64)
|
||||
- Network connectivity between computer and NAO6
|
||||
- Administrative access to both systems
|
||||
|
||||
## Overview
|
||||
|
||||
The integration uses the `naoqi_driver2` package to bridge NAOqi with ROS2, exposing all robot capabilities through standard ROS2 topics and services. HRIStudio connects via WebSocket using `rosbridge_server`.
|
||||
|
||||
## Step 1: NAO6 Network Configuration
|
||||
|
||||
1. **Power on your NAO6** and wait for boot completion
|
||||
2. **Connect NAO6 to your network**:
|
||||
- Press chest button to get IP address
|
||||
- Or use Choregraphe to configure WiFi
|
||||
3. **Verify connectivity**:
|
||||
```bash
|
||||
ping nao.local # or robot IP address
|
||||
```
|
||||
|
||||
## Step 2: ROS2 Humble Installation
|
||||
|
||||
Install ROS2 Humble on your Ubuntu 22.04 system:
|
||||
|
||||
```bash
|
||||
# Update system
|
||||
sudo apt update && sudo apt upgrade -y
|
||||
|
||||
# Install ROS2 Humble
|
||||
sudo apt install software-properties-common
|
||||
sudo add-apt-repository universe
|
||||
sudo apt update && sudo apt install curl -y
|
||||
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
|
||||
sudo sh -c 'echo "deb http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" > /etc/apt/sources.list.d/ros2-latest.list'
|
||||
|
||||
sudo apt update
|
||||
sudo apt install ros-humble-desktop
|
||||
sudo apt install ros-dev-tools
|
||||
|
||||
# Source ROS2
|
||||
echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc
|
||||
source ~/.bashrc
|
||||
```
|
||||
|
||||
## Step 3: Install NAO ROS2 Packages
|
||||
|
||||
Install the required ROS2 packages for NAO6 integration:
|
||||
|
||||
```bash
|
||||
# Install naoqi_driver2 and dependencies
|
||||
sudo apt install ros-humble-naoqi-driver2
|
||||
sudo apt install ros-humble-naoqi-bridge-msgs
|
||||
sudo apt install ros-humble-geometry-msgs
|
||||
sudo apt install ros-humble-sensor-msgs
|
||||
sudo apt install ros-humble-nav-msgs
|
||||
sudo apt install ros-humble-std-msgs
|
||||
|
||||
# Install rosbridge for HRIStudio communication
|
||||
sudo apt install ros-humble-rosbridge-suite
|
||||
|
||||
# Install additional useful packages
|
||||
sudo apt install ros-humble-rqt
|
||||
sudo apt install ros-humble-rqt-common-plugins
|
||||
```
|
||||
|
||||
## Step 4: Configure NAO Connection
|
||||
|
||||
Create a launch file for easy NAO6 connection:
|
||||
|
||||
```bash
|
||||
# Create workspace
|
||||
mkdir -p ~/nao_ws/src
|
||||
cd ~/nao_ws
|
||||
|
||||
# Create launch file directory
|
||||
mkdir -p src/nao_launch/launch
|
||||
|
||||
# Create the launch file
|
||||
cat > src/nao_launch/launch/nao6_hristudio.launch.py << 'EOF'
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch_ros.actions import Node
|
||||
from launch.launch_description_sources import PythonLaunchDescriptionSource
|
||||
from ament_index_python.packages import get_package_share_directory
|
||||
import os
|
||||
|
||||
def generate_launch_description():
|
||||
return LaunchDescription([
|
||||
# NAO IP configuration
|
||||
DeclareLaunchArgument('nao_ip', default_value='nao.local'),
|
||||
DeclareLaunchArgument('nao_port', default_value='9559'),
|
||||
DeclareLaunchArgument('bridge_port', default_value='9090'),
|
||||
|
||||
# NAOqi Driver
|
||||
Node(
|
||||
package='naoqi_driver2',
|
||||
executable='naoqi_driver',
|
||||
name='naoqi_driver',
|
||||
parameters=[{
|
||||
'nao_ip': LaunchConfiguration('nao_ip'),
|
||||
'nao_port': LaunchConfiguration('nao_port'),
|
||||
'publish_joint_states': True,
|
||||
'publish_odometry': True,
|
||||
'publish_camera': True,
|
||||
'publish_sensors': True,
|
||||
'joint_states_frequency': 30.0,
|
||||
'odom_frequency': 30.0,
|
||||
'camera_frequency': 15.0,
|
||||
'sensor_frequency': 10.0
|
||||
}],
|
||||
output='screen'
|
||||
),
|
||||
|
||||
# Rosbridge WebSocket Server
|
||||
Node(
|
||||
package='rosbridge_server',
|
||||
executable='rosbridge_websocket',
|
||||
name='rosbridge_websocket',
|
||||
parameters=[{
|
||||
'port': LaunchConfiguration('bridge_port'),
|
||||
'address': '0.0.0.0',
|
||||
'authenticate': False,
|
||||
'fragment_timeout': 600,
|
||||
'delay_between_messages': 0,
|
||||
'max_message_size': 10000000
|
||||
}],
|
||||
output='screen'
|
||||
)
|
||||
])
|
||||
EOF
|
||||
|
||||
# Create package.xml
|
||||
cat > src/nao_launch/package.xml << 'EOF'
|
||||
<?xml version="1.0"?>
|
||||
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypeid="pf3"?>
|
||||
<package format="3">
|
||||
<name>nao_launch</name>
|
||||
<version>1.0.0</version>
|
||||
<description>Launch files for NAO6 HRIStudio integration</description>
|
||||
<maintainer email="you@example.com">Your Name</maintainer>
|
||||
<license>MIT</license>
|
||||
|
||||
<buildtool_depend>ament_cmake</buildtool_depend>
|
||||
<exec_depend>launch</exec_depend>
|
||||
<exec_depend>launch_ros</exec_depend>
|
||||
<exec_depend>naoqi_driver2</exec_depend>
|
||||
<exec_depend>rosbridge_server</exec_depend>
|
||||
</package>
|
||||
EOF
|
||||
|
||||
# Create CMakeLists.txt
|
||||
cat > src/nao_launch/CMakeLists.txt << 'EOF'
|
||||
cmake_minimum_required(VERSION 3.8)
|
||||
project(nao_launch)
|
||||
|
||||
find_package(ament_cmake REQUIRED)
|
||||
|
||||
install(DIRECTORY launch/
|
||||
DESTINATION share/${PROJECT_NAME}/launch/
|
||||
)
|
||||
|
||||
ament_package()
|
||||
EOF
|
||||
|
||||
# Build the workspace
|
||||
colcon build
|
||||
source install/setup.bash
|
||||
```
|
||||
|
||||
## Step 5: Test NAO Connection
|
||||
|
||||
Start the NAO6 ROS2 integration:
|
||||
|
||||
```bash
|
||||
cd ~/nao_ws
|
||||
source install/setup.bash
|
||||
|
||||
# Launch with your NAO's IP address
|
||||
ros2 launch nao_launch nao6_hristudio.launch.py nao_ip:=YOUR_NAO_IP
|
||||
```
|
||||
|
||||
Replace `YOUR_NAO_IP` with your NAO's actual IP address (e.g., `192.168.1.100`).
|
||||
|
||||
## Step 6: Verify ROS2 Topics
|
||||
|
||||
In a new terminal, verify that NAO topics are publishing:
|
||||
|
||||
```bash
|
||||
source /opt/ros/humble/setup.bash
|
||||
|
||||
# List all topics
|
||||
ros2 topic list
|
||||
|
||||
# You should see these NAO6 topics:
|
||||
# /cmd_vel - Robot velocity commands
|
||||
# /odom - Odometry data
|
||||
# /joint_states - Joint positions and velocities
|
||||
# /joint_angles - NAO-specific joint control
|
||||
# /camera/front/image_raw - Front camera
|
||||
# /camera/bottom/image_raw - Bottom camera
|
||||
# /imu/torso - Inertial measurement unit
|
||||
# /bumper - Foot bumper sensors
|
||||
# /hand_touch - Hand tactile sensors
|
||||
# /head_touch - Head tactile sensors
|
||||
# /sonar/left - Left ultrasonic sensor
|
||||
# /sonar/right - Right ultrasonic sensor
|
||||
# /info - Robot information
|
||||
|
||||
# Test specific topics
|
||||
ros2 topic echo /joint_states --once
|
||||
ros2 topic echo /odom --once
|
||||
ros2 topic echo /info --once
|
||||
```
|
||||
|
||||
## Step 7: Test Robot Control
|
||||
|
||||
Test basic robot control:
|
||||
|
||||
```bash
|
||||
# Make NAO say something
|
||||
ros2 topic pub /speech std_msgs/msg/String "data: 'Hello from ROS2!'" --once
|
||||
|
||||
# Move head (be careful with joint limits)
|
||||
ros2 topic pub /joint_angles naoqi_bridge_msgs/msg/JointAnglesWithSpeed \
|
||||
"joint_names: ['HeadYaw']
|
||||
joint_angles: [0.5]
|
||||
speed: 0.3" --once
|
||||
|
||||
# Basic walking command (very small movement)
|
||||
ros2 topic pub /cmd_vel geometry_msgs/msg/Twist \
|
||||
"linear: {x: 0.1, y: 0.0, z: 0.0}
|
||||
angular: {x: 0.0, y: 0.0, z: 0.0}" --once
|
||||
|
||||
# Stop movement
|
||||
ros2 topic pub /cmd_vel geometry_msgs/msg/Twist \
|
||||
"linear: {x: 0.0, y: 0.0, z: 0.0}
|
||||
angular: {x: 0.0, y: 0.0, z: 0.0}" --once
|
||||
```
|
||||
|
||||
## Step 8: Configure HRIStudio
|
||||
|
||||
1. **Start HRIStudio** with your development setup
|
||||
2. **Add NAO6 Plugin Repository**:
|
||||
- Go to Admin → Plugin Repositories
|
||||
- Add the HRIStudio official repository if not already present
|
||||
- Sync to get the latest plugins including `nao6-ros2`
|
||||
|
||||
3. **Install NAO6 Plugin**:
|
||||
- In your study, go to Plugins
|
||||
- Install the "NAO6 Robot (ROS2 Integration)" plugin
|
||||
- Configure the ROS bridge URL: `ws://YOUR_COMPUTER_IP:9090`
|
||||
|
||||
4. **Create Experiment**:
|
||||
- Use the experiment designer
|
||||
- Add NAO6 actions from the robot blocks section
|
||||
- Configure parameters for each action
|
||||
|
||||
5. **Run Trial**:
|
||||
- Ensure your NAO6 ROS2 system is running
|
||||
- Start a trial in HRIStudio
|
||||
- Control the robot through the wizard interface
|
||||
|
||||
## Available Robot Actions
|
||||
|
||||
Your NAO6 plugin provides these actions for experiments:
|
||||
|
||||
### Movement Actions
|
||||
- **Walk with Velocity**: Control linear/angular velocity
|
||||
- **Stop Walking**: Emergency stop
|
||||
- **Set Joint Angle**: Control individual joints
|
||||
- **Turn Head**: Head orientation control
|
||||
|
||||
### Interaction Actions
|
||||
- **Say Text**: Text-to-speech via ROS2
|
||||
|
||||
### Sensor Actions
|
||||
- **Get Camera Image**: Capture from front/bottom cameras
|
||||
- **Get Joint States**: Read all joint positions
|
||||
- **Get IMU Data**: Inertial measurement data
|
||||
- **Get Bumper Status**: Foot contact sensors
|
||||
- **Get Touch Sensors**: Hand/head touch detection
|
||||
- **Get Sonar Range**: Ultrasonic distance sensors
|
||||
- **Get Robot Info**: General robot status
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### NAO Connection Issues
|
||||
```bash
|
||||
# Check NAO network connectivity
|
||||
ping nao.local
|
||||
|
||||
# Check NAOqi service
|
||||
telnet nao.local 9559
|
||||
|
||||
# Restart NAOqi on NAO
|
||||
# (Use robot's web interface or Choregraphe)
|
||||
```
|
||||
|
||||
### ROS2 Issues
|
||||
```bash
|
||||
# Check if naoqi_driver2 is running
|
||||
ros2 node list | grep naoqi
|
||||
|
||||
# Check topic publication rates
|
||||
ros2 topic hz /joint_states
|
||||
|
||||
# Restart the launch file
|
||||
ros2 launch nao_launch nao6_hristudio.launch.py nao_ip:=YOUR_NAO_IP
|
||||
```
|
||||
|
||||
### HRIStudio Connection Issues
|
||||
```bash
|
||||
# Verify rosbridge is running
|
||||
netstat -an | grep 9090
|
||||
|
||||
# Check WebSocket connection
|
||||
curl -i -N -H "Connection: Upgrade" \
|
||||
-H "Upgrade: websocket" \
|
||||
-H "Sec-WebSocket-Key: test" \
|
||||
-H "Sec-WebSocket-Version: 13" \
|
||||
http://localhost:9090
|
||||
```
|
||||
|
||||
### Robot Safety
|
||||
- Always keep emergency stop accessible
|
||||
- Start with small movements and low speeds
|
||||
- Monitor robot battery level
|
||||
- Ensure clear space around robot
|
||||
- Never leave robot unattended during operation
|
||||
|
||||
## Performance Optimization
|
||||
|
||||
### Network Optimization
|
||||
```bash
|
||||
# Increase network buffer sizes for camera data
|
||||
sudo sysctl -w net.core.rmem_max=26214400
|
||||
sudo sysctl -w net.core.rmem_default=26214400
|
||||
```
|
||||
|
||||
### ROS2 Optimization
|
||||
```bash
|
||||
# Adjust QoS settings for better performance
|
||||
export RMW_IMPLEMENTATION=rmw_cyclonedx_cpp
|
||||
export CYCLONEDX_URI=file:///path/to/cyclonedx.xml
|
||||
```
|
||||
|
||||
## Next Steps
|
||||
|
||||
1. **Experiment Design**: Create experiments using NAO6 actions
|
||||
2. **Data Collection**: Use sensor actions for research data
|
||||
3. **Custom Actions**: Extend the plugin with custom behaviors
|
||||
4. **Multi-Robot**: Scale to multiple NAO6 robots
|
||||
5. **Advanced Features**: Implement navigation, manipulation, etc.
|
||||
|
||||
## Support Resources
|
||||
|
||||
- **NAO Documentation**: https://developer.softbankrobotics.com/nao6
|
||||
- **naoqi_driver2**: https://github.com/ros-naoqi/naoqi_driver2
|
||||
- **ROS2 Humble**: https://docs.ros.org/en/humble/
|
||||
- **HRIStudio Docs**: See `docs/` folder
|
||||
- **Community**: HRIStudio Discord/Forum
|
||||
|
||||
---
|
||||
|
||||
**Success!** Your NAO6 is now ready for use with HRIStudio experiments. The robot's capabilities are fully accessible through the visual experiment designer and real-time wizard interface.
|
||||
@@ -3,12 +3,12 @@
|
||||
## 🎯 **Current Status: Production Ready**
|
||||
|
||||
**Project Version**: 1.0.0
|
||||
**Last Updated**: September 2025
|
||||
**Last Updated**: December 2024
|
||||
**Overall Completion**: Complete ✅
|
||||
**Status**: Ready for Production Deployment
|
||||
|
||||
### **🎉 Recent Major Achievement: Route Consolidation Complete**
|
||||
Successfully completed comprehensive route consolidation, eliminating global entity views and implementing study-scoped architecture for better user experience and maintainability.
|
||||
### **🎉 Recent Major Achievement: Wizard Interface Multi-View Implementation Complete**
|
||||
Successfully implemented role-based trial execution interface with Wizard, Observer, and Participant views. Fixed layout issues and eliminated route duplication for clean, production-ready trial execution system.
|
||||
|
||||
---
|
||||
|
||||
@@ -28,6 +28,7 @@ HRIStudio has successfully completed all major development milestones and achiev
|
||||
- ✅ **Trial System Overhaul** - Unified EntityView patterns with real-time execution
|
||||
- ✅ **WebSocket Integration** - Real-time updates with polling fallback
|
||||
- ✅ **Route Consolidation** - Study-scoped architecture with eliminated duplicate components
|
||||
- ✅ **Multi-View Trial Interface** - Role-based Wizard, Observer, and Participant views for thesis research
|
||||
- ✅ **Dashboard Resolution** - Fixed routing issues and implemented proper layout structure
|
||||
|
||||
---
|
||||
|
||||
40
docs/ros2_naoqi.md
Normal file
40
docs/ros2_naoqi.md
Normal file
@@ -0,0 +1,40 @@
|
||||
🤖 NAO6 — ROS 2 Humble Topics (via naoqi_driver2)
|
||||
🏃 Motion & Odometry
|
||||
Topic Message Type Description
|
||||
/cmd_vel geometry_msgs/msg/Twist Command linear and angular base velocities (walking).
|
||||
/odom nav_msgs/msg/Odometry Estimated robot position and velocity.
|
||||
/move_base_simple/goal geometry_msgs/msg/PoseStamped Send goal poses for autonomous navigation.
|
||||
🔩 Joints & Robot State
|
||||
Topic Message Type Description
|
||||
/joint_states sensor_msgs/msg/JointState Standard ROS joint angles, velocities, efforts.
|
||||
/joint_angles naoqi_bridge_msgs/msg/JointAnglesWithSpeed NAO-specific joint control interface.
|
||||
/info naoqi_bridge_msgs/msg/RobotInfo General robot info (model, battery, language, etc.).
|
||||
🎥 Cameras
|
||||
Topic Message Type Description
|
||||
/camera/front/image_raw sensor_msgs/msg/Image Front (head) camera image stream.
|
||||
/camera/front/camera_info sensor_msgs/msg/CameraInfo Intrinsics for front camera.
|
||||
/camera/bottom/image_raw sensor_msgs/msg/Image Bottom (mouth) camera image stream.
|
||||
/camera/bottom/camera_info sensor_msgs/msg/CameraInfo Intrinsics for bottom camera.
|
||||
🦶 Sensors
|
||||
Topic Message Type Description
|
||||
/imu/torso sensor_msgs/msg/Imu Torso inertial measurement data.
|
||||
/bumper naoqi_bridge_msgs/msg/Bumper Foot bumper contact sensors.
|
||||
/hand_touch naoqi_bridge_msgs/msg/HandTouch Hand tactile sensors.
|
||||
/head_touch naoqi_bridge_msgs/msg/HeadTouch Head tactile sensors.
|
||||
/sonar/left sensor_msgs/msg/Range Left ultrasonic range sensor.
|
||||
/sonar/right sensor_msgs/msg/Range Right ultrasonic range sensor.
|
||||
🔊 Audio & Speech
|
||||
Topic Message Type Description
|
||||
/audio audio_common_msgs/msg/AudioData Raw audio input from NAO’s microphones.
|
||||
/speech std_msgs/msg/String Send text-to-speech commands.
|
||||
🧠 System & Diagnostics
|
||||
Topic Message Type Description
|
||||
/diagnostics diagnostic_msgs/msg/DiagnosticArray Hardware and driver status.
|
||||
/robot_description std_msgs/msg/String URDF description of the robot.
|
||||
/tf tf2_msgs/msg/TFMessage Coordinate transforms between frames.
|
||||
/parameter_events rcl_interfaces/msg/ParameterEvent Parameter change notifications.
|
||||
/rosout rcl_interfaces/msg/Log Logging output.
|
||||
✅ ROS 2 bridge status: Active
|
||||
✅ Robot model detected: NAO V6 (NAOqi 2.8.7.4)
|
||||
✅ Driver: naoqi_driver2
|
||||
✅ System confirmed working: motion, speech, camera, IMU, touch, sonar
|
||||
90
docs/thesis-project-priorities.md
Normal file
90
docs/thesis-project-priorities.md
Normal file
@@ -0,0 +1,90 @@
|
||||
# HRIStudio Thesis Implementation - Fall 2025
|
||||
|
||||
**Sean O'Connor - CS Honors Thesis**
|
||||
**Advisor**: L. Felipe Perrone
|
||||
**Defense**: April 2026
|
||||
|
||||
## Implementation Status
|
||||
|
||||
Core platform infrastructure exists but MVP requires wizard interface implementation and robot control integration for functional trials.
|
||||
|
||||
## Fall Development Sprint (10-12 weeks)
|
||||
|
||||
| Sprint | Focus Area | Key Tasks | Success Metric |
|
||||
|--------|------------|-----------|----------------|
|
||||
| 1 (3 weeks) | Wizard Interface MVP | Trial control interface<br/>Step navigation<br/>Action execution buttons | Functional wizard interface for trial control |
|
||||
| 2 (4 weeks) | Robot Integration | NAO6 API integration<br/>Basic action implementation<br/>Error handling and recovery | Wizard button → robot action |
|
||||
| 3 (3 weeks) | Real-time Infrastructure | WebSocket server implementation<br/>Multi-client session management<br/>Event broadcasting system | Multiple users connected to live trial |
|
||||
| 4 (2 weeks) | Integration Testing | Complete workflow validation<br/>Reliability testing<br/>Mock robot mode | 30-minute trials without crashes |
|
||||
|
||||
## User Study Preparation (4-5 weeks)
|
||||
|
||||
| Task Category | Deliverables | Effort |
|
||||
|---------------|--------------|--------|
|
||||
| Study Design | Reference experiment selection<br/>Equivalent implementations (HRIStudio + Choregraphe)<br/>Protocol validation | 3 weeks |
|
||||
| Research Setup | IRB application submission<br/>Training material development<br/>Participant recruitment | 2 weeks |
|
||||
|
||||
## MVP Implementation Priorities
|
||||
|
||||
| Priority | Component | Current State | Target State |
|
||||
|----------|-----------|---------------|-------------|
|
||||
| **P0** | Wizard Interface | Design exists, needs implementation | Functional trial control interface |
|
||||
| **P0** | Robot Control | Simulated responses only | Live NAO6 hardware control |
|
||||
| **P0** | Real-time Communication | Client hooks exist, no server | Multi-user live trial coordination |
|
||||
| **P1** | Trial Execution | Basic framework exists | Integrated with wizard + robot hardware |
|
||||
| **P2** | Data Capture | Basic logging | Comprehensive real-time events |
|
||||
|
||||
## Success Criteria by Phase
|
||||
|
||||
### MVP Complete (10-12 weeks)
|
||||
- [ ] Wizard interface allows trial control and step navigation
|
||||
- [ ] Psychology researcher clicks interface → NAO6 performs action
|
||||
- [ ] Multiple observers watch trial with live updates
|
||||
- [ ] System remains stable during full experimental sessions
|
||||
- [ ] All trial events captured with timestamps
|
||||
|
||||
### Study Ready (14-17 weeks)
|
||||
- [ ] Reference experiment works identically in both platforms
|
||||
- [ ] IRB approval obtained for comparative study
|
||||
- [ ] 10-12 participants recruited from target disciplines
|
||||
- [ ] Platform validated with non-technical users
|
||||
|
||||
## MVP Backlog - Priority Breakdown
|
||||
|
||||
### P0 - Critical MVP Features
|
||||
| Story | Effort | Definition of Done |
|
||||
|-------|--------|-------------------|
|
||||
| Wizard interface trial control | 2 weeks | Interface for starting/stopping trials, navigating steps |
|
||||
| Action execution buttons | 1 week | Buttons for robot actions with real-time feedback |
|
||||
| NAO6 API integration | 3 weeks | Successfully connect to NAO6, execute basic commands |
|
||||
| Basic robot actions | 2 weeks | Speech, movement, posture actions working |
|
||||
| WebSocket server implementation | 2 weeks | Server accepts connections, handles authentication |
|
||||
| Multi-client session management | 1 week | Multiple users can join same trial session |
|
||||
|
||||
### P1 - High Priority Features
|
||||
| Story | Effort | Definition of Done |
|
||||
|-------|--------|-------------------|
|
||||
| Event broadcasting system | 1 week | Actions broadcast to all connected clients |
|
||||
| Robot status monitoring | 1 week | Connection status, error detection |
|
||||
| End-to-end workflow testing | 1.5 weeks | Complete trial execution with real robot |
|
||||
|
||||
### P2 - Backlog (Post-MVP)
|
||||
| Story | Effort | Definition of Done |
|
||||
|-------|--------|-------------------|
|
||||
| Connection recovery mechanisms | 1 week | Auto-reconnect on disconnect, graceful fallback |
|
||||
| Mock robot development mode | 0.5 weeks | Development without hardware dependency |
|
||||
| Performance optimization | 0.5 weeks | Response times under acceptable thresholds |
|
||||
| Advanced data capture | 1 week | Comprehensive real-time event logging |
|
||||
|
||||
## User Study Framework
|
||||
|
||||
**Participants**: 10-12 researchers from Psychology/Education
|
||||
**Task**: Recreate published HRI experiment
|
||||
**Comparison**: HRIStudio (experimental) vs Choregraphe (control)
|
||||
**Measures**: Protocol accuracy, completion time, user experience ratings
|
||||
|
||||
## Implementation Strategy
|
||||
|
||||
Core platform infrastructure exists but wizard interface needs full implementation alongside robot integration. Focus on MVP that enables basic trial execution with real robot control.
|
||||
|
||||
**Critical Path**: Wizard interface → WebSocket server → NAO6 integration → end-to-end testing → user study execution
|
||||
@@ -2,6 +2,31 @@
|
||||
|
||||
## Current Status (December 2024)
|
||||
|
||||
### Wizard Interface Multi-View Implementation - COMPLETE ✅ (December 2024)
|
||||
Complete redesign of trial execution interface with role-based views for thesis research.
|
||||
|
||||
**✅ Completed Implementation:**
|
||||
- **Role-Based Views**: Created three distinct interfaces - Wizard, Observer, and Participant views
|
||||
- **Fixed Layout Issues**: Eliminated double headers and bottom cut-off problems
|
||||
- **Removed Route Duplication**: Cleaned up global trial routes, enforced study-scoped architecture
|
||||
- **Professional UI**: Redesigned with experiment designer-inspired three-panel layout
|
||||
- **Smart Role Detection**: Automatic role assignment with URL override capability (?view=wizard|observer|participant)
|
||||
- **Type Safety**: Full TypeScript compliance with proper metadata handling
|
||||
- **WebSocket Integration**: Connected real-time trial updates with fallback polling
|
||||
|
||||
**Implementation Details:**
|
||||
- **WizardView**: Full trial control with TrialControlPanel, ExecutionPanel, and MonitoringPanel
|
||||
- **ObserverView**: Read-only monitoring interface with trial overview and live activity
|
||||
- **ParticipantView**: Friendly, welcoming interface designed for study participants
|
||||
- **Route Structure**: `/studies/[id]/trials/[trialId]/wizard` with role-based rendering
|
||||
- **Layout Fix**: Proper height calculations with `min-h-0 flex-1` and removed duplicate headers
|
||||
|
||||
**Benefits for Thesis Research:**
|
||||
- **Multi-User Support**: Appropriate interface for researchers, observers, and participants
|
||||
- **Professional Experience**: Clean, purpose-built UI for each user role
|
||||
- **Research Ready**: Supports Wizard of Oz study methodology comparing HRIStudio vs Choregraphe
|
||||
- **Flexible Testing**: URL parameters enable easy view switching during development
|
||||
|
||||
### Route Consolidation - COMPLETE ✅ (September 2024)
|
||||
Major architectural improvement consolidating global routes into study-scoped workflows.
|
||||
|
||||
@@ -22,6 +47,31 @@ Major architectural improvement consolidating global routes into study-scoped wo
|
||||
- **Better UX**: Clear navigation path through study-centric organization
|
||||
- **Maintainability**: Single source of truth for each entity type
|
||||
|
||||
## Next Priority: WebSocket Implementation Enhancement
|
||||
|
||||
### WebSocket Real-Time Infrastructure - IN PROGRESS 🚧
|
||||
Critical for thesis research - enable real-time trial execution and monitoring.
|
||||
|
||||
**Current Status:**
|
||||
- ✅ Basic WebSocket hooks exist (`useWebSocket.ts`, `useTrialWebSocket.ts`)
|
||||
- ✅ Trial execution engine with tRPC endpoints
|
||||
- ❌ **Missing**: Real-time robot communication and status updates
|
||||
- ❌ **Missing**: Live trial event broadcasting to all connected clients
|
||||
- ❌ **Missing**: WebSocket server implementation for trial coordination
|
||||
|
||||
**Required Implementation:**
|
||||
- **Robot Integration**: WebSocket connection to robot platforms (ROS2, REST APIs)
|
||||
- **Event Broadcasting**: Real-time trial events to wizard, observers, and monitoring systems
|
||||
- **Session Management**: Multi-client coordination for collaborative trial execution
|
||||
- **Error Handling**: Robust connection recovery and fallback mechanisms
|
||||
- **Security**: Proper authentication and role-based WebSocket access
|
||||
|
||||
**Files to Focus On:**
|
||||
- `src/hooks/useWebSocket.ts` - Client-side WebSocket management
|
||||
- `src/server/services/trial-execution.ts` - Trial execution engine
|
||||
- WebSocket server implementation (needs creation)
|
||||
- Robot plugin WebSocket adapters
|
||||
|
||||
## Previous Status (December 2024)
|
||||
|
||||
### Experiment Designer Redesign - COMPLETE ✅ (Phase 1)
|
||||
|
||||
Reference in New Issue
Block a user