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

ROS as a stand-alone library?

asked 2021-02-03 04:46:14 -0600

I wonder if ROS can be used as a stand-alone library, such as libros.a? Suppose that I have a piece of code "code_depedent_on_ros.c" that depends on ROS, it would be convenient to compile the code as gcc code_depedent_on_ros.c -l ros. Does such a libros.a or libros.so exist?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2021-02-04 10:07:31 -0600

jdlangs gravatar image

No, there's no such thing as libros, because ROS is a whole framework of many different libraries and tools. Even a simple C/C++ program that does something basic like publishing a topic will end up have build and runtime dependencies on several different libraries provided by several different ROS packages. That's why the ROS community generally always uses extra tooling (colcon, rosdep, etc) to build and install large collections of packages instead of individual libraries.

edit flag offensive delete link more

Comments

1

Technically there wouldn't really be anything stopping one from creating a libros.so, which would link "all" .sos from "all" packages.

But that wouldn't be very efficient, so is never really done.

@Zhoulai Fu: perhaps you could explain what it is you're trying to achieve. That may help us give you better answers and/or suggest some alternative.

gvdhoorn gravatar image gvdhoorn  ( 2021-02-04 12:14:28 -0600 )edit

Question Tools

3 followers

Stats

Asked: 2021-02-03 04:46:14 -0600

Seen: 244 times

Last updated: Feb 04 '21