Attention: Answers.ros.org is deprecated as of August the 11th, 2023. Please visit robotics.stackexchange.com to ask a new question. This site will remain online in read-only mode during the transition and into the foreseeable future. Selected questions and answers have been migrated, and redirects have been put in place to direct users to the corresponding questions on Robotics Stack Exchange. Additional details are available here.
notsotechnical@notsotechnical-VirtualBox:~/catkin_ws$ catkin_make
Base path: /home/notsotechnical/catkin_ws
Source space: /home/notsotechnical/catkin_ws/src
Build space: /home/notsotechnical/catkin_ws/build
Devel space: /home/notsotechnical/catkin_ws/devel
Install space: /home/notsotechnical/catkin_ws/install
####
#### Running command: "make cmake_check_build_system" in "/home/notsotechnical/catkin_ws/build"
####
-- Using CATKIN_DEVEL_PREFIX: /home/notsotechnical/catkin_ws/devel
-- Using CMAKE_PREFIX_PATH: /opt/ros/melodic
-- This workspace overlays: /opt/ros/melodic
-- Using PYTHON_EXECUTABLE: /usr/bin/python
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/notsotechnical/catkin_ws/build/test_results
-- Found gmock sources under '/usr/src/googletest': gmock will be built
-- Found gtest sources under '/usr/src/googletest': gtests will be built
-- Using Python nosetests: /usr/bin/nosetests-2.7
-- catkin 0.7.17
-- BUILD_SHARED_LIBS is on
-- BUILD_SHARED_LIBS is on
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~ traversing 2 packages in topological order:
-- ~~ - repo_name_hw2
-- ~~ - repo_uniquename_hw2
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin package: 'repo_name_hw2'
-- ==> add_subdirectory(repo_name_hw2)
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
-- repo_name_hw2: 1 messages, 0 services
-- +++ processing catkin package: 'repo_uniquename_hw2'
-- ==> add_subdirectory(repo_uniquename_hw2)
-- Configuring done
-- Generating done
-- Build files have been written to: /home/notsotechnical/catkin_ws/build
####
#### Running command: "make -j1 -l1" in "/home/notsotechnical/catkin_ws/build"
####
Scanning dependencies of target std_msgs_generate_messages_cpp
[ 0%] Built target std_msgs_generate_messages_cpp
Scanning dependencies of target _repo_name_hw2_generate_messages_check_deps_test_custom_msg
[ 0%] Built target _repo_name_hw2_generate_messages_check_deps_test_custom_msg
Scanning dependencies of target repo_name_hw2_generate_messages_cpp
[ 14%] Generating C++ code from repo_name_hw2/test_custom_msg.msg
[ 14%] Built target repo_name_hw2_generate_messages_cpp
Scanning dependencies of target std_msgs_generate_messages_py
[ 14%] Built target std_msgs_generate_messages_py
Scanning dependencies of target repo_name_hw2_generate_messages_py
[ 28%] Generating Python from MSG repo_name_hw2/test_custom_msg
[ 42%] Generating Python msg __init__.py for repo_name_hw2
[ 42%] Built target repo_name_hw2_generate_messages_py
Scanning dependencies of target std_msgs_generate_messages_nodejs
[ 42%] Built target std_msgs_generate_messages_nodejs
Scanning dependencies of target repo_name_hw2_generate_messages_nodejs
[ 57%] Generating Javascript code from repo_name_hw2/test_custom_msg.msg
[ 57%] Built target repo_name_hw2_generate_messages_nodejs
Scanning dependencies of target std_msgs_generate_messages_eus
[ 57%] Built target std_msgs_generate_messages_eus
Scanning dependencies of target repo_name_hw2_generate_messages_eus
[ 71%] Generating EusLisp code from repo_name_hw2/test_custom_msg.msg
[ 85%] Generating EusLisp manifest code for repo_name_hw2
[ 85%] Built target repo_name_hw2_generate_messages_eus
Scanning dependencies of target std_msgs_generate_messages_lisp
[ 85%] Built target std_msgs_generate_messages_lisp
Scanning dependencies of target repo_name_hw2_generate_messages_lisp
[100%] Generating Lisp code from repo_name_hw2/test_custom_msg.msg
[100%] Built target repo_name_hw2_generate_messages_lisp
Scanning dependencies of target repo_name_hw2_generate_messages
[100%] Built target repo_name_hw2_generate_messages
notsotechnical@notsotechnical-VirtualBox:~/catkin_ws$ rosmsg show repo_name_hw2/Num
Unable to load msg [repo_name_hw2/Num]: Cannot locate message [Num]: unknown package [repo_name_hw2] on search path [{}]
notsotechnical@notsotechnical-VirtualBox:~/catkin_ws$ rosmsg show Num
Could not find msg 'Num'
notsotechnical@notsotechnical-VirtualBox:~/catkin_ws$ rospack profile
Full tree crawl took 0.000001 seconds.
Directories marked with (*) contain no manifest. You may
want to delete these directories.
To get just of list of directories without manifests,
re-run the profile with --zombie-only
-------------------------------------------------------------
notsotechnical@notsotechnical-VirtualBox:~/catkin_ws$ source devel/setup.bash
notsotechnical@notsotechnical-VirtualBox:~/catkin_ws$ rosmsg show repo_name_hw2/Num
Unable to load msg [repo_name_hw2/Num]: Cannot locate message [Num] in package [repo_name_hw2] with paths [['/home/notsotechnical/catkin_ws/src/repo_name_hw2/msg', '/home/notsotechnical/catkin_ws/devel/share/repo_name_hw2/msg']]
notsotechnical@notsotechnical-VirtualBox:~/catkin_ws$ rosmsg show Num
Could not find msg 'Num'
notsotechnical@notsotechnical-VirtualBox:~/catkin_ws$ rosmsg show [string]
Could not find msg '[string]'
notsotechnical@notsotechnical-VirtualBox:~/catkin_ws$ rosmsg show Num
Could not find msg 'Num'
notsotechnical@notsotechnical-VirtualBox:~/catkin_ws$ source /opt ...
Can you update your question with CMakeLists.txt from your repo_name_hw2 package? Please only include lines that are not commented out. Also, please show the output of rosls repo_name_hw2/msg/. If you are using the same CMakeLists.txtfrom https://answers.ros.org/question/3338..., then you are not telling catkin to generate headers for a repo_name_hw2/Num message type. The only message type built is test_custom_msg.msg.
Your bash output of Generating C++ code from repo_name_hw2/test_custom_msg.msg indicates that you are only building that message type. If you do a rosmsg show repo_name_hw2/test_custom_msg you should get valid output.
We will know more, and will probably be able to give an answer, with a little bit more information.
@krl101 : That's not totally correct, rosrun expects 2 arguments : PACKAGE_NAME and EXECUTABLE_NAME but I don't exactly see the point of what OP tried to do with that command.
@notSoTechnical : For the message, if it's correctly created, you have to give the package where the msg file is and the name of the msg file without the extension .msg, both separated by a / :
Hi, can you please narrow down your question a little? Instead of:
it should be (without blank between ros and run):
To answer the question in the title:
can be helpful - see also rosmsg page
Greetings!
Can you update your question with
CMakeLists.txt
from yourrepo_name_hw2
package? Please only include lines that are not commented out. Also, please show the output ofrosls repo_name_hw2/msg/
. If you are using the sameCMakeLists.txt
from https://answers.ros.org/question/3338..., then you are not telling catkin to generate headers for arepo_name_hw2/Num
message type. The only message type built istest_custom_msg.msg
.Your bash output of
Generating C++ code from repo_name_hw2/test_custom_msg.msg
indicates that you are only building that message type. If you do arosmsg show repo_name_hw2/test_custom_msg
you should get valid output.We will know more, and will probably be able to give an answer, with a little bit more information.