Serial Communication problem - ROS
Hello,
I've written a serial communication program/driver for controlling a servo. Now I wanted to use it with ROS.
- First of all, I setup an empty c++ ROS package.
- Second I put the code inside and compiled it using ROS facilities. No ROS code yet, should basically spit out the same functionality, BUT DOES NOT!
The issue is that the serial communication doesn't work properly, for instance it can't read the right values at the serial port any more, it does strange things.
If I do compile my prog. using "g++ serial.cpp" and then run the executable everything works fine.
What does ROS do with my program different from the simple "g++ serial.cpp" command!
Thank you very much!
Greetings!
It should do roughly the same besides maybe linking ROS libraries that shouldn't interfere with your process. Check VERBOSE=1 make to see the exact commands.
Thank you very much for your reply. This is what I get: pastebin.com/rDxmUxxV
Maybe a start to see what's happening would be to fish out the compile and linker command (c++ .......), try them on your own and see if/what changes. The only ROS things I could image would be: Compile flags your code doesn't like or linked libraries that cause weird behavior.
A simple explanation might be that your code is just buggy and the release build (-O2) triggered the bugs. There seem to be a couple of serious warnings.
Thank you very much :)! I will try it!
also, if it's a ros package, shouldn't you use rosmake rather than make? I honestly don't know if that makes any difference, but I thought I'd thow it out there.
Thank you for your replies, it was a very weird error inside the code. It has nothing to do with ROS, though it was very strange.