ros indigo catkin_make error
I am trying to catkin_make in ros indigo, and getting this error:
Can you help me?
In file included from /opt/ros/indigo/include/ros/serialization.h:37:0,
from /opt/ros/indigo/include/ros/publisher.h:34,
from /opt/ros/indigo/include/ros/node_handle.h:32,
from /opt/ros/indigo/include/ros/ros.h:45,
from /home/arc/catkin_ws/src/arc_ros_stream/src/arc_line_follower.cpp:1:
/opt/ros/indigo/include/ros/message_traits.h: In instantiation of ‘static const char* ros::message_traits::MD5Sum<M>::value(const M&) [with M = int]’:
/opt/ros/indigo/include/ros/message_traits.h:255:102: required from ‘const char* ros::message_traits::md5sum(const M&) [with M = int]’
/opt/ros/indigo/include/ros/publisher.h:112:7: required from ‘void ros::Publisher::publish(const M&) const [with M = int]’
/home/arc/catkin_ws/src/arc_ros_stream/src/arc_line_follower.cpp:163:29: required from here
/opt/ros/indigo/include/ros/message_traits.h:126:34: error: request for member ‘__getMD5Sum’ in ‘m’, which is of non-class type ‘const int’
return m.__getMD5Sum().c_str();
Edit:
void gripper_grip_callback(const std_msgs::Float32::ConstPtr& grip_msg)
{
gripper_grip_pub.publish(50);
}
the line 163 is "gripper_grip_pub.publish(50); " and all other errors occure when i call publish in this file . and i know this file worked until yesterday but i had to change gui because some reasons and so i reinstalled the ros . and i don't know which package is required for this publishing in cpp codes . also i don't have any problem in publishing data by python . so i don't know what's happening here . thanks for your giude.
Your problem is here:
/home/arc/catkin_ws/src/arc_ros_stream/src/arc_line_follower.cpp:163:29
Can you provide this part of the code and from what it seems, can you paste the definition of the variable that is used in your publisher, it looks like you are using a wrong typeEvery where in the code, pulish has this error
The problem is most likely that your trying to publish an
int
(ie: the C++ primitive type), instead of astd_msgs/IntX
(wherex <- [8, 16, 32, 64]
).Can you show how you call
publish(..)
?You cannot
publish(..)
integers directly. That is the reason for the error.I'm not saying you're lying, but that would seem strange.
that's because Python will automatically convert ..
.. the
int
into a message for you.