Skip to content

TrespH/PolimiRoboticsProjects

Repository files navigation

ROS Projects at Politecnico di Milano - course of Robotics [A.A. 2024/2025]

Authors

  • Matteo Pompilio
  • Piero Burigana
  • Merve Rana Kizil

First Project

In robotics/catkin_ws/src/first_project/ you can find the implementation of odometry and sector timing for a mobile car robot using ROS, working directly with raw vehicle and GPS data, at the Monza circuit.

Robot of project 1

Project Structure

  • Task 1: Odometry from Vehicle Data

    • Process messages from vehicle sensors to compute odometry.
    • Subscribes to /speedsteer topic (geometry_msgs/PointStamped):
      • y: speed (km/h)
      • x: steering wheel angle (deg)
    • Publishes odometry (nav_msgs/Odometry) to /odom and broadcasts a TF transform from odom to vehicle.
  • Task 2: Odometry from GPS

    • Subscribes to /swiftnav/front/gps_pose topic (sensor_msgs/NavSatFix).
    • Converts latitude, longitude, altitude to ECEF, then to local ENU coordinates.
    • Publishes odometry (nav_msgs/Odometry) to /gps_odom and broadcasts a TF transform from odom to gps.
    • Allows manual configuration of reference point via launch file parameters (lat_r, lon_r, alt_r).
  • Task 3: Sector Times and Speed

    • Subscribes to both vehicle and GPS topics.
    • Publishes sector time and average speed (custom message on /sector_times).

How to Run

  1. Preparation

    • All launch and config files are in the launch/ directory.
  2. Start the System

    • Use the included launch file (automatically starts all nodes and RViz visualization):

      roslaunch first_project launch.launch
  3. Play the ROS Bag File

    • Run the bag file containing recorded data:

      rosbag play --clock data/project.bag
  4. Visualization

    • Use RViz for visualizing odometry topics and TFs.
    • The arrows represent different odometry sources (blue: vehicle odom, with expected huge bias after the first straigth sector with respect to the red track, from GPS odom). alt text

Requirements

  • ROS Noetic
  • RViz for visualization
  • Bag file: project.bag

Provided Folders

  • src/ – Source code for all nodes.
  • launch/ – Launch files to start the system and RViz.
  • cfg/ – RViz configuration files.

Second Project

In robotics/catkin_ws/src/second_project/ you can find the implementation of a mapping and navigation pipeline for a mobile robot using ROS.

Robot of the second project

Project Structure

  • Task 1: Mapping

    • Use two 2D LiDAR scans and robot odometry from a ROS bag to reconstruct an environment map
    • Data topics: /scan_back, /scan_front, /odometry, /tf, /tf_static
    • Merge the two lasers for 360° coverage and filter out points belonging to the robot
    • At first, we used the gmapping package, which works on a Grid-based Rao-Blackwellized Particle Filter SLAM; then, we tried to improve our mapping by the slam-toolbox package, which exploits the power of Pose Graph SLAM, with slightly better results, tuning the numerous parameters by trial-and-error
    • Export the map as pgm, .png images and as .data, .posegraph and .yaml files
  • Task 2: Navigation

    • Simulate the robot in Stage using the generated map.
    • Setup navigation stack to localize and plan using the static map.
    • Drive to goals loaded from a CSV file, published via a custom node using ROS actions.
    • Visualize in RViz: robot, map, TFs, particle cloud (AMCL), paths, goals (you can also manually send goals via the Navigation toolset).

How to Run

  1. Mapping

    • Edit and use the launch files in launch/:

      roslaunch second_project mapping.launch
    • Play the bag file:

      rosbag play --clock data/robotics2.bag
    • Save the map using map_server and the serial formats using serialize_map from slam-toolbox:

      rosrun map_server map_saver -f ./catkin_ws/src/second_project/map/map
      rosservice call /slam_toolbox/serialize_map "{filename: '/home/robotics/catkin_ws/src/second_project/map/map'}"
    • Lastly, crop and clean the map using GIMP:

      Mapping of the second project

  2. Navigation

    • Use the included launch files in launch/:

      roslaunch second_project navigation.launch
    • The map from Task 1 must be placed in the map/ folder.

    • Run with simulated time enabled.

    • Goals are read automatically from csv/goals.csv.

    • The robot will navigate to each goal sequentially:

      Navigation of the second project

  3. Visualization

    • On Windows, connect to http://localhost:8080/vnc.html
    • RViz configuration files are provided in rviz/.
    • View the map, robot, sensors, and navigation status.
    • Alternatively, you can visualize everything by using Floxglove, and by running it:
    roslaunch foxglove_bridge foxglove_bridge.launch port:=8765 address:=0.0.0.0

Requirements

  • ROS Noetic
  • Mapping package: slam-toolbox
  • Stage simulator
  • Additional ROS packages: map_server, move_base, amcl
  • RViz for visualization
  • Bag file: robotics2.bag, in the /robotics/data folder

Provided Folders

  • mapping/ – Source and launch files for Task 1.
  • navigation/ – Source and launch files for Task 2.
  • map/ – Output map files.
  • csv/ – File with navigation goals.
  • rviz/ – RViz configs.
  • config/ – Configuration files for move_base and local/global planners.
  • launch/ – Launch files to start the system and RViz.
  • stage/ – Stage simulation files.

About

ROS projects of the course of Robotics, at Politecnico di Milano, 2025

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors