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

Serial Communication problem - ROS

asked 2013-09-09 00:16:29 -0500

Ros451 gravatar image

updated 2013-09-09 00:18:31 -0500

Hello,

I've written a serial communication program/driver for controlling a servo. Now I wanted to use it with ROS.

  1. First of all, I setup an empty c++ ROS package.
  2. 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!

edit retag flag offensive close merge delete

Comments

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.

dornhege gravatar image dornhege  ( 2013-09-09 00:44:22 -0500 )edit

Thank you very much for your reply. This is what I get: pastebin.com/rDxmUxxV

Ros451 gravatar image Ros451  ( 2013-09-09 01:39:16 -0500 )edit

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.

dornhege gravatar image dornhege  ( 2013-09-09 01:48:47 -0500 )edit
1

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.

dornhege gravatar image dornhege  ( 2013-09-09 01:49:20 -0500 )edit

Thank you very much :)! I will try it!

Ros451 gravatar image Ros451  ( 2013-09-09 02:16:39 -0500 )edit

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.

Dereck gravatar image Dereck  ( 2013-09-09 04:00:19 -0500 )edit

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.

Ros451 gravatar image Ros451  ( 2013-09-09 05:41:51 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2013-09-09 05:47:46 -0500

Ros451 gravatar image

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.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2013-09-09 00:16:29 -0500

Seen: 255 times

Last updated: Sep 09 '13