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

Overlay Octomap Library ROS Noetic

asked 2022-10-31 09:49:10 -0500

sasilva gravatar image

updated 2022-10-31 12:13:56 -0500

Hi, I am using ROS Noetic and I would like to use a modified version of the octomap library, I have already tried overlaying it as said here: https://answers.ros.org/question/5284...

However, it is not working for me, here I show my configuration:

CmakeLists.txt

cmake_minimum_required(VERSION 2.8.3)
project(esc_move_base_mapping)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

add_definitions(-std=c++11)

set(octomap_DIR /home/sasm/octomap/lib/cmake/octomap)
set(OCTOMAP_LIBRARY_DIRS /home/sasm/octomap/lib)
set(octomap_INCLUDE_DIRS /home/sasm/octomap/octomap/include/octomap)


find_package(catkin REQUIRED COMPONENTS
  geometry_msgs
  nav_msgs
  octomap_msgs
  octomap_ros
  roscpp
  rospy
  sensor_msgs
  std_msgs
  visualization_msgs
  laser_geometry
  pcl_ros
  pcl_conversions
  pedsim_msgs
)


find_package(octomap REQUIRED)
include_directories(BEFORE ${OCTOMAP_INCLUDE_DIRS})
link_directories(${OCTOMAP_LIBRARY_DIRS})
link_libraries(${PROJECT_NAME} ${OCTOMAP_LIBRARY_DIRS}/liboctomap.so ${OCTOMAP_LIBRARY_DIRS}/liboctomath.so)
MESSAGE(STATUS "OctoMap paths:" ${OCTOMAP_INCLUDE_DIRS} " " ${OCTOMAP_LIBRARY_DIRS})

find_package(PCL REQUIRED QUIET COMPONENTS common sample_consensus io segmentation filters)

catkin_package(
#  INCLUDE_DIRS include
  LIBRARIES ${PROJECT_NAME}
  CATKIN_DEPENDS ${PACKAGE_DEPENDENCIES} 
  # pedsim_msgs
  DEPENDS octomap PCL
)

include_directories(
  ${catkin_INCLUDE_DIRS}
  ${PCL_INCLUDE_DIRS}
)

add_executable(esc_move_base_mapper src/octomap_ls_pc.cpp)
target_link_libraries(esc_move_base_mapper ${catkin_LIBRARIES} ${Boost_LIBRARIES})

When I try to run catkin build I get the following error:

make[2]: *** No rule to make target '/opt/ros/noetic/lib/liboctomap.so', needed by '/home/sasm/ros/noetic/system/devel/.private/esc_move_base_mapping/lib/esc_move_base_mapping/esc_move_base_mapper'. Stop.

I thought I maybe had to uninstall octomap which I did as follows but with no sucess:

sudo dpkg --remove --force-depends ros-noetic-octomap
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-10-31 15:21:40 -0500

You probably also need to build from source anything that depends on octomap too. Ex. if you make a change to tf2, you also need to build everything that built against tf2 as well to use that version.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2022-10-31 09:49:10 -0500

Seen: 99 times

Last updated: Oct 31 '22