Can I replace the AMCL node in the navigation2 stack with my own node written in python
I'd like to replace the AMCL node for localization found in the navigation2 stack with something like an EKF or UKF. Is it possible to do so using python considering how the rest of the package is written in C++ Are there any tutorials/guides to teach me how to do so?
Yes, the navigation2 stack is a group of packages that contain all building blocks of navigation. Localization is just one of those blocks. Currently only 2D laser localization using AMCL is implemented in that localization block. However you can solve that localization part running any other ros 2 node on your side. The other navigation blocks (controller, planning, etc) should work as expected. It is more a task of getting your environment ready.
Of course, it is possible using Python, in ROS (1 and 2) you can run one node in python for example and others in C++ or Rust or Javascript. They would perfectly communicate to each other.
In my opinon, one good way to do what you aim, could be to start testing the navigation 2 as it is, then test the robot_localization package as it is, once you understand how they work you are able to try ...(more)
What @iggyrrieta says is correct. But this is not a beginner-level effort if this is your first project with ros. You first need to have an understanding of publish/subscribe, the Transform Frame tree, the map server and how odometry is used.
Also, a ros node that implements an EKF already exists, and the package is called
robot_localization
. It would be a good idea to at least read the documentation before re-inventng the wheel.