Skip to content

Conversation

@baishibona
Copy link
Collaborator

Summary

  • Add FASTLIO2 as alternative SLAM method alongside arise_slam (select at runtime via LOCALIZATION_METHOD)
  • Add arm64 build support (open3d from source, or-tools from source, rviz2 install)
  • Add bagfile mode and MAP_PATH support for localization with pre-built PCD maps
  • Add ros-joy runtime dependency
  • Docker multi-stage build with both arise_slam and FASTLIO2 included

Test plan

  • Hardware tested on NucBox M2 Pro with Mid-360 lidar (Jazzy)
  • arise_slam still works as default SLAM method
  • FASTLIO2 mapping mode (PGO) verified
  • FASTLIO2 localization mode with MAP_PATH verified
  • Bagfile playback with use_sim_time verified
  • amd64 build verified

iserverobotics-bona and others added 18 commits January 27, 2026 17:44
Verified working: ./start.sh --hardware --tag humble-fastlio --route-planner

- Add docker-compose.deploy.yml for pre-built Docker Hub images
- Update build.sh with --fastlio/--arise SLAM type selection
- Update start.sh with --tag, --route-planner options
- Add FASTLIO2 autonomy bridge, terrain analysis, FAR planner launches
- Support for Unitree robot via USE_UNITREE env var
- build.sh now exports IMAGE_TAG="${ROS_DISTRO}-${SLAM_TYPE}"
- start.sh uses local dimos_autonomy_stack:${IMAGE_TAG} image
- docker-compose.yml uses IMAGE_TAG for both simulation and hardware
- Removed Docker Hub pull, prompts user to build if image missing
- Dockerfile builds both SLAM systems in single image
- LOCALIZATION_METHOD env var selects arise_slam (default) or fastlio
- IMAGE_TAG simplified to just ROS_DISTRO (e.g., humble, jazzy)
- build.sh uses fastlio2 branch which has both SLAM systems
- start.sh --arise/--fastlio flags set LOCALIZATION_METHOD
The $SLAM_ARG variable wasn't expanding correctly in docker-compose
command. Fixed by directly embedding the launch argument based on
LOCALIZATION_METHOD env var.
- Add --bagfile flag to start.sh for bagfile playback (use_sim_time=true)
- Add dimos_bagfile service to docker-compose.yml
- Add MAP_PATH env var and ./maps volume mount for localization mode
- Support --fastlio, --route-planner, --rviz flags in bagfile mode
ros-base image doesn't include rviz2, causing build failure for
teleop_rviz_plugin and other rviz-dependent packages. Added conditional
install that only runs on arm64, with ARG placement optimized for layer caching.
The tare_planner package includes pre-built or-tools binaries for x86_64.
On arm64, these fail to link with 'file in wrong format' error.

Added conditional build steps for arm64:
- Build or-tools v9.8 from source with BUILD_DEPS=ON
- Replace x86_64 libraries/headers with arm64 build
- Disabled SCIP and COINOR (not needed for routing/TSP solver)
Launch files reference joy_node for joystick input but the joy package
was not installed in the runtime stage, causing launch failure.
open3d 0.18.0 has aarch64 wheels for Python 3.8-3.11 (Humble works).
open3d 0.19.0 dropped aarch64 Linux wheels entirely.
No version has aarch64 wheels for Python 3.12 (Jazzy).

Pin to 0.18.0 and build from source only when arm64 + Python >= 3.12.
open3d==0.18.0 was removed from PyPI; only 0.19.0 is available for
x86_64 / Python 3.12, breaking the Docker build on amd64.

Remove the version pin so pip resolves the latest compatible release.
open3d version handling per platform:
- amd64 (humble/jazzy): installs from PyPI (currently 0.19.0)
- arm64 + jazzy (Python 3.12+): built from source (v0.18.0) in
  Dockerfile, satisfies the unversioned requirement
- arm64 + humble (Python 3.10): installs from PyPI (aarch64 wheels
  available for older Python)
GLFW requires Xinerama, Xcursor, Xrandr, Xi headers even when
BUILD_GUI=OFF. Only affects arm64 + Python 3.12+ builds.
…open3d build

- Use Open3D's own dependency installer for completeness
- Cap make jobs at 4 to avoid OOM on arm64
- Disable WebRTC module (not needed)
@greptile-apps
Copy link

greptile-apps bot commented Jan 29, 2026

Greptile Overview

Greptile Summary

This PR adds comprehensive FASTLIO2 support alongside the existing arise_slam, enabling runtime SLAM method selection via LOCALIZATION_METHOD environment variable. It also introduces arm64 architecture support for the Docker build.

Major Changes:

  • Multi-stage Dockerfile now builds for both amd64 (desktop-full) and arm64 (ros-base) platforms
  • On arm64, open3d and or-tools are built from source since pre-built binaries are x86_64 only
  • Both arise_slam and FASTLIO2 configs are copied to the runtime image
  • New bagfile playback mode added with use_sim_time=true for testing with recorded data
  • CLI updated with --localization and --image flags for better UX
  • MAP_PATH support added for localization mode with pre-built PCD maps
  • ros-joy added as runtime dependency
  • Build script now clones from dimensionalOS/ros-navigation-autonomy-stack fastlio2 branch (switched back from VectorRobotics fork per PR thread feedback)

Key Implementation Details:

  • SLAM method selection is handled at container launch time via conditional logic in docker-compose.yml command sections
  • Launch files receive use_fastlio2:=true parameter when FASTLIO2 is selected
  • Hardware-tested on NucBox M2 Pro with Mid-360 lidar according to test plan
  • Image size remains ~24 GB as documented

Confidence Score: 4/5

  • Safe to merge with minor style improvements possible
  • The PR is hardware-verified and addresses previous review feedback about switching from VectorRobotics to dimensionalOS repository. The implementation is solid with proper multi-arch support, though there are minor style improvements suggested around error handling (wildcard rm patterns, stash recovery messaging)
  • docker/navigation/Dockerfile and docker/navigation/build.sh have minor style improvement suggestions but no critical issues

Important Files Changed

Filename Overview
docker/navigation/build.sh Updated to clone from dimensionalOS/fastlio2 branch, improved local changes detection, better error messages
docker/navigation/Dockerfile Added arm64 support, FASTLIO2 alongside arise_slam, builds open3d and or-tools from source on arm64
docker/navigation/docker-compose.yml Added LOCALIZATION_METHOD env var, bagfile profile, MAP_PATH support, conditional launch logic for both SLAM methods
docker/navigation/start.sh Added --bagfile mode, --image and --localization flags, improved image existence check, creates required directories

Sequence Diagram

sequenceDiagram
    participant User
    participant build.sh
    participant start.sh
    participant Docker
    participant Container
    participant ROS2

    Note over User,ROS2: Build Phase
    User->>build.sh: ./build.sh --jazzy
    build.sh->>build.sh: Clone/update ros-navigation-autonomy-stack (fastlio2 branch)
    build.sh->>Docker: docker compose build
    Docker->>Docker: Build multi-arch image (amd64/arm64)
    alt arm64
        Docker->>Docker: Build open3d from source
        Docker->>Docker: Build or-tools from source
    end
    Docker->>Docker: Build arise_slam + FASTLIO2
    Docker->>Docker: Copy configs for both SLAM methods
    Docker-->>build.sh: Image: dimos_autonomy_stack:jazzy

    Note over User,ROS2: Runtime Phase (Hardware Mode)
    User->>start.sh: ./start.sh --hardware --localization fastlio --route-planner
    start.sh->>start.sh: Set LOCALIZATION_METHOD=fastlio
    start.sh->>start.sh: Validate .env file exists
    start.sh->>start.sh: Check lidar configuration
    start.sh->>start.sh: Verify image exists
    start.sh->>Docker: docker compose --profile hardware up
    Docker->>Container: Start with LOCALIZATION_METHOD env
    Container->>Container: source ROS workspace
    alt LOCALIZATION_METHOD=fastlio
        Container->>ROS2: ros2 launch system_real_robot_with_route_planner.launch.py use_fastlio2:=true
        ROS2->>ROS2: Start FASTLIO2 SLAM
    else LOCALIZATION_METHOD=arise_slam
        Container->>ROS2: ros2 launch system_real_robot_with_route_planner.launch.py
        ROS2->>ROS2: Start arise_slam
    end
    Container->>ROS2: Start route planner (FAR planner)
    alt USE_RVIZ=true
        Container->>ROS2: ros2 run rviz2 rviz2
    end
    Container->>ROS2: Start Foxglove bridge
    ROS2-->>User: Navigation system ready

    Note over User,ROS2: Bagfile Playback Mode
    User->>start.sh: ./start.sh --bagfile --localization fastlio
    start.sh->>Docker: docker compose --profile bagfile up
    Docker->>Container: Start with use_sim_time=true
    Container->>ROS2: ros2 launch system_bagfile.launch.py use_fastlio2:=true
    User->>Container: ros2 bag play --clock bagfile
    ROS2->>ROS2: Process bagfile with FASTLIO2
Loading

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4 files reviewed, 6 comments

Edit Code Review Agent Settings | Greptile

@baishibona
Copy link
Collaborator Author

DO NOT MERGE UNTIL VERIFIED ON G1 (JETSON)

- Replace --humble/--jazzy with --image <distro>
- Replace --arise/--fastlio with --localization <method>
- Remove redundant --tag flag
- Group help text by mutually exclusive options
- Cap or-tools build parallelism to 4 (match open3d/ceres)
- Abort build if local changes in autonomy stack (instead of git reset --hard)
- Remove redundant git remote add in build.sh
- Update README with new CLI syntax
…onalOS

Update build.sh to clone from dimensionalOS/ros-navigation-autonomy-stack
instead of VectorRobotics/vector_navigation_stack. Remove redundant
vector remote setup.
@baishibona
Copy link
Collaborator Author

@greptile, @greptile-app. Update to address comments. Please review.

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants