ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Custom (Real) Vehicle interface advice Python vs C++

asked 2020-07-22 18:05:53 -0500

JoloGermanAg gravatar image

Hey guys,

I wrote a custom node that subscribes to the accel, brake and steer commands outputted by autoware and routes it to a custom PCB (via USB) that we designed which has manual and remote emergency stops and converts the digital signals to analog signals for the installed drive by wire system (old aevit system). Most code in autoware is written in C++ but i used python as it was just easier for me to do.

Question:

Is there any real benefit by using C++ in this case? I am aware it may be better with time sensitive data but since linux is already not a real-time system does it matter?

Thanks!

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
3

answered 2020-07-23 13:05:44 -0500

C++ is faster, certifiable (if you follow certification rules), and allows you to control memory allocations. Python is not suitable for a safety critical application that most robot / AV systems fall under, and without additional profiling could crash from a typo at runtime. If you’re working only in simulation you can do anything you’d like, but if it touches hardware, I highly recommend rewriting in C++

edit flag offensive delete link more

Comments

Thanks, that certainly makes sense. Since this is on a real vehicle I will switch to C++, probably will just use python for some initial debugging with the vehicle on jack stands since it's already up and running. Are there any resources that outline proper code procedure/flow for interface nodes in ROS/C++ ?

JoloGermanAg gravatar image JoloGermanAg  ( 2020-07-23 13:46:57 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2020-07-22 18:05:53 -0500

Seen: 164 times

Last updated: Jul 23 '20