PyCharm Setup - SemRoCo/giskardpy GitHub Wiki
Get PyCharm
I highly recommend PyCharm as IDE. As a student you can get an academic license for the professional version for free. Tested with v2023.1.
Setup PyCharm with a ROS workspace
- Source your workspace.
- Start PyCharm from the same terminal, otherwise it won't find ROS packages.
- When you first start PyCharm, don't create a new project, but open your existing workspace, e.g.,
~/giskardpy_ws. - In settings → project: → 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).
- If everything went right, you should be able to
import rospyin PyCharm's python console. - 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
- Mark your src folders as source root. You have to do this for all of the python packages in your workspace.
- Go into
Settings→Tools→Python Integrated Toolsand set testing topytest. - On the top right of the main PyCharm window, click on the run drop down menu, click
Edit Configurations…, on the bottom of the new window clickEdit configurationtemplates, go to Python Tests/pytest, add-sto Additional Arguments, to make PyCharm print console outputs while running tests