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

Is there a C client demo program for comunicating with ROS server?

asked 2012-01-31 04:48:12 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

Dear All. Is there a C client program that can make me send and receive information from ROS server? What I need it is that I want to use C program to develop some program and use it as a client of ROS server. Best regards. Zhenli zhenli.lu@ua.pt

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
3

answered 2012-01-31 10:37:51 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

Try this tutorial:

Writing a Simple Publisher and Subscriber (C++))

It goes over writing a pair of minimal c++ programs that send each other a message using the ROS interface

edit flag offensive delete link more
-1

answered 2012-01-31 21:14:47 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

Thank you very much for your email. That is a good way for c++ program. Since we have some work is done in C program and makefile, we want a minimal Publisher and Subscriber in C language, thus I can intergate it into my software package, otherwise, I must rewrite my program from C+makefile to C++ + cmakelists.txt. Best regards. Zhenli

edit flag offensive delete link more

Comments

Since C++ is a superset of C (well, for most practical purposes anyway), you should be able to wrap your existing code in ROS relatively easily. There is no simpler API for ROS, and use of the ROS build mechanism is highly recommended.
ahendrix gravatar image ahendrix  ( 2012-02-01 13:18:07 -0500 )edit
If you have existing C code that you want to reuse, you might consider packaging it as a library and then calling that library from a ROS node written in C++
ahendrix gravatar image ahendrix  ( 2012-02-01 13:20:16 -0500 )edit

Question Tools

Stats

Asked: 2012-01-31 04:48:12 -0500

Seen: 572 times

Last updated: Jan 31 '12