{"id":23639089,"url":"https://github.com/alepuglisi/perception-localization-mapping-projects","last_synced_at":"2025-11-09T17:30:16.461Z","repository":{"id":266745239,"uuid":"899234057","full_name":"AlePuglisi/perception-localization-mapping-projects","owner":"AlePuglisi","description":" Odometry and SLAM on mobile robot with ROS Noeitc.","archived":false,"fork":false,"pushed_at":"2024-12-20T23:26:13.000Z","size":17152,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-28T08:12:14.898Z","etag":null,"topics":["cpp","kinematics","mobile-robots","odometry","ros-noetic","slam-toolbox"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AlePuglisi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-05T21:35:17.000Z","updated_at":"2024-12-20T23:26:16.000Z","dependencies_parsed_at":"2024-12-05T22:37:06.133Z","dependency_job_id":null,"html_url":"https://github.com/AlePuglisi/perception-localization-mapping-projects","commit_stats":null,"previous_names":["alepuglisi/perception-localization-mapping-projects"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlePuglisi%2Fperception-localization-mapping-projects","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlePuglisi%2Fperception-localization-mapping-projects/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlePuglisi%2Fperception-localization-mapping-projects/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlePuglisi%2Fperception-localization-mapping-projects/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlePuglisi","download_url":"https://codeload.github.com/AlePuglisi/perception-localization-mapping-projects/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239576801,"owners_count":19662112,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp","kinematics","mobile-robots","odometry","ros-noetic","slam-toolbox"],"created_at":"2024-12-28T08:12:18.362Z","updated_at":"2025-11-09T17:30:14.147Z","avatar_url":"https://github.com/AlePuglisi.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# perception-localization-mapping-projects\n\nROS Noetic | mobile robot | odometry | slam_toolbox | C++\n\nThis repository contains the assignment description and my team's solutions for the two projects of the course in \u003cbr/\u003e\n[Perception Localization and Mapping](https://www11.ceda.polimi.it/schedaincarico/schedaincarico/controller/scheda_pubblica/SchedaPublic.do?\u0026evn_default=evento\u0026c_classe=837910\u0026__pj0=0\u0026__pj1=22e9c7f323b7d3a5839ccc4b7486a513).\n\u003cbr/\u003e \u003cbr/\u003e\nThe pdf [ROS_basics](https://github.com/AlePuglisi/perception-localization-mapping-projects/blob/main/ROS_basic.pdf) contains my post-lecture notes on the laboratory sessions.\n\n\u003e [!IMPORTANT]\n\u003e Even if in the pdf assignment there is a Google Drive link to the project data,\n\u003e \u003cbr/\u003eunfortunately that Drive is updated to the most recent academic year assignment (not to the one described in this Repo, 2023).\u003cbr/\u003e\n\u003e Refer to my Drive link to download the bags used in this project. \n\n## first_project (odometry)\n\n\u003cimg width=400 height=250 src=\"https://github.com/user-attachments/assets/06a8f912-daf4-48cb-baec-d58b6a6a3042\"\u003e   \u003cimg width=350 height=250 src=\"https://github.com/user-attachments/assets/f02ca1b0-1b82-4ff7-bef7-37536381eb14\"\u003e\n\u003cbr/\u003e\n\n\u003e [!NOTE]\n\u003e bags available at this [Drive](https://drive.google.com/drive/folders/10B7Mg8ThTb4swSUDhQWUvD6HOool90-R?usp=sharing).\n\u003e The two files P1_first.bag and P1_second.bag refer to two navigation recording session.\n\nWe were asked to compute robot odometry given a ROS Bag file, containing the recording of a navigation session for an autonomous shuttle at Politecnico di Milano. \nThe Bag file contains information about the wheel encoder and a 2D LIDAR point cloud for visualization (in RViz).\n\nThe main functions of **odom_node** are:\n- Listen to the encoder information, when information arrives it updates odometry using the bicycle kinematic model for the vehicle.\n- when encoder data arrives, using a TF broadcaster, the new estimated position is published\n- A standard odometry message and a custom message are published (also as encoder callback).\n\n``first_project`` package provide also: \n- A Service ``reset_odom``, to reset odometry data (x, y, theta).\n- A launch file that runs odom_node, initialize sim_time and odometric variables.\n  Run four static TF publishers for the vehicle wheels' position with respect to base_link. \n\n### Run the code:\nAfter installing ``first_project`` package (catkin_make on the workspace), as with any other ROS package (remember to source): \n\nFirst of all, remember the roscore!\n```bash\n# Terminal 0:\nroscore\n```\n\nThe bag file has to be played in a separate terminal to test the code. \nOtherwise, this can be tested by publishing \"fake\" encoder data in the proper topic \"speed_steer\", with data of the expected type. \n\n```bash\n# Terminal 1:\nrosbag play \u003crobot.bag\u003e\n\n#Or the alternative way to publish encoder data if bag not available\n```\n\n```bash\n# Terminal 2:\nroslaunch first_project odom_launch.launch \n```\n\nTo visualize TF and LIDAR signals, RViz has to be run in another Terminal:\n```bash\n# Terminal 3:\nrosrun rviz rviz\n```\n\n\u003e [!IMPORTANT]\n\u003e In RViz add by topic all the useful information to look at (then it is possible to save a custom RViz config to run automatically). \n\u003e We were not very skilled with ROS, the best practice is to start RViz in the launch itself and define a \".rviz\" configuration file. \n\n\nFor further details on the task, refer to [first_project assignment](https://github.com/AlePuglisi/perception-localization-mapping-projects/blob/main/first_project.pdf) \u003cbr/\u003e\n(being the first project with ROS, the structure of the node is not optimal)\n\n## second_project (Mapping and Waypoint Navigation)\n\u003cimg width=400 height=250 src=https://github.com/user-attachments/assets/54778a4b-020e-42b2-a8e8-6105746db9a8\u003e\n   \u003cimg width=400 height=250 src=https://github.com/user-attachments/assets/ca994bbc-07dd-44ef-bc9a-064b1eb451ef\u003e\n\n\n\u003e [!NOTE]\n\u003e Bags available at this [Drive](https://drive.google.com/drive/folders/17pQHKxioGbRE6v2I1SAPwcwlTDyNcyvS?usp=drive_link).\n\u003e The two files P2_first.bag and P2_second.bag refer to two navigation recording sessions.\n\u003e \u003cbr/\u003eTo launch mapping, upload the bag files on /second_project/bags, or change the path to the bag file in ``mapping.launch``\n\nGiven a ROS Bag file with the recording of a teleoperation of the robot above inside the Lab, we have to create a map from scanner data, denoise the map manually, and then set up autonomous navigation on that map.\nFor this project, a lightweight robot simulator is used, called ``stage`` (The best practice for simulation is to use Gazebo or other simulators ... I never use stage again to be honest).\nThis simulator is used for a simple kinematic and sensor simulation, but the Navigation stack used in this project is obviously compatible with Gazebo. \n\nThe Bag file contains: \n- Data from single plane scanner in \"/scan\"\n- Odometry data in \"/t265/odom\"\n- 3d Laser data in \"/velodyne_points\"\n\nThe structure of ``second_project`` package is as follows: \n- Nodes: \n  - ``tf_publisher``:\u003cbr/\u003e\n     Convert  odometry data in \"/t265/odom\" to TF data (necessary conversion for SLAM performed by the navigation toolbox)\n  - ``navigation``:\u003cbr/\u003e\n    Manage the waypoint reading from csv file, and the navigation MoveBaseAction requests.\n    (An alternative way to write the same node is ``navigation(with classes)``\n- Launch:\n  - ``mapping``:\u003cbr/\u003e\n    Start the rosbag (we have two bags available to perform the mapping).\n    Perform the mapping procedure from sensor data, which is necessary before navigation.\n    3d laser Point cloud (from velodyne) is converted into 2d data by ``pointcloud_to_laserscan`` node (with proper parameter initialization).\n\n    The mapping output is then denoised manually, to remove sensor noise that can affect navigation.\n    \n  - ``navigation``:\u003cbr/\u003e\n    Launch our navigation node (for waypoint management) and set all the parameters for the navigation toolbox.\n### Run the code:\n- **Mapping**:\n  \u003cbr/\u003eRemember to upload the bag files as defined above.\n  As usual, start with the ``roscore``, then:\n  ```bash\n  # Terminal 1:\n  roslaunch second_project mapping.launch\n  ```\n\n  This will start Rviz with the visualization of the online mapping procedure.\n  In Rviz both the 2D laser scan and the 3D sliced as 2D are visible.\n  At the end of the mapping procedure, it is possible to save the map by:\n  ```bash\n  # Terminal 2:\n  rosrun map_saver map_saver\n  ```\n  In the folder where this is called, we save the mapped environment as .pgm and .yaml files. \n  For the project, we save the map created from both P2_first and P2_second recordings, with the map of 2D and 3D laser scan, those are available in /map_raw.\n  Then, the map used for navigation is denoised by hand, to avoid unexpected obstacles that affect navigation.  \n  \n- **Waypoint Navigation**:\n  \u003cbr/\u003eThe map used for navigation is selected in ``navigation.launch``, as the denoised map in /stage/nav_map.yaml.\n\n  As usual, start with the ``roscore``, then:\n  ```bash\n  # Terminal 1:\n  roslaunch second_project navigation.launch\n  ```\n  This will run both RViz for visualization (properly configured), and the stage simulator.\n  \u003cbr/\u003e``navigation`` node will also run, and the robot will move to the waypoints specified in ``waypoints.csv``.\n  You can define different meaningful waypoints or change some navigation parameters to see how navigation behavior changes. \n  \nFor further details on the task, refer to [second_project assignment](https://github.com/AlePuglisi/perception-localization-mapping-projects/blob/main/second_project.pdf). \u003cbr/\u003e\nWhile, for details on the ROS Navigation stack, you can refer to [LAB Slides](https://github.com/AlePuglisi/perception-localization-mapping-projects/blob/main/LAB_NAV.pdf)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falepuglisi%2Fperception-localization-mapping-projects","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falepuglisi%2Fperception-localization-mapping-projects","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falepuglisi%2Fperception-localization-mapping-projects/lists"}