Skip to content

AfonsoZhang/assignment1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 

Repository files navigation

AAE5303 Environment Setup Report


1. System Information

Laptop model:
MacBook Air M4

CPU / RAM:
M4, 16GB RAM

Host OS:
macOS

Linux/ROS environment type:
Choose one:

  • Dual-boot Ubuntu
  • WSL2 Ubuntu
  • Ubuntu in VM (UTM/VirtualBox/VMware/Parallels)
  • Docker container
  • Lab PC
  • Remote Linux server

2. Python Environment Check

2.1 Steps Taken

Tool used:
conda

Key commands you ran:

docker exec -it ros_conda /bin/sh 
bash
conda activate ros_env
cd ~/PolyU-AAE5303-env-smork-test
ros2_base

Any deviations from the default instructions:
None

2.2 Test Results

Run these commands and paste the actual terminal output (not just screenshots):

python scripts/test_python_env.py

Output:

========================================
AAE5303 Environment Check (Python + ROS)
Goal: help you verify your environment and understand what each check means.
========================================

Step 1: Environment snapshot
  Why: We capture platform/Python/ROS variables to diagnose common setup mistakes (especially mixed ROS env).
Step 2: Python version
  Why: The course assumes Python 3.10+; older versions often break package wheels.
Step 3: Python imports (required/optional)
  Why: Imports verify packages are installed and compatible with your Python version.
Step 4: NumPy sanity checks
  Why: We run a small linear algebra operation so success means more than just `import numpy`.
Step 5: SciPy sanity checks
  Why: We run a small FFT to confirm SciPy is functional (not just installed).
Step 6: Matplotlib backend check
  Why: We generate a tiny plot image (headless) to confirm plotting works on your system.
Step 7: OpenCV PNG decoding (subprocess)
  Why: PNG decoding uses native code; we isolate it so corruption/codec issues cannot crash the whole report.
Step 8: Open3D basic geometry + I/O (subprocess)
  Why: Open3D is a native extension; ABI mismatches can segfault. Subprocess isolation turns crashes into readable failures.
Step 9: ROS toolchain checks
  Why: The course requires ROS tooling. This check passes if ROS 2 OR ROS 1 is available (either one is acceptable).
  Action: building ROS 2 workspace package `env_check_pkg` (this may take 1-3 minutes on first run)...
  Action: running ROS 2 talker/listener for a few seconds to verify messages flow...
Step 10: Basic CLI availability
  Why: We confirm core commands exist on PATH so students can run the same commands as in the labs.

=== Summary ===
✅ Environment: {
  "platform": "Linux-6.12.54-linuxkit-x86_64-with-glibc2.35",
  "python": "3.11.14",
  "executable": "/root/miniconda3/envs/ros_env/bin/python",
  "cwd": "/root/PolyU-AAE5303-env-smork-test",
  "ros": {
    "ROS_VERSION": "2",
    "ROS_DISTRO": "humble",
    "ROS_ROOT": null,
    "ROS_PACKAGE_PATH": null,
    "AMENT_PREFIX_PATH": "/opt/ros/humble",
    "CMAKE_PREFIX_PATH": null
  }
}
✅ Python version OK: 3.11.14
✅ Module 'numpy' found (v2.4.1).
✅ Module 'scipy' found (v1.17.0).
✅ Module 'matplotlib' found (v3.10.8).
✅ Module 'cv2' found (v4.13.0).
✅ Missing optional module 'rclpy'.
✅ numpy matrix multiply OK.
✅ numpy version 2.4.1 detected.
✅ scipy FFT OK.
✅ scipy version 1.17.0 detected.
✅ matplotlib backend OK (Agg), version 3.10.8.
✅ OpenCV OK (v4.13.0), decoded sample image 128x128.
✅ Open3D OK (v0.19.0), NumPy 2.4.1.
✅ Open3D loaded sample PCD with 8 pts and completed round-trip I/O.
✅ ROS 2 CLI OK: /opt/ros/humble/bin/ros2
✅ ROS 1 tools not found (acceptable if ROS 2 is installed).
✅ colcon found: /root/miniconda3/envs/ros_env/bin/colcon
✅ ROS 2 workspace build OK (env_check_pkg).
✅ ROS 2 runtime OK: talker and listener exchanged messages.
✅ Binary 'python3' found at /root/miniconda3/envs/ros_env/bin/python3

All checks passed. You are ready for AAE5303 🚀
python scripts/test_open3d_pointcloud.py

Output:

ℹ️ Loading /root/PolyU-AAE5303-env-smork-test/data/sample_pointcloud.pcd ...
✅ Loaded 8 points.
   • Centroid: [0.025 0.025 0.025]
   • Axis-aligned bounds: min=[0. 0. 0.], max=[0.05 0.05 0.05]
✅ Filtered point cloud kept 7 points.
✅ Wrote filtered copy with 7 points to /root/PolyU-AAE5303-env-smork-test/data/sample_pointcloud_copy.pcd
   • AABB extents: [0.05 0.05 0.05]
   • OBB  extents: [0.08164966 0.07071068 0.05773503], max dim 0.0816 m
🎉 Open3D point cloud pipeline looks good.

Screenshot:

smoke test open3d test

3. ROS 2 Workspace Check

3.1 Build the workspace

Paste the build output summary (final lines only):

source /opt/ros/humble/setup.bash
colcon build

Expected output:

Summary: 1 package finished [x.xx s]

Your actual output:

Summary: 1 package finished [0.49s]

3.2 Run talker and listener

Show both source commands:

source /opt/ros/humble/setup.bash
source install/setup.bash

Then run talker:

ros2 run env_check_pkg talker

Output (3–4 lines):

[INFO] [1769415320.261680087] [env_check_pkg_talker]: Publishing: 'AAE5303 hello #0'
[INFO] [1769415320.761732588] [env_check_pkg_talker]: Publishing: 'AAE5303 hello #1'
[INFO] [1769415321.258829505] [env_check_pkg_talker]: Publishing: 'AAE5303 hello #2'
[INFO] [1769415321.761697421] [env_check_pkg_talker]: Publishing: 'AAE5303 hello #3'

Run listener:

ros2 run env_check_pkg listener

Output (3–4 lines):

[INFO] [1769415772.472540922] [env_check_pkg_listener]: I heard: 'AAE5303 hello #330'
[INFO] [1769415772.972610630] [env_check_pkg_listener]: I heard: 'AAE5303 hello #331'
[INFO] [1769415773.474171797] [env_check_pkg_listener]: I heard: 'AAE5303 hello #332'
[INFO] [1769415773.969529172] [env_check_pkg_listener]: I heard: 'AAE5303 hello #333'

Alternative (using launch file):

ros2 launch env_check_pkg env_check.launch.py

Screenshot:
talker listener test


4. Problems Encountered and How I Solved Them

Issue 1: ERROR: No matching distribution found for open3d==0.19.0

Cause / diagnosis:
My Python version is 3.13, but Open3D only supports 3.11.

Fix:
Install Python 3.11 in conda environment

apt update
apt install -y wget

cd ~
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh -b -p ~/miniconda3

~/miniconda3/bin/conda init bash
source ~/.bashrc

Reference:
Classmate&AI assistant


Issue 2: CondaToSNonInteractiveError: Terms of Service have not been accepted for the following channels.

Cause / diagnosis:
Anaconda's Terms of Service

Fix:
Accept Anaconda's Terms of Service before creating environments using their channels

conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/main
conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/r

conda create -n ros_env python=3.11 -y

Reference:
AI assistant


Issue 3: ❌ ROS 2 workspace build failed (exit 1).

Cause / diagnosis:
The conda environment's Python is being used instead of the system Python that has ROS 2 dependencies.

Fix:
Install ROS dependencies in conda environment

pip install catkin_pkg empy lark colcon-common-extensions
cd ~/PolyU-AAE5303-env-smork-test/ros2_ws
rm -rf build install log
source /opt/ros/humble/setup.bash
colcon build

Reference:
AI assistant


5. Use of Generative AI (Required)

5.1 Exact prompt you asked

Your prompt:

i don't want to run:source /opt/ros/humble/setup.bash everytime when i want to run a script

5.2 Key helpful part of the AI's answer

AI's response (relevant part only):

echo '' >> ~/.bashrc
echo '# ROS 2 Humble setup' >> ~/.bashrc
echo 'source /opt/ros/humble/setup.bash' >> ~/.bashrc
echo 'source ~/PolyU-AAE5303-env-smork-test/ros2_ws/install/setup.bash' >> ~/.bashrc
source ~/.bashrc

5.3 What you changed or ignored and why

Explain briefly:

  • Did the AI recommend something unsafe?
  • Did you modify its solution?
  • Did you double-check with official docs?

Your explanation:
Nothing unsafe; I decide to use alias instead of changing too much; I double check the code it provide and it is correct

5.4 Final solution you applied

Show the exact command or file edit that fixed the problem:

echo 'alias ros2_base="source /opt/ros/humble/setup.bash"' >> ~/.bashrc

Why this worked:
Nothing needed to explain


6. Reflection (3–5 sentences)

Short but thoughtful:

  • What did you learn about configuring robotics environments?
  • What surprised you?
  • What would you do differently next time (backup, partitioning, reading error logs, asking better AI questions)?
  • How confident do you feel about debugging ROS/Python issues now?

Your reflection:

ROS 2 requires proper environment sourcing (source /opt/ros/humble/setup.bash) before building or running nodes; ROS 2 executables don't use file extensions (e.g., ros2 run env_check_pkg talker, not talker.py); Read error logs carefully - the ModuleNotFoundError: No module named 'catkin_pkg' clearly pointed to a Python environment issue; More confident in reading build errors and identifying environment issues


7. Declaration

I confirm that I performed this setup myself and all screenshots/logs reflect my own environment.

Name:
ZHANG Shuyang

Student ID:
25049993G

Date:
01/30/2026


Submission Checklist

Before submitting, ensure you have:

  • Filled in all system information
  • Included actual terminal outputs (not just screenshots)
  • Provided at least 2 screenshots (Python tests + ROS talker/listener)
  • Documented 2–3 real problems with solutions
  • Completed the AI usage section with exact prompts
  • Written a thoughtful reflection (3–5 sentences)
  • Signed the declaration

End of Report

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors