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

OMC's profile - activity

2022-02-21 14:31:59 -0500 received badge  Good Question (source)
2021-01-29 16:29:00 -0500 received badge  Nice Question (source)
2019-09-08 16:39:11 -0500 received badge  Famous Question (source)
2019-02-13 05:46:01 -0500 received badge  Famous Question (source)
2018-12-03 08:23:33 -0500 received badge  Famous Question (source)
2018-11-15 17:19:43 -0500 received badge  Famous Question (source)
2018-08-17 20:28:46 -0500 received badge  Famous Question (source)
2018-06-27 01:45:30 -0500 received badge  Popular Question (source)
2018-06-27 01:45:30 -0500 received badge  Notable Question (source)
2018-04-12 13:56:51 -0500 marked best answer Add a shared library to a catkin package

Hello,

I have compiled a third-party library from a non-catkin package and I would like to use this library in my project. I have already seen how to link a library against an executable as explained here and here, but there is still something I do not quite understand. As far as I know, in order to use the shared library in my nodes, I need the header files, so I can "#include" them in my .cpp file. But none of the mentioned sources seem to take care of that.

Should I add all the headers to the include_directories() macro in the CMakeLists?

i.e: The library I intend to use is libLanelet, so I compiled it using SCons and I obtained the library libLanelet.so. I copied this library into "package_path/libs". In my CMakeLists I have

target_link_libraries(node ${catkin_LIBRARIES} ${PROJECT_SOURCE_DIR}/libs/libLanelet.so)

Should I copy all .hpp files inside, say, "package_path/include" and then in the CMakeLists add

include_directories(${PROJECT_SOURCE_DIR}/include) ?

In case this is right is this the proper way to do it?

I have just started to "get my hands dirty" writing ROS code and I recently started learning C++, so many concepts are still unclear to me.

Regards

2018-04-12 13:56:48 -0500 received badge  Student (source)
2018-03-15 19:51:47 -0500 received badge  Notable Question (source)
2018-01-28 04:04:20 -0500 received badge  Notable Question (source)
2018-01-23 03:26:03 -0500 received badge  Notable Question (source)
2017-11-29 17:15:02 -0500 received badge  Popular Question (source)
2017-10-05 09:56:26 -0500 received badge  Popular Question (source)
2017-10-04 11:32:22 -0500 received badge  Taxonomist
2017-08-05 05:08:49 -0500 received badge  Popular Question (source)
2017-07-24 08:55:20 -0500 asked a question Correct simulator setup for fake_localization

Correct simulator setup for fake_localization Hello, I am using V-REP to simulate my robot and I wanted to use the fak

2017-07-12 04:43:24 -0500 commented answer Setting up Dynamic Reconfigure for several nodes?

If I have understood how cached parameters work, when I use getParamCached(), I will get it from the master instead of t

2017-07-11 04:45:36 -0500 asked a question Setting up Dynamic Reconfigure for several nodes?

Setting up Dynamic Reconfigure for several nodes? I wanted to have a node that worked as a Dynamic Reconfigure server fo

2017-07-08 16:11:11 -0500 received badge  Notable Question (source)
2017-07-08 11:46:27 -0500 asked a question Difference between search and sampling based motion planning

Difference between search and sampling based motion planning Hello, I do not quite get the difference between search an

2017-04-02 13:52:46 -0500 received badge  Teacher (source)
2017-03-31 14:35:59 -0500 answered a question Why autocomplete not always working

It sometimes happens to me as well, even if I correctly source the devel/setup.*sh. If I first manually enter the package I have just created, then autocomplete works.

Some other times autocomplete throws an error like in Permission denied: .gvfs . It seems that you are using a virtual machine and the .gvfs is a virtual file extension, maybe it's related.

2017-03-20 05:19:41 -0500 received badge  Popular Question (source)
2017-03-09 04:45:49 -0500 received badge  Notable Question (source)
2017-03-09 04:45:49 -0500 received badge  Famous Question (source)
2017-03-09 04:35:04 -0500 asked a question Find non-ROS package in rosbuild CMakeLists

Hello,

I was trying to run the art_vehicle stack from the UTexas, so I installed ROS Fuerte over Ubuntu 12.04 in a Virtual Machine. I got a run-time error when trying to launch the simulator, I think it was because the art_vehicle stack was designed to be used with Stage 3 and I was using Stage 4 (which has some minor changes in format). I tried to migrate the models format to the new version, but I still got some errors I couldn't fix, so I thought it would be easier to simply work with Stage 3 (I was mistaken about it, see edit below).

As you can only install Stage 4 from repositories, I had to install Stage-3.2.1 from source.

Now I have to tell the simulator_art package to be aware of the Stage libraries I have manually installed when linking the executable inside the CMakeLists.

I have tried two things so far:

1) Using pkg-config to find an external dependency:

Something like

cmake_minimum_required(VERSION 2.4.6)
include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)
rosbuild_init()

include($ENV{ROS_ROOT}/core/rosbuild/FindPkgConfig.cmake)
pkg_check_modules(STAGE REQUIRED Stage-3.2)

include_directories(${STAGE_INCLUDE_DIRS})
link_directories(${STAGE_LIBRARY_DIRS})


rosbuild_add_executable(artstage src/artstage.cc src/vehicle_model.cc)
rosbuild_add_executable(obstacles src/obstacles.cc)

but the compiler still complains that it lacks the file "stage.hh".

2) Have a .cmake module that searches for the library and have CMakeLists call it:

Now my CMakeLists looks like:

cmake_minimum_required(VERSION 2.4.6)
include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)
rosbuild_init()

list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/Modules)
find_package(Stage 3 REQUIRED)

rosbuild_add_executable(artstage src/artstage.cc src/vehicle_model.cc)
rosbuild_add_executable(obstacles src/obstacles.cc)

and inside simulator_art/cmake/Modules I have this .cmake file:

include_directories(
${STAGE_INCLUDE_DIRS}
)

find_path(STAGE_INCLUDE_DIR
    NAMES Stage-3.2/stage.hh
    PATHS /usr/local/include
)

find_library(STAGE_LIBRARY
    NAMES libstage.so
    PATHS /usr/local/lib
)

if(STAGE_INCLUDE_DIR)
    set(STAGE_INCLUDE_DIRS ${STAGE_INCLUDE_DIR})
    message(${STAGE_INCLUDE_DIR})
endif()

if(STAGE_LIBRARY)
    set(STAGE_LIBRARIES ${STAGE_LIBRARY})
    message(${STAGE_LIBRARY})
endif()

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(STAGE DEFAULT_MSG
    STAGE_LIBRARY
    STAGE_INCLUDE_DIR
)

mark_as_advanced(
    STAGE_INCLUDE_DIR
    STAGE_LIBRARY
)

if(NOT STAGE_FOUND)
    message(FATAL_ERROR "Stage not found.")
endif()

But the compiler still can't find "stage.hh". I must be missing something in the CMakeLists.

Any help is appreciated.

Regards.

--------------------------------------------------------------------

EDIT:

OK, I have just seen in the code of the simulator_art that it is actually using Stage 4 in Fuerte, so the origin of the errors I saw must be somewhere else. I still want to understand the cmake problem, so the question remains. I found out that if I hard-code the include path, i.e:

include_directories(
    /usr/local/include/Stage-3.2
)

the library does get loaded, so I printed STAGE_INCLUDE_DIRS and it only showed "/usr/local/include/", that's why it didn't get loaded... any explanation?

2017-02-24 09:10:51 -0500 commented answer Publishing to a topic via subscriber callback function

Would it make sense to make n_, pub_, and sub_ static in case we expect several objects to be created? I have tried but I am unable to initialize them inside the constructor in the .cpp (the class definition is in a header).

2017-02-17 11:59:51 -0500 asked a question Difference between "_generate_messages_cpp" and "_exported_targets"

Hello,

I am gathering all my messages in a single package (named, say, "my_msgs") to simplify package dependencies, (a well-known ROS good practice).

I realised that some packages add dependencies to my_msgs package using the line

add_dependencies(target my_msgs_generate_messages_cpp)

in the CMakeLists.txt, while others use

add_dependencies(target ${catkin_EXPORTED_TARGETS})

which is how the documentation indicates this should be done. I haven't found much relevant information about the "_generate_messages_cpp" variable, so I wanted to know: is there any difference? Is the second method preferred over the first one?

2017-01-16 09:30:00 -0500 commented answer What is the purpose of CATKIN_DEPENDS?

It definitely should be in the CMakeLists wiki. This answer is a wiki itself. Thanks a lot!

2016-12-18 21:26:15 -0500 received badge  Famous Question (source)
2016-12-15 13:51:47 -0500 received badge  Popular Question (source)
2016-12-15 05:16:05 -0500 asked a question Angular velocity to steering angle conversion

I am following the tutorial to use the teb local planner with car-like robots. The function convert_trans_rot_vel_to_steering_angle(v, omega, wheelbase) considers that the linear velocity is taken at the center of the rear track, which is not exactly the same as at the center of mass (at the center of mass the radius is a bit greater, therefore the linear velocity must be a bit greater as well).

I assume the planner gives velocity commands for the center of mass of the vehicle, so, is this conversion a deliberate approximation? If so, the exact approach would be:

radius= v/omega //at the C.M.
return wheelbase/(std::sqrt(radius*radius-wheelbase*wheelbase/4))

This last line can be proven defining r = sqrt(radius*radius-(wheelbase/2)*(wheelbase/2)) - track/2 and steering_angle = atan(wheelbase /(r+track/2)).

Regards

2016-11-11 01:16:34 -0500 received badge  Popular Question (source)
2016-10-26 09:41:51 -0500 answered a question How to install Indiago ROS in Ubuntu14.04.4 (trusty LTS)?

Are you sure you are running Ubuntu 14.04.4? I recently tried to install ROS on 14.04.5 and got some similar errors to yours. I had to go back to 14.04.4 and everything went fine.

2016-10-24 09:22:33 -0500 asked a question DWA vs SBPL lattice planner for local planning?

Hello,

I intend to perform autonomous navigation on an ackermann-like robot (a car, actually). Assuming the global planner will give a path to follow by providing a list of waypoints to be reached, I want the local planner to drive the car along those intermediate points.

I have found that there exists a Dynamic Window Approach (DWA) local planner that takes into account the dynamic constraints of the robot to calculate a feasible local path. Modifying this planner to satisfy the dynamic constraints of an ackermann model seems a possible solution. In fact, this is the solution that has been adopted in some similar projects.

But I was thinking that it is very similar to what the SBPL lattice planner does: it takes into account the model of the robot and it creates a lattice with the possible states that can be reached. Nevertheless, the SBPL lattice planner is generally only used for global planning. I read this paper in which SBPL was used for both local and global planning.

My question is, what are the advantages of using DWA over SBPL as the local planner? I think that the biggest advantage is that DWA calculates the next velocity command for a given period of time.

Any additional suggestions are welcome.

Regards.

2016-10-20 11:58:00 -0500 received badge  Notable Question (source)