Are serious things done with ROS in Python?

Everyone loves a good statistic, so I’ve put together a small python script that collects the major language used in each released ROS repository, as classified by GitHub. You can clearly see that C++ is the dominant language, but Python is also used a lot, including for “serious stuff”.

Some caveats in the statistics:

  • The list only shows the major language used in a repo (winner takes it all). Often, ROS repos contain both C++ and Python (or other) code, but C++ wins by LOC, so smaller languages are underrepresented in the list below.
  • I’m only counting repos, but the repos differ in size a lot. Some contain many packages with several 10,000 LOC, some are single-package repos with only a couple dozen LOC.

To answer the question, I wouldn’t say people “graduate” from Python to C++. Personally, I use both, depending on the task. My main criterion isn’t performance, but library support (although the two are linked). If you’re processing a lot of point clouds, you’re probably going to use things like PCL and Octomap, which means C++. For image processing, you’re probably going to use OpenCV, which has bindings both for C++ and Python. Most high-level executive frameworks (such as executive_smach or one of the behavior tree frameworks) are written in Python. And for small helper nodes, one-off scripts, or anything involving web sockets or REST APIs, I also prefer Python.

Here are the results:

Main languages in ROS repos by popularity

rank Language repos percent
1. C++ 350 55.0%
2. Python 158 24.8%
3. CMake 82 12.9%
4. C 15 2.4%
5. Common Lisp 8 1.3%
6. None 7 1.1%
7. Java 4 0.6%
8. EmberScript 3 0.5%
9. Shell 2 0.3%
10. HTML 2 0.3%
11. Arduino 1 0.2%
12. Emacs Lisp 1 0.2%
13. Lua 1 0.2%
14. Protocol Buffer 1 0.2%
15. C# 1 0.2%

Top 100 ROS repos by GitHub stars

rank repo name stars language
1. IntelRealSense/librealsense 1291 C++
2. ros/ros 697 Python
3. wjwwood/serial 520 C++
4. introlab/rtabmap 489 C++
5. OctoMap/octomap 382 C++
6. ros-planning/navigation 317 C++
7. ethz-asl/grid_map 281 C++
8. AutonomyLab/ardrone_autonomy 264 C
9. ros/ros_comm 239 Python
10. dartsim/dart 213 C++
11. introlab/find-object 210 C++
12. vrpn/vrpn 200 C
13. intel-ros/realsense 193 C++
14. robopeak/rplidar_ros 191 C++
15. ros-planning/moveit 173 C++
16. ros-visualization/rviz 170 C++
17. mavlink/mavros 169 C++
18. introlab/rtabmap_ros 162 C++
19. ros-drivers/rosserial 162 C++
20. cra-ros-pkg/robot_localization 160 C++
21. ros/ros_tutorials 144 C++
22. RobotWebTools/rosbridge_suite 139 Python
23. leggedrobotics/darknet_ros 132 C++
24. ros/catkin 129 Python
25. ros-drivers/velodyne 128 C++
26. ros-perception/slam_gmapping 127 C++
27. ccny-ros-pkg/imu_tools 125 C++
28. ros-industrial/universal_robot 125 Python
29. orocos/orocos_kinematics_dynamics 122 C++
30. ros-simulation/gazebo_ros_pkgs 119 C++
31. ros-controls/ros_control 111 C++
32. rosjava/rosjava_core 108 Java
33. ros-perception/image_pipeline 108 C++
34. turtlebot/turtlebot 102 C++
35. facontidavide/PlotJuggler 102 C++
36. ROBOTIS-GIT/turtlebot3 100 Python
37. ROBOTIS-GIT/DynamixelSDK 93 C#
38. rst-tu-dortmund/teb_local_planner 90 C++
39. ros-perception/vision_opencv 84 C++
40. turtlebot/turtlebot_apps 78 C++
41. yujinrobot/kobuki 75 C++
42. ros-controls/ros_controllers 72 C++
43. ankitdhall/lidar_camera_calibration 71 C++
44. ipa320/cob_driver 68 C++
45. PickNikRobotics/rviz_visual_tools 67 C++
46. swri-robotics/mapviz 66 C++
47. ros-drivers/usb_cam 65 C++
48. plasmodic/ecto 64 C++
49. AutonomyLab/bebop_autonomy 63 C++
50. wg-perception/people 61 C++
51. ros/geometry 59 C++
52. ipa320/cob_common 59 Python
53. AndreaCensi/csm 57 C
54. ros-perception/perception_pcl 57 C++
55. ipa320/cob_simulation 57 Python
56. Intermodalics/tango_ros 56 C++
57. clearpathrobotics/robot_upstart 53 Python
58. jsk-ros-pkg/jsk_recognition 52 C++
59. ipa320/cob_extern 52 C
60. intel/ros_intel_movidius_ncs 50 C++
61. lagadic/vision_visp 49 C++
62. AutonomyLab/create_autonomy 49 C++
63. RobotWebTools/web_video_server 48 C++
64. fkie/multimaster_fkie 46 Python
65. skasperski/navigation_2d 45 C++
66. ccny-ros-pkg/scan_tools 44 C++
67. stdr-simulator-ros-pkg/stdr_simulator 44 C++
68. ros-industrial/industrial_core 43 C++
69. ros-planning/navigation_tutorials 43 C++
70. ipa320/cob_robots 43 Python
71. ros-drivers/pointgrey_camera_driver 43 C++
72. orocos-toolchain/log4cpp 42 C++
73. ros-perception/openslam_gmapping 42 C++
74. yujinrobot/yujin_ocs 41 C++
75. ros-industrial/ros_canopen 41 C++
76. ros-industrial/abb 40 C++
77. paulbovbel/frontier_exploration 40 C++
78. ros/geometry2 38 C++
79. ros/executive_smach 38 Python
80. ros-industrial/kuka_experimental 37 C++
81. ipa320/schunk_modular_robotics 36 C++
82. OctoMap/octomap_mapping 36 C++
83. arebgun/dynamixel_motor 35 Python
84. youbot/youbot_driver 35 C++
85. beltransen/velo2cam_calibration 34 C++
86. ros/common_msgs 34 C++
87. davetcoleman/ros_control_boilerplate 34 C++
88. hasauino/rrt_exploration 33 C++
89. ros/actionlib 33 C++
90. ros-visualization/visualization_tutorials 32 C++
91. ros-drivers/joystick_drivers 32 Python
92. magazino/move_base_flex 32 C++
93. turtlebot/turtlebot_simulator 32 EmberScript
94. cbandera/rosparam_handler 31 Python
95. ros-naoqi/nao_robot 30 Python
96. ipa320/cob_command_tools 30 Python
97. mrpt-ros-pkg/mrpt_navigation 30 C++
98. ethz-asl/rqt_multiplot_plugin 30 C++
99. wg-perception/object_recognition_core 30 C++
100. orocos/rtt_ros_integration 30 C++
7 Likes