Skip to content

Setup (Pycharm)

Jason Wang edited this page Apr 11, 2022 · 31 revisions

Pycharm Professional

  • Get the Jetbrains student membership (https://www.jetbrains.com/student/)
  • Use Jetbrains installer (https://www.jetbrains.com/toolbox/app/) and install Pycharm Professional (or Pycharm Community if you don't have the license)
  • Change the theme to the white theme
  • Open Pycharm, go to File > Open and open the repository name (soccerbot)
  • Picking an interpreter
    • Use the System Intepretor
      • Go to Setting > Project Interpreter > Add > System Intepreter and choose /usr/bin/python3.8
      • Click on the gear > show all > Select python 3.8 > Show paths for the selected interpreter (5th button from the left) > Add the Intepreter Paths (Replace $USER with your computer user)
      /opt/ros/noetic/lib/python3/dist-packages
      /home/$USER/catkin_ws/devel/lib/python3/dist-packages
      /home/$USER/catkin_ws/src/soccerbot/external/webots/lib/controller/python38
    • Use the docker-compose Intepretor
      • Go to Setting > Project Interpreter > Add > Docker Compose
        • choose the docker-compose.yaml file
        • choose service as friendly
        • choose python interpreter path as /usr/bin/python3.8
      • Click on the gear > show all > Select python 3.8 > Show paths for the selected interpreter (5th button from the left) > Add the Intepreter Paths (Replace $USER with your computer user)
      /usr/lib/python3.8
      /usr/local/lib/python3.8/dist-packages
      /usr/lib/python3/dist-packages
      /opt/ros/noetic/lib/python3/dist-packages
      /root/catkin_ws/devel/lib/python3/dist-packages
      • Under path mappings, add the path mapping
      /home/$USER/catkin_ws -> /root/catkin_ws
      
  • In every ROS package that has a src folder with python files in it, right-click the src folder and Mark Directory As > Sources root
  • (Optional) Install the *.launch file plugins. Look up duckietown/hatchery from the third party repositories in Preferences/Plugins
  • Debugging
    • Run > Attach to Process > Select the Process you want to attach to, you might want to rosnode info to identify it's PID. Add a breakpoint