PyCharm

I highly recommand PyCharm as IDE. As a student you get the professional version for free.

setup pycharm with existing ROS python package

  1. Start PyCharm from a terminal, where your workspace is sourced.
  2. When you first start PyCharm, open your whole ROS workspace.
  3. in settings → project: <folder you selected earlier> → project interpreter, you have to select the python version that is used by ROS. That should be Python 3.8 for ROS noetic (/usr/bin/python3.8).
  4. If everything went right, you should be able to import rospy in a console.
  5. If you have custom messages, like we have in giskardpy, you need to mark the dist-packages as source. Since this folder contains a giskardpy folder, you need to exclude it to avoid name conflicts
  6. Mark your src folders as source root. You have to do this for all of the python packages in your workspace.
  7. Go into Settings→Tools→Python Integrated Tools and set testing to pytest
  8. On the top right, click on the run dropbox, click Edit Configurations…, on the bottom of the new window click Edit configuration templates, go to Python Tests/pytest, add -s to Additional Arguments