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

Beginner Tutorial #11 - Writing a Simple Publisher and Subscriber (C++)

asked 2016-09-30 01:57:02 -0500

futz gravatar image

updated 2016-09-30 02:04:01 -0500

I have been following the beginner tutorials since #1 but I have ran into a problem on #11.

http://wiki.ros.org/ROS/Tutorials/Wri...

I am using ROS Kinetic Kame on Ubuntu 16.04.

When I run catkin_make after adding the talker and listener .cpp files, and editing the CMakeLists.txt file, I get a massive wall of text with a few red colored words littered throughout. My "talker" executable is created but the "listener" fails and I have no idea how to parse through the text. It is so long that my catkin_make call is lost.

I did notice some inconsistencies in the tutorial itself. It says that my CMakeLists.txt file should look like this before editing:

cmake_minimum_required(VERSION 2.8.3)
project(beginner_tutorials)

## Find catkin and any catkin packages
find_package(catkin REQUIRED COMPONENTS roscpp rospy std_msgs genmsg)

## Declare ROS messages and services
add_message_files(DIRECTORY msg FILES Num.msg)
add_service_files(DIRECTORY srv FILES AddTwoInts.srv)

## Generate added messages and services
generate_messages(DEPENDENCIES std_msgs)

## Declare a catkin package
catkin_package()

but the arguments DIRECTORY, msg, and srv were never added in the prior tutorials. Also, catkin_package() did not have zero arguments.

I tried adding the lines that the tutorial instructs us to add at the end and it did not work. Then I used the CMakeLists.txt file that it provided and it still did not work.

I would post the catkin_make result but it is so massive I don't think it would be any help. Ill post the small chunk that it ends with:

/usr/include/boost/math/special_functions/round.hpp:28:44: required from ‘typename boost::math::tools::promote_args<t>::type boost::math::detail::round(const T&, const Policy&, mpl_::false_) [with T = double; Policy = boost::math::policies::policy<boost::math::policies::default_policy, boost::math::policies::default_policy,="" boost::math::policies::default_policy,="" boost::math::policies::default_policy,="" boost::math::policies::default_policy,="" boost::math::policies::default_policy,="" boost::math::policies::default_policy,="" boost::math::policies::default_policy,="" boost::math::policies::default_policy,="" boost::math::policies::default_policy,="" boost::math::policies::default_policy="">; typename boost::math::tools::promote_args<t>::type = double; mpl_::false_ = mpl_::bool_<false>]’ /usr/include/boost/math/special_functions/round.hpp:65:24: required from ‘typename boost::math::tools::promote_args<t>::type boost::math::round(const T&, const Policy&) [with T = double; Policy = boost::math::policies::policy<boost::math::policies::default_policy, boost::math::policies::default_policy,="" boost::math::policies::default_policy,="" boost::math::policies::default_policy,="" boost::math::policies::default_policy,="" boost::math::policies::default_policy,="" boost::math::policies::default_policy,="" boost::math::policies::default_policy,="" boost::math::policies::default_policy,="" boost::math::policies::default_policy,="" boost::math::policies::default_policy="">; typename boost::math::tools::promote_args<t>::type = double]’ /usr/include/boost/math/special_functions/round.hpp:70:16: required from ‘typename boost::math::tools::promote_args<t>::type boost::math::round(const T&) [with T = double; typename boost::math::tools::promote_args<t>::type = double]’ /opt/ros/kinetic/include/ros/time.h:153:89: required from ‘T& ros::TimeBase<t, d="">::fromSec(double) [with T = ros::Time; D = ros::Duration]’ /opt/ros/kinetic/include/ros/time ...

(more)
edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

answered 2016-09-30 02:57:08 -0500

ahendrix gravatar image

Usually the beginning of the error message is the most important part; later errors are often a result of earlier errors.

In this case, the best I can tell from the piece of the error message that you've posted is that there's some kind of error in your talker code. Unfortunately the error message in this case is so verbose that I don't see any line numbers or other references to the actual location in your talker that might be causing trouble.

If you look through the error messages carefully you should occasionally see lines that reference your talker.cpp ; have a careful look at those lines to make sure they match the tutorial.

edit flag offensive delete link more

Comments

yup you were right, I made a mistake when copying into my .cpp file, I have both executables now.

futz gravatar image futz  ( 2016-09-30 13:25:46 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2016-09-30 01:57:02 -0500

Seen: 337 times

Last updated: Sep 30 '16