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

BenQ1110's profile - activity

2023-03-23 12:57:52 -0500 received badge  Student (source)
2023-03-23 12:57:49 -0500 received badge  Self-Learner (source)
2023-03-23 12:57:49 -0500 received badge  Teacher (source)
2023-03-14 10:16:06 -0500 received badge  Famous Question (source)
2023-03-14 10:16:06 -0500 received badge  Notable Question (source)
2021-08-21 21:00:31 -0500 received badge  Popular Question (source)
2021-08-21 19:17:15 -0500 edited answer ROS Noetic Issue with linking with LibTorch and class_loader

I have found a solution, and it is directly torch related. When using gcc>=5.1 (as in Ubuntu 20.4/ROS Noetic), you h

2021-08-21 19:17:02 -0500 edited answer ROS Noetic Issue with linking with LibTorch and class_loader

I have found a solution/reason, and it is directly torch related. When using gcc>=5.1 (as in Ubuntu 20.4/ROS Noetic)

2021-08-21 19:16:40 -0500 edited question ROS Noetic Issue with linking with LibTorch and class_loader

ROS Noetic Issue with linking with LibTorch and class_loader Hi, I created a simple nodelet which was functioning correc

2021-08-21 19:16:33 -0500 edited question ROS Noetic Issue with linking with LibTorch and class_loader

ROS Noetric Issues with linking with class_loader Hi, I created a simple nodelet which was functioning correctly in ROS

2021-08-21 00:58:48 -0500 marked best answer ROS Noetic Issue with linking with LibTorch and class_loader

Hi, I created a simple nodelet which was functioning correctly in ROS Melodic. However, when I moved to ROS Noetic I have encountered the following issue when running a launch file:

 /opt/ros/noetic/lib/nodelet/nodelet: symbol lookup error: /home/benksy/catkin_ws/devel/lib/libnodelet_plugins.so: undefined symbol: _ZN12class_loader4impl30getCurrentlyLoadingLibraryNameEv".

It corresponds to class_loader::impl::getCurrentlyLoadingLibraryName().

I attempted solutions from here https://answers.ros.org/question/2919... but with no success.

I presume there is a quick solution but I am not that familiar with CMake/C++ so any help appreciated.

Update 1:

I have noticed that the error pops up when I try to link Torch/LibTorch library to my nodelet. When target_link_libraries does not include ${TORCH_LIBRARIES}, the error does not show up.

Here is an example of CMakeLists.txt file:

cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
project(random_pkg)

list(APPEND CMAKE_PREFIX_PATH "/home/benksy/libtorch")

find_package(catkin REQUIRED COMPONENTS
  nodelet
  roscpp
  rospy
  roslib
 )

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")

## Setup include directories
include_directories(${catkin_INCLUDE_DIRS})


catkin_package(
#  INCLUDE_DIRS include
#   LIBRARIES nodelet_test_plugins
#   CATKIN_DEPENDS
#    lidar_msgs
#    roscpp
#    rospy
#    std_msgs
#  DEPENDS system_lib
)

## Create the nodelet tutorial library
add_library(nodelet_test_plugins
            src/test.cpp
            src/test.h
           )

find_package(Torch REQUIRED)
target_link_libraries(nodelet_test_plugins ${catkin_LIBRARIES} ${PROJECT_LIBRARIES} ${TORCH_LIBRARIES})

if(catkin_EXPORTED_LIBRARIES)
  add_dependencies(nodelet_test_plugins ${catkin_EXPORTED_LIBRARIES})
endif()

## Mark the nodelet library for installations
install(TARGETS nodelet_test_plugins
  ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
  LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
  RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION})

install(FILES nodelet_test_plugins.xml mynodelet.launch
  DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})

All other files are empty/dummy.

test.cpp:

#include <pluginlib/class_list_macros.h>
#include "test.h"

PLUGINLIB_EXPORT_CLASS(random_pkg::Test, nodelet::Nodelet)

namespace random_pkg
{
  void Test::onInit()
  {}
}

test.h

#include "ros/ros.h"
#include <nodelet/nodelet.h>

namespace random_pkg
{
  class Test : public nodelet::Nodelet
  {
    public:
      Test(){}
    private:
      virtual void onInit();
    };
}

nodelet_test_plugins.xml

<library path="libnodelet_test_plugins">
  <class name="random_pkg/Test" type="random_pkg::Test" base_class_type="nodelet::Nodelet">
    <description>
      Write things here.
    </description>
  </class>

</library>

random.launch (When this file is launched the above error shows up)

<launch>

  <node pkg="nodelet" type="nodelet" name="standalone_nodelet"  args="manager" output="screen"/>

  <node pkg="nodelet" type="nodelet" name="Test" args="load random_pkg/Test standalone_nodelet" output="screen">
  </node>

</launch>

Other info: ROS Noetic/Ubuntu 20.04, gcc 9.3.0, LibTorch 1.9.0 (tried both CPU and GPU Cuda 11.1)

Thanks!

2021-08-20 17:47:38 -0500 edited answer ROS Noetic Issue with linking with LibTorch and class_loader

[Preliminary] It seems that I have found a solution/reason, and it is directly torch related. When using gcc>=5.1 (a

2021-08-20 17:47:11 -0500 edited answer ROS Noetic Issue with linking with LibTorch and class_loader

[Preliminary] It seems that I have found a solution/reason, and it is directly torch related. When using gcc>=5.1 (a

2021-08-20 17:46:32 -0500 answered a question ROS Noetic Issue with linking with LibTorch and class_loader

[Preliminary] It seems that I have found a solution/reason, and it is directly torch related. If using gcc>=5.1, you

2021-08-20 17:46:32 -0500 received badge  Rapid Responder (source)
2021-08-20 16:43:21 -0500 edited question ROS Noetic Issue with linking with LibTorch and class_loader

ROS Noetric Issues with linking with class_loader Hi, I created a simple nodelet which was functioning correctly in ROS

2021-08-20 16:41:54 -0500 received badge  Organizer (source)
2021-08-20 16:01:34 -0500 edited question ROS Noetic Issue with linking with LibTorch and class_loader

ROS Noetric Issues with linking with class_loader Hi, I created a simple nodelet which was functioning correctly in ROS

2021-08-20 16:01:34 -0500 received badge  Editor (source)
2021-08-20 16:00:50 -0500 commented question ROS Noetic Issue with linking with LibTorch and class_loader

I updated the post. Thanks for help!

2021-08-20 16:00:35 -0500 edited question ROS Noetic Issue with linking with LibTorch and class_loader

ROS Noetric Issues with linking with class_loader Hi, I created a simple nodelet which was functioning correctly in ROS

2021-08-20 13:51:47 -0500 asked a question ROS Noetic Linking issues with class_loader

ROS Noetic Linking issues with class_loader Hi, I created a simple nodelet which was functioning correctly in ROS Melodi

2021-08-20 13:50:16 -0500 asked a question ROS Noetic Issue with linking with LibTorch and class_loader

ROS Noetric Issues with linking with class_loader Hi, I created a simple nodelet which was functioning correctly in ROS

2020-09-10 19:43:30 -0500 received badge  Famous Question (source)
2020-03-27 22:03:01 -0500 received badge  Notable Question (source)
2019-12-02 12:43:50 -0500 marked best answer Map Display: Use different frame then /map

Hi,

I might have a very simple question but haven't found the solution yet. I am using Map display to visualize the Occupancy Grid type of message. Occupancy grid's frame should be centered at the vehicle (in-vehicle local frame e.g. like in an AV's occupancy grid visualizations).

However, in my stack, someone is already using /map frame to define the global frame of the world map, i.e. it doesn't translate with the vehicle.

Question is how can I change the frame used in Map display in rviz so I could use some newly defined frame, e.g. /local_vehicle_tf, rather than /map? Should I just define my new type of display in rviz? That seems to be overkill just to change the frame.

It's kind of a simple question but I haven't figured it out.

Thanks

2019-12-02 12:43:29 -0500 commented answer Map Display: Use different frame then /map

Thanks! That solves it.

2019-12-02 12:43:27 -0500 received badge  Popular Question (source)
2019-12-02 12:32:28 -0500 received badge  Supporter (source)
2019-11-22 00:47:06 -0500 received badge  Enthusiast
2019-11-12 10:09:03 -0500 asked a question Map Display: Use different frame then /map

Map Display: Use different frame then /map Hi, I might have a very simple question but haven't found the solution yet.