0
$\begingroup$

Rosanswers logo

Hi,

i want to implement roscpp to my C++ project to communicate to ROS via TCP. (microcontroller programmed in C++) Here is a little background:

Some time ago i used rosserial_client on my C++ project. To get rosserial_client source files (.h and .cpp) to my project what i did before was doing this in terminal on ROS indigo :

rosrun rosserial_client make_libraries

And it got me a nice folder named "ros_lib" containing everything i needed to port rosserial_client to my project. Worked out fine. (.h and .cpp files)

But now i want to use roscpp in my project, to use tcp communication with tcp sockets (i think i need to use transport.h). And i cannot figure out how to get roscpp and roscpp dependencies source files (.h and .cpp) to a single folder with everything working.

I tried to get roscpp from Github then doing a catkin_make on it, but could'nt find something useable after all.

How do i get ros_lib and roscpp source files (in a single folder, with everything working) to port to my C++ project? Thank you!


Originally posted by ogensyts on ROS Answers with karma: 3 on 2018-03-06

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Here are the complete source build instructions:

EDIT: To find the roscpp dependencies in your workspace, first source it, then run:

$ rosdep keys roscpp

For Kinetic, that shows:

rosgraph_msgs
rosconsole
roslang
catkin
xmlrpcpp
std_msgs
message_runtime
rostime
roscpp_serialization
roscpp_traits
message_generation
cpp_common
pkg-config

Originally posted by joq with karma: 25443 on 2018-03-06

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by ogensyts on 2018-03-06:
Thank you! Now, do you know which files i need to make tcp connection to my ROS Master? Is there a tutorial on how to use roscpp to connect to master via TCP?

Comment by joq on 2018-03-06:
I doubt there is such a tutorial. You should look at the code.

Comment by ogensyts on 2018-03-06:
Ok thank you!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.