Rover written with RUST
Fifth : Visual Odometry
2025.10.28 22:59
Visual Odometry
Now that we have a filtered 3D point cloud from a single stereo frame, the next stage is Visual Odometry (VO). This is the process of estimating the rover's movement (translation and rotation) by comparing consecutive point clouds or images.
The basic idea is:
-
Capture Frame 1: Get the filtered point cloud (like the
point_cloud_filtered_full.txtyou just saved). -
Capture Frame 2: Move the rover slightly, capture a new stereo pair, and generate its filtered point cloud.
-
Find the Transformation: Use algorithms (like ICP - Iterative Closest Point, or feature matching) to find the 3D rotation and translation that best aligns Point Cloud 1 with Point Cloud 2. This transformation represents the rover's movement between the two frames.
-
Update Position & Map: Add the estimated movement to the rover's overall pose (position and orientation) and optionally add the new 3D points to a growing map of the environment.
-
Repeat: Continue capturing frames and estimating motion.
This VO step is significantly more complex than the previous stages. It involves tracking features or aligning point clouds between frames.
// New project folder : ~/RUST/rover_odometry by cargo new rover_odometry @ ~/RUST folder.
~/RUST/rover_odometry/Cargo.toml file:
[package]
name = "rover_odometry"
version = "0.1.0"
edition = "2024"
[dependencies]
# For linear algebra (points, vectors, matrices) - good practice for VO
nalgebra = "0.32"
# Error handling simplification
anyhow = "1.0"
//============================================
Plan for src/main.rs
The first step in visual odometry is to load the 3D point cloud data from the file I created.
I'll write code in src/main.rs to:
-
Define a simple struct to hold an
(x, y, z)point. -
Open and read the
point_cloud_filtered_full.txtfile line by line. -
Parse each line to extract the X, Y, and Z coordinates.
-
Store these points in a
Vec(vector) of our point structs. -
Print out how many points were loaded to confirm it works.
//============================================
Comment 0
| No. | Subject | Author | Date | Views |
|---|---|---|---|---|
| » |
Fifth : Visual Odometry
| me | 2025.10.28 | 0 |
| 7 |
Fourth-3 : Filtering Data
| me | 2025.10.28 | 0 |
| 6 |
Fourth-2 : Shrink down data count (4x4 block)
| me | 2025.10.28 | 0 |
| 5 |
Fourth : Depth Map
| me | 2025.10.28 | 0 |
| 4 |
Third : Rectify calibrated result
| me | 2025.10.28 | 0 |
| 3 | Second : Calibration using checker board [1] | me | 2025.10.28 | 0 |
| 2 |
First : Stereo Camera's image generation for calibration
| me | 2025.10.28 | 0 |
| 1 | Set-up in x64 Debian for development | me | 2025.10.27 | 0 |