This repository contains two robotics projects developed in C++ for the Robotics course at Politecnico di Milano. The projects cover the full autonomous navigation pipeline: from low-level kinematics and GPS coordinate transformations to 2D SLAM (Simultaneous Localization and Mapping) and autonomous path planning using the ROS Navigation Stack.
Folder: first_project/
This project focuses on calculating high-precision vehicle odometry and transforming global GPS coordinates into a local reference frame. Using telemetry data (speed and steering angle) from a vehicle running on the Monza circuit, we compute the robot's pose in real-time.
-
Custom Odometry Node: Implemented a ROS C++ node (
odometer) that subscribes to vehicle telemetry (/speedsteer) and computes the state using Runge-Kutta kinematics (Ackermann steering model). - Coordinate Transformations: Handled the mathematical conversion of dual-GPS coordinates from Latitude/Longitude to ECEF (Earth-Centered, Earth-Fixed), and subsequently to ENU (East-North-Up) local reference frames.
-
TF Broadcasting: Published the calculated
nav_msgs/Odometryand the dynamictftransform (odom$\rightarrow$ base_link). - Telemetry Pipeline: Tracked Monza circuit sector times using Haversine formulas and spatial boundary checking.
- Build the workspace:
catkin_make - Run the odometry node:
rosrun first_project odometer - Play the provided bag file:
rosbag play --clock project.bag
Folder: second_project/
This project implements a complete SLAM pipeline and autonomous navigation system for a custom-sized differential drive robot (
- LiDAR Sensor Fusion: Merged
/scan_frontand/scan_backtopics into a single 360-degree representation usingTF2coordinate transformations. - Self-Collision Filtering: Implemented a point-filtering algorithm to dynamically remove LiDAR hits that collided with the robot's own chassis, preventing false obstacles in the map.
- SLAM Pipeline: Integrated the processed laserscans and odometry data with standard ROS mapping packages to generate a reliable 2D occupancy grid of the environment.
- Autonomous Navigation: Configured a realistic robot simulation using Stage and the ROS Navigation Stack. Sent asynchronous navigation goals using ROS Action Servers.
- Build the workspace:
catkin_make - Launch the mapping/navigation pipeline:
roslaunch second_project main.launch - Play the bag file (with simulated time):
rosbag play --clock robotics2.bag - Use the
RVizinterface or Action Client to send 2D Nav Goals.
To run these packages, you need an Ubuntu environment with ROS installed (tested on ROS Noetic).
# Install core ROS navigation and mapping dependencies
sudo apt-get install ros-noetic-navigation
sudo apt-get install ros-noetic-gmapping
sudo apt-get install ros-noetic-stage-ros
sudo apt-get install ros-noetic-tf2-geometry-msgs