Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error in catkin_make #2

Open
prostraintechnologies opened this issue Apr 13, 2022 · 1 comment
Open

error in catkin_make #2

prostraintechnologies opened this issue Apr 13, 2022 · 1 comment

Comments

@prostraintechnologies
Copy link

hi,

I tried to catkin_make but it gave me these errors:

[ 86%] Built target hmi_node_generate_messages
In file included from /opt/ros/melodic/include/ros/serialization.h:37:0,
from /opt/ros/melodic/include/ros/publisher.h:34,
from /opt/ros/melodic/include/ros/node_handle.h:32,
from /opt/ros/melodic/include/ros/ros.h:45,
from /home/prostrain/catkin_ws/src/qr_detector/include/qr_detector/qr_detector_nodelet.h:3,
from /home/prostrain/catkin_ws/src/qr_detector/src/qr_detector_nodelet.cpp:1:
/opt/ros/melodic/include/ros/message_traits.h: In instantiation of ‘static const char* ros::message_traits::MD5Sum::value(const M&) [with M = std::__cxx11::basic_string]’:
/opt/ros/melodic/include/ros/message_traits.h:254:102: required from ‘const char* ros::message_traits::md5sum(const M&) [with M = std::__cxx11::basic_string]’
/opt/ros/melodic/include/ros/publisher.h:116:38: required from ‘void ros::Publisher::publish(const M&) const [with M = std::__cxx11::basic_string]’
/home/prostrain/catkin_ws/src/qr_detector/src/qr_detector_nodelet.cpp:64:40: required from here
/opt/ros/melodic/include/ros/message_traits.h:125:14: error: ‘const class std::__cxx11::basic_string’ has no member named ‘__getMD5Sum’
return m.__getMD5Sum().c_str();
~~^~~~~~~~~~~
/opt/ros/melodic/include/ros/message_traits.h: In instantiation of ‘static const char* ros::message_traits::DataType::value(const M&) [with M = std::__cxx11::basic_string]’:
/opt/ros/melodic/include/ros/message_traits.h:263:104: required from ‘const char* ros::message_traits::datatype(const M&) [with M = std::__cxx11::basic_string]’
/opt/ros/melodic/include/ros/publisher.h:118:11: required from ‘void ros::Publisher::publish(const M&) const [with M = std::__cxx11::basic_string]’
/home/prostrain/catkin_ws/src/qr_detector/src/qr_detector_nodelet.cpp:64:40: required from here
/opt/ros/melodic/include/ros/message_traits.h:142:14: error: ‘const class std::__cxx11::basic_string’ has no member named ‘__getDataType’
return m.__getDataType().c_str();
~~^~~~~~~~~~~~~
qr_detector/CMakeFiles/qr_detector_nodelet.dir/build.make:62: recipe for target 'qr_detector/CMakeFiles/qr_detector_nodelet.dir/src/qr_detector_nodelet.cpp.o' failed
make[2]: *** [qr_detector/CMakeFiles/qr_detector_nodelet.dir/src/qr_detector_nodelet.cpp.o] Error 1
CMakeFiles/Makefile2:1477: recipe for target 'qr_detector/CMakeFiles/qr_detector_nodelet.dir/all' failed
make[1]: *** [qr_detector/CMakeFiles/qr_detector_nodelet.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j4 -l4" failed
[ 86%] Built target hmi_node_generate_messages
In file included from /opt/ros/melodic/include/ros/serialization.h:37:0,
from /opt/ros/melodic/include/ros/publisher.h:34,
from /opt/ros/melodic/include/ros/node_handle.h:32,
from /opt/ros/melodic/include/ros/ros.h:45,
from /home/prostrain/catkin_ws/src/qr_detector/include/qr_detector/qr_detector_nodelet.h:3,
from /home/prostrain/catkin_ws/src/qr_detector/src/qr_detector_nodelet.cpp:1:
/opt/ros/melodic/include/ros/message_traits.h: In instantiation of ‘static const char* ros::message_traits::MD5Sum::value(const M&) [with M = std::__cxx11::basic_string]’:
/opt/ros/melodic/include/ros/message_traits.h:254:102: required from ‘const char* ros::message_traits::md5sum(const M&) [with M = std::__cxx11::basic_string]’
/opt/ros/melodic/include/ros/publisher.h:116:38: required from ‘void ros::Publisher::publish(const M&) const [with M = std::__cxx11::basic_string]’
/home/prostrain/catkin_ws/src/qr_detector/src/qr_detector_nodelet.cpp:64:40: required from here
/opt/ros/melodic/include/ros/message_traits.h:125:14: error: ‘const class std::__cxx11::basic_string’ has no member named ‘__getMD5Sum’
return m.__getMD5Sum().c_str();
~~^~~~~~~~~~~
/opt/ros/melodic/include/ros/message_traits.h: In instantiation of ‘static const char* ros::message_traits::DataType::value(const M&) [with M = std::__cxx11::basic_string]’:
/opt/ros/melodic/include/ros/message_traits.h:263:104: required from ‘const char* ros::message_traits::datatype(const M&) [with M = std::__cxx11::basic_string]’
/opt/ros/melodic/include/ros/publisher.h:118:11: required from ‘void ros::Publisher::publish(const M&) const [with M = std::__cxx11::basic_string]’
/home/prostrain/catkin_ws/src/qr_detector/src/qr_detector_nodelet.cpp:64:40: required from here
/opt/ros/melodic/include/ros/message_traits.h:142:14: error: ‘const class std::__cxx11::basic_string’ has no member named ‘__getDataType’
return m.__getDataType().c_str();
~~^~~~~~~~~~~~~
qr_detector/CMakeFiles/qr_detector_nodelet.dir/build.make:62: recipe for target 'qr_detector/CMakeFiles/qr_detector_nodelet.dir/src/qr_detector_nodelet.cpp.o' failed
make[2]: *** [qr_detector/CMakeFiles/qr_detector_nodelet.dir/src/qr_detector_nodelet.cpp.o] Error 1
CMakeFiles/Makefile2:1477: recipe for target 'qr_detector/CMakeFiles/qr_detector_nodelet.dir/all' failed
make[1]: *** [qr_detector/CMakeFiles/qr_detector_nodelet.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j4 -l4" failed

Do you have any ideas about it? I am a newbie on this ros application. Thank you in advance.

@ingjae
Copy link

ingjae commented Nov 30, 2022

I had same issue

try edit here
https://github.com/mdrwiega/qr_detector/blob/master/src/qr_detector_nodelet.cpp#L50

void QrDetectorNodelet::imageCallback(const sensor_msgs::ImageConstPtr &image)
{
  cv_bridge::CvImageConstPtr cv_image;
  std_msgs::String qr_msg;

  try {
    cv_image = cv_bridge::toCvShare(image, sensor_msgs::image_encodings::BGR8);
  }
  catch (cv_bridge::Exception& e) {
    ROS_ERROR("cv_bridge exception: %s", e.what());
    return;
  }
  
  auto tags = detector_.detect(cv_image->image, 10);
  for (auto& tag : tags)
  {
    qr_msg.data = tag.message;
    tags_publisher_.publish(qr_msg);
  }
}

it works for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants