[ros-users] C++ versus Python in ROS

Ruben Smits ruben.smits at mech.kuleuven.be
Mon Jul 19 21:09:13 UTC 2010


On Monday 19 July 2010 19:56:17 Stuart Glaser wrote:
> Hi Sam,
> 
> Here are some thoughts:
> > 1- What justifies using Python in ROS?
> 
> Same reasons for selecting Python or C++ in any other situation.  In
> general, Python can be faster for getting something working, but C++
> is necessary for heavy lifting.  Whenever possible I use Python, but
> if the problem requires more speed than Python can provide I switch to
> C++.
> 
> Python is an excellent language.  Go learn it.
> 
> > 2- Are the majority of tutorials in Python or C++?
> 
> It's mixed.  Many tutorials are in both languages.
> 
> > 3- I notice that if one wants to use an IDE, Eclipse and Code:Blocks are
> > suggested in the ROS wiki along with how to create an ROS package in
> > Code:Blocks......but I see nothing like this for Python......what is a
> > suggested IDE for Python?
> 
> I assume both Eclipse and Code:Blocks work for Python too.
> 
> > 4- Looking towards future robot-building tools integration, does Python
> > support possibilities of using ROS+Orocos+OpenCV+Gazebo......C++ can be
> > used with Orocos, but can Python?
> 
> The Orocos folks would know about using Python and Orocos together.

Orocos RTT is all c++ but,

* with the orocos rtt corba plugin and python-omniorb we have been able to 
connect Orocos components with  python scripts (mainly used to connect with 
Blender)

* with the orocos ros integration work you will be able to connect to an 
orocos component as you could to any other ros node, both in C++ and python


Ruben

> > 5- I know C++ can be used for real-time action due to its speed, but can
> > Python?
> 
> Python cannot be used for hard realtime applications.  Your thread may
> lock up because of garbage collection or the GIL or plenty of other
> reasons.  We do sometimes use it for soft realtime processes; it can
> be semi-reliable up to 30 Hz or so.
> 
> -Stu
> 
> > Thanks.
> > 
> > SamQ
> > 
> > ________________________________
> > The New Busy think 9 to 5 is a cute idea. Combine multiple calendars with
> > Hotmail. Get busy.
> > _______________________________________________
> > ros-users mailing list
> > ros-users at code.ros.org
> > https://code.ros.org/mailman/listinfo/ros-users



More information about the ros-users mailing list