This shows you the differences between two versions of the page.
|
rasb:lab:09 [2026/06/29 12:12] vlad.radulescu2901 [Exercise 4 - Test the pipeline in the ROS2 simulator] |
rasb:lab:09 [2026/06/29 12:12] (current) vlad.radulescu2901 [Exercise 6 - Demonstrate the full voice-to-Pupper pipeline] |
||
|---|---|---|---|
| Line 1250: | Line 1250: | ||
| | Turn left and sit | Turn left and sit | TURN_LEFT, SIT | TURN_LEFT, SIT | Robot turns left, then sits | | | Turn left and sit | Turn left and sit | TURN_LEFT, SIT | TURN_LEFT, SIT | Robot turns left, then sits | | ||
| | Run into the wall | Run into the wall | STOP | STOP | Robot stops / does not execute unsafe movement | | | Run into the wall | Run into the wall | STOP | STOP | Robot stops / does not execute unsafe movement | | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | ===== Common setup problems ===== | ||
| + | |||
| + | ==== Problem 1 - `ros2: command not found` ==== | ||
| + | |||
| + | ROS2 is not sourced or not installed. | ||
| + | |||
| + | Check: | ||
| + | |||
| + | <code bash> | ||
| + | ls /opt/ros | ||
| + | </code> | ||
| + | |||
| + | For Ubuntu 24.04, source Jazzy: | ||
| + | |||
| + | <code bash> | ||
| + | source /opt/ros/jazzy/setup.bash | ||
| + | </code> | ||
| + | |||
| + | Then source the local workspace: | ||
| + | |||
| + | <code bash> | ||
| + | source install/setup.bash | ||
| + | </code> | ||
| + | |||
| + | ==== Problem 2 - `externally-managed-environment` when using pip ==== | ||
| + | |||
| + | Ubuntu 24 protects the system Python environment. | ||
| + | |||
| + | Use a virtual environment: | ||
| + | |||
| + | <code bash> | ||
| + | cd llm_lab | ||
| + | python3 -m venv --system-site-packages .venv | ||
| + | source .venv/bin/activate | ||
| + | python -m pip install requests sounddevice scipy faster-whisper | ||
| + | </code> | ||
| + | |||
| + | Do not install lab packages globally into the system Python. | ||
| + | |||
| + | ==== Problem 3 - WSL cannot connect to Ollama running on Windows ==== | ||
| + | |||
| + | If Ollama runs on Windows and the pipeline runs in WSL, Ollama must be accessible from WSL. | ||
| + | |||
| + | In Windows PowerShell: | ||
| + | |||
| + | <code powershell> | ||
| + | $env:OLLAMA_HOST="0.0.0.0:11434" | ||
| + | ollama serve | ||
| + | </code> | ||
| + | |||
| + | If WSL still cannot connect, allow inbound TCP traffic on port 11434 in Windows Firewall. | ||
| + | |||
| + | In WSL: | ||
| + | |||
| + | <code bash> | ||
| + | WIN_HOST=$(ip route | awk '/default/ {print $3}') | ||
| + | curl http://$WIN_HOST:11434/api/tags | ||
| + | </code> | ||
| + | |||
| + | Then set: | ||
| + | |||
| + | <code bash> | ||
| + | export OLLAMA_URL="http://$WIN_HOST:11434/api/generate" | ||
| + | </code> | ||
| + | |||
| + | ==== Problem 4 - The simulator does not move ==== | ||
| + | |||
| + | First check that the ROS2 topics exist: | ||
| + | |||
| + | <code bash> | ||
| + | ros2 topic list | ||
| + | </code> | ||
| + | |||
| + | Then publish a manual velocity command: | ||
| + | |||
| + | <code bash> | ||
| + | ros2 topic pub --rate 10 /cmd_vel geometry_msgs/msg/Twist "{linear: {x: 0.2, y: 0.0, z: 0.0}, angular: {x: 0.0, y: 0.0, z: 0.0}}" | ||
| + | </code> | ||
| + | |||
| + | If `pose x` changes in the simulator terminal, the simulator works. | ||
| + | |||
| + | ==== Problem 5 - Microphone does not work in WSL ==== | ||
| + | |||
| + | Some WSL installations do not expose the microphone correctly. | ||
| + | |||
| + | If microphone recording fails, record a short `.wav` file on Windows and process the audio file from WSL. | ||
| + | |||
| + | This still satisfies the voice pipeline requirement because the command starts as spoken audio. | ||
| + | |||
| ===== Deliverables ===== | ===== Deliverables ===== | ||