MARSIM icon indicating copy to clipboard operation
MARSIM copied to clipboard

Port MARSIM to ROS 2

Open Jaeyoung-Lim opened this issue 1 month ago • 2 comments

Problem Descrption ROS 1 has reached its EOL in May 2025. Therefore, it would be great to have ROS 2 support for MARSIM.

Additionally, recent robotics implementations have been moving towards ROS 2 as well.

Solution This commit ports MARSIM to ROS 2.

Not all functionalities might be working for ROS 2. However, the ROS 2 implementation can be tested with the following launch file.

ros2 launch test_interface single_drone_mid360.launch.py

Fixes https://github.com/hku-mars/MARSIM/issues/13 https://github.com/hku-mars/MARSIM/issues/25

Additional Context

  • This implementation was done to test lidar inertial odometry with the PX4 Autopilot

Jaeyoung-Lim avatar Oct 23 '25 07:10 Jaeyoung-Lim

Pretty much thanks to Lim's large support for attaching MARSIM to ROS2!!!! I have created a branch ubuntu20_ros2 to maintain it. Since I do not have ROS2 environment now so the code is not tested locally yet, I will close this pull request until I test it.

jackykongfz avatar Oct 25 '25 16:10 jackykongfz

@jackykongfz Great, thanks. Glad to see that you find it useful.

Given the large differences in the implementation, I think it might be easier to maintain on a separate repo (e.g. MARSIM2). However, I leave the decision up to you.

Jaeyoung-Lim avatar Oct 25 '25 16:10 Jaeyoung-Lim

@Jaeyoung-Lim Thanks for your work on porting MARSIM to ROS2, this saved much of my time. But I still found some issues in your code. 1: The launch uses absolute path to find .pcd, so it can not run on other's computer; 2: The broken dependency makes compile error; 3: A default param makes cascadePID diverge; 4: The UAV model was not in rviz. So I made some small modification based on your code, and I will create a PR later to merge it to this repository.

xxl1998 avatar Nov 09 '25 11:11 xxl1998

@xxl1998 Thank you for pointing out the limitation of this PR. It would be great if you can make a PR against this PR such that we can keep track of the changes.

Jaeyoung-Lim avatar Nov 12 '25 01:11 Jaeyoung-Lim