ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A answers.ros.org
Ask Your Question
0

error compiling node

asked 2021-04-22 15:47:10 -0500

Eman.m gravatar image

updated 2021-04-22 19:51:58 -0500

Hi

I am using ubuntu 16.04 and ros kinetic

I created a package for a subscriber node(start_goal_generator.cpp), this node must get the published topic "map" from map_server node

i tried to build the workspace with catkin_make, the output is:

Base path: /home/evadro/Desktop/Eman/ros_workspace
Source space: /home/evadro/Desktop/Eman/ros_workspace/src
Build space: /home/evadro/Desktop/Eman/ros_workspace/build
Devel space: /home/evadro/Desktop/Eman/ros_workspace/devel
Install space: /home/evadro/Desktop/Eman/ros_workspace/install
####
#### Running command: "make cmake_check_build_system" in "/home/evadro/Desktop/Eman/ros_workspace/build"
####
-- Using CATKIN_DEVEL_PREFIX: /home/evadro/Desktop/Eman/ros_workspace/devel
-- Using CMAKE_PREFIX_PATH: /home/evadro/Desktop/Eman/ros_workspace/devel;/home/evadro/catkin_ws/devel;/opt/ros/kinetic
-- This workspace overlays: /home/evadro/Desktop/Eman/ros_workspace/devel;/home/evadro/catkin_ws/devel;/opt/ros/kinetic
-- Found PythonInterp: /usr/bin/python2 (found suitable version "2.7.12", minimum required is "2") 
-- Using PYTHON_EXECUTABLE: /usr/bin/python2
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/evadro/Desktop/Eman/ros_workspace/build/test_results
-- Found gtest sources under '/usr/src/gmock': gtests will be built
-- Found gmock sources under '/usr/src/gmock': gmock will be built
-- Found PythonInterp: /usr/bin/python2 (found version "2.7.12") 
-- Using Python nosetests: /usr/bin/nosetests-2.7
-- catkin 0.7.29
-- BUILD_SHARED_LIBS is on
-- BUILD_SHARED_LIBS is on
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~  traversing 6 packages in topological order:
-- ~~  - rosbot_ekf
-- ~~  - start_goal_generator
-- ~~  - rplidar_ros
-- ~~  - rosbot_navigation
-- ~~  - rosbot_description
-- ~~  - rosbot_gazebo
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin package: 'rosbot_ekf'
-- ==> add_subdirectory(rosbot_ekf)
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
-- rosbot_ekf: 1 messages, 1 services
-- +++ processing catkin package: 'start_goal_generator'
-- ==> add_subdirectory(start_goal_generator)
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
-- +++ processing catkin package: 'rplidar_ros'
-- ==> add_subdirectory(rplidar_ros)
-- +++ processing catkin package: 'rosbot_navigation'
-- ==> add_subdirectory(rosbot_description/src/rosbot_navigation)
-- +++ processing catkin package: 'rosbot_description'
-- ==> add_subdirectory(rosbot_description/src/rosbot_description)
-- +++ processing catkin package: 'rosbot_gazebo'
-- ==> add_subdirectory(rosbot_description/src/rosbot_gazebo)
-- Configuring done
-- Generating done
-- Build files have been written to: /home/evadro/Desktop/Eman/ros_workspace/build
####
#### Running command: "make -j24 -l24" in "/home/evadro/Desktop/Eman/ros_workspace/build"
####
[  0%] Built target actionlib_generate_messages_nodejs
[  0%] Built target geometry_msgs_generate_messages_py
[  0%] Built target tf2_msgs_generate_messages_lisp
[  0%] Built target tf2_msgs_generate_messages_nodejs
[  0%] Built target std_msgs_generate_messages_py
[  0%] Built target geometry_msgs_generate_messages_nodejs
[  0%] Built target std_msgs_generate_messages_nodejs
[  0%] Built target geometry_msgs_generate_messages_lisp
[  0%] Built target tf2_msgs_generate_messages_eus
[  0%] Built target roscpp_generate_messages_lisp
[  0%] Built target std_msgs_generate_messages_lisp
[  0%] Built target std_msgs_generate_messages_eus
[  0%] Built target _catkin_empty_exported_target
[  0%] Built target nav_msgs_generate_messages_cpp
[  0%] Built target nav_msgs_generate_messages_eus
[  0%] Built target roscpp_generate_messages_nodejs
[  0%] Built target roscpp_generate_messages_eus
[  0%] Built target rosgraph_msgs_generate_messages_lisp
[  0%] Built target tf_generate_messages_eus
[  0%] Built target rosgraph_msgs_generate_messages_nodejs
[  0%] Built target geometry_msgs_generate_messages_cpp
[  0%] Built target nav_msgs_generate_messages_py
[  0%] Built target geometry_msgs_generate_messages_eus
[  0%] Built target roscpp_generate_messages_cpp
[  0%] Built target sensor_msgs_generate_messages_nodejs
[  0%] Built target tf2_msgs_generate_messages_cpp
[  0%] Built target rosgraph_msgs_generate_messages_cpp
[  0%] Built target actionlib_msgs_generate_messages_py
[  0%] Built target std_msgs_generate_messages_cpp
[  0%] Built target actionlib_generate_messages_eus
[  0%] Built target tf_generate_messages_cpp
[  0%] Built target rosgraph_msgs_generate_messages_eus
[  0%] Built target nav_msgs_generate_messages_lisp
[  0%] Built target actionlib_msgs_generate_messages_lisp
[  0%] Built target actionlib_generate_messages_py
[  0%] Built target nav_msgs_generate_messages_nodejs
[  0%] Built target tf2_msgs_generate_messages_py
[  0%] Built target actionlib_msgs_generate_messages_nodejs
[  0%] Built target sensor_msgs_generate_messages_cpp
[  0%] Built target rosgraph_msgs_generate_messages_py
[  0%] Built target roscpp_generate_messages_py
[  0 ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-04-22 23:09:28 -0500

Eman.m gravatar image

updated 2021-04-22 23:10:53 -0500

This is CMakeLists.txt that works

cmake_minimum_required(VERSION 2.8.3)
project(start_goal_generator)

## Compile as C++11, supported in ROS Kinetic and newer
## add_compile_options(-std=c++11)

find_package(catkin REQUIRED COMPONENTS
  roscpp
  rospy
  std_msgs
  nav_msgs
)

catkin_package(
  INCLUDE_DIRS include
  LIBRARIES start_goal_generator
  CATKIN_DEPENDS roscpp rospy std_msgs nav_msgs
)

include_directories(include ${catkin_INCLUDE_DIRS})

add_executable(start_goal_generator_node
  src/start_goal_generator_node.cpp
)

target_link_libraries(start_goal_generator_node
   ${catkin_LIBRARIES}
)

* ros c++ nodes are not compiled with g++, now my node works perfectly. NOTE: I changed the node file name to start_goal_generator_node.cpp*

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2021-04-22 15:47:10 -0500

Seen: 62 times

Last updated: Apr 22 '21