Error : required from here
Hi everyone,
I have problem in eclipse program.
I used simplest code for publisher and I get on this problem:
required from here
by this statement (line 38):
output_modem_publisher_.publish(m2);
The code is :
#include "ros/ros.h"
#include "std_msgs/String.h"
#include <sstream>
int main(int argc, char** argv)
{
ros::init(argc, argv, "test");
ros::NodeHandle nh;
ros::Publisher output_modem_publisher_;
const std::string modem_topic_ = "monsun/modem/in";
output_modem_publisher_ = nh.advertise<std_msgs::String>(modem_topic_, 1000);
ros::Rate loop_rate(15);
int count = 0;
while (ros::ok())
{
std::string out_modem2;
std::stringstream monsun2;
monsun2 << 2 << "Ammar" ;
out_modem2 = monsun2.str();
std_msgs::String m2;
m2.data = out_modem2;
output_modem_publisher_.publish(m2);
ROS_INFO("m2222222222 ");
ros::spinOnce();
loop_rate.sleep();
++count;
}
return 0;
}
And the output of build project is:
16:12:09 * Incremental Build of project modem_test-RelWithDebInfo@modem_test * /usr/bin/make -j8 all mkdir -p bin cd build && cmake -Wdev -DCMAKE_TOOLCHAIN_FILE=/opt/ros/groovy/share/ros/core/rosbuild/rostoolchain.cmake .. Re-run cmake no build system arguments [rosbuild] Building package modem_test -- Using CATKIN_DEVEL_PREFIX: /home/amory/ros_workspace/modem_test/build/devel -- Using CMAKE_PREFIX_PATH: /opt/ros/groovy -- This workspace overlays: /opt/ros/groovy -- Found gtest sources under '/usr/src/gtest': gtests will be built -- catkin 0.5.63 [rosbuild] Including /opt/ros/groovy/share/roscpp/rosbuild/roscpp.cmake [rosbuild] Including /opt/ros/groovy/share/rospy/rosbuild/rospy.cmake -- Configuring done -- Generating done CMake Warning: Manually-specified variables were not used by the project:
CMAKE_TOOLCHAIN_FILE
-- Build files have been written to: /home/amory/ros_workspace/modem_test/build
cd build && /usr/bin/make
make[1]: Entering directory /home/amory/ros_workspace/modem_test/build'
/usr/bin/cmake -H/home/amory/ros_workspace/modem_test -B/home/amory/ros_workspace/modem_test/build --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /home/amory/ros_workspace/modem_test/build/CMakeFiles /home/amory/ros_workspace/modem_test/build/CMakeFiles/progress.marks
/usr/bin/make -f CMakeFiles/Makefile2 all
make[2]: Entering directory
/home/amory/ros_workspace/modem_test/build'
/usr/bin/make -f CMakeFiles/rospack_genmsg_libexe.dir/build.make CMakeFiles/rospack_genmsg_libexe.dir/depend
make[3]: Entering directory /home/amory/ros_workspace/modem_test/build'
cd /home/amory/ros_workspace/modem_test/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/amory/ros_workspace/modem_test /home/amory/ros_workspace/modem_test /home/amory/ros_workspace/modem_test/build /home/amory/ros_workspace/modem_test/build /home/amory/ros_workspace/modem_test/build/CMakeFiles/rospack_genmsg_libexe.dir/DependInfo.cmake --color=
make[3]: Leaving directory
/home/amory/ros_workspace/modem_test/build'
/usr/bin/make -f CMakeFiles/rospack_genmsg_libexe.dir/build.make CMakeFiles/rospack_genmsg_libexe.dir/build
make[3]: Entering directory /home/amory/ros_workspace/modem_test/build'
make[3]: Nothing to be done for
CMakeFiles/rospack_genmsg_libexe.dir/build'.
make[3]: Leaving directory /home/amory/ros_workspace/modem_test/build'
/usr/bin/cmake -E cmake_progress_report /home/amory/ros_workspace/modem_test/build/CMakeFiles
[ 0%] Built target rospack_genmsg_libexe
/usr/bin/make -f CMakeFiles/rosbuild_precompile.dir/build.make CMakeFiles/rosbuild_precompile.dir/depend
make[3]: Entering directory
/home/amory/ros_workspace/modem_test/build'
cd /home/amory/ros_workspace/modem_test/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/amory/ros_workspace/modem_test /home/amory/ros_workspace/modem_test /home/amory/ros_workspace/modem_test/build /home/amory/ros_workspace/modem_test/build /home/amory/ros_workspace/modem_test/build/CMakeFiles ...