Ask Your Question
0

How to display the ROS message in the terminal?

asked 2019-09-24 23:19:35 -0500

notSoTechnical gravatar image

updated 2019-09-24 23:19:59 -0500

 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 ...
(more)
edit retag flag offensive close merge delete

Comments

Hi, can you please narrow down your question a little? Instead of:

ros run repo_name_hw2

it should be (without blank between ros and run):

rosrun repo_name_hw2 node_name

To answer the question in the title:

rosmsg

can be helpful - see also rosmsg page

Greetings!

krl101 gravatar imagekrl101 ( 2019-09-25 01:28:56 -0500 )edit

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.

Thomas D gravatar imageThomas D ( 2019-09-25 22:24:20 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2019-09-25 01:45:45 -0500

Delb gravatar image

@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 / :

rosmsg show PACKAGE_NAME/NAME_OF_YOUR_MSG_FILE
edit flag offensive delete link more

Comments

1

@Delb yes, you are completely right. I just corrected it. OP tried this command without success

krl101 gravatar imagekrl101 ( 2019-09-25 02:29:10 -0500 )edit

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: 2019-09-24 23:19:35 -0500

Seen: 43 times

Last updated: Sep 25