Quantcast
Channel: ROS Answers: Open Source Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 417

Odometry subscriber throwing catkin_make error, probably due to missing libraries

$
0
0
I have the following subscriber to read values from the /camera/odom topic using a zed camera (The `header.seq` is being used for testing purposes. It shall be changed to orientation values): //#include #include "ros/ros.h" //#include "std_msgs/String.h" #include "nav_msgs/Odometry.h" //#include "geometry_msgs/Pose.h" //#include "geometry_msgs/PoseWithCovariance.h" //#include "geometry_msgs/Quaternion.h" //using namespace std; void odomCallback(nav_msgs::Odometry::ConstPtr& msg) { ROS_INFO("Orientation quaternions: x:[%d]", msg->header.seq); } int main(int argc, char **argv) { //cout << "Hello world!" << endl; ros::init(argc, argv, "zed_ornt_subscriber_node"); ros::NodeHandle n; ros::Subscriber sub = n.subscribe("/camera/odom",1000, odomCallback); ros::spin(); return 0; } I have an error which is similar to what's shown [here](http://answers.ros.org/question/11540/error-when-subscribing-to-cameradepthpoints/) and [here](http://answers.ros.org/question/192707/subscribe-to-sensor_msgspointcloud/). But this is a `nav_msgs` type message that I am subscribing to, not `point cloud`. What library should be included to rectify this? My exact error message is as shown: 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/xact/test_ws/src/zed_ornt_subscriber/src/zed_ornt_subscriber_node.cpp:2: /opt/ros/indigo/include/ros/message_traits.h: In instantiation of 'static const char* ros::message_traits::MD5Sum::value() [with M = boost::shared_ptr>>]': /opt/ros/indigo/include/ros/message_traits.h:228:103: required from 'const char* ros::message_traits::md5sum() [with M = boost::shared_ptr>>]' /opt/ros/indigo/include/ros/subscribe_options.h:89:50: required from 'void ros::SubscribeOptions::initByFullCallbackType(const string&, uint32_t, const boost::function&, const boost::function::Message>()>&) [with P = boost::shared_ptr>>&; std::string = std::basic_string; uint32_t = unsigned int; typename ros::ParameterAdapter

::Message = boost::shared_ptr>>]' /opt/ros/indigo/include/ros/node_handle.h:658:5: required from 'ros: :Subscriber ros::NodeHandle::subscribe(const string&, uint32_t, void (*)(M), const ros::TransportHints&) [with M = boost::shared_ptr>>&; std::string = std::basic_string; uint32_t = unsigned int]' /home/xact/test_ws/src/zed_ornt_subscriber/src/zed_ornt_subscri ber_node.cpp:20:72: required from here /opt/ros/indigo/include/ros/message_traits.h:121:29: error: '__s_getMD5Sum' is not a member of 'boo st::shared_ptr>>' return M::__s_getMD5Sum().c_str(); ^ /opt/ros/indigo/include/ros/message_traits.h: In instantiation of 'static const char* ros::message_traits::DataType::value() [with M = boost::shared_ptr< const nav_msgs::Odometry_>>]': /opt/ros/indigo/include/ros/message_traits.h:237:105: required from 'const char* ros::message_traits::datatype() [with M = boost::shared_ptr>>]' /opt/ros/indigo/include/ros/subscribe_options.h:90:54: required from 'void ros::SubscribeOptions::initByFullCallbackType(const string&, uint32_t, const boost::function&, const boost::function::Message>()>&) [with P = boost::shared_ptr>>&; std::string = std::basic_string; uint32_t = unsigned int; typename ros::ParameterAdapter

::Message = boost::shared_ptr>>]' /opt/ros/indigo/include/ros/node_handle.h:658:5: required from 'ros::Subscriber ros::NodeHandle::subscribe(const string&, uint32_t, void (*)(M), const ros::TransportHints&) [with M = boost::shared_ptr>>&; std::string = std::basic_string; uint32_t = unsigned int]' /home/xact/test_ws/src/zed_ornt_subscriber/src/zed_ornt_subscriber_node.cpp:20:72: required from here /opt/ros/indigo/include/ros/message_traits.h:138:31: error: '__s_getDataType' is not a member of 'boost::shared_ptr>>' return M::__s_getDataType().c_str(); ^ In file included from /opt/ros/indigo/include/ros/subscription_callback_helper.h:35:0, from /opt/ros/indigo/include/ros/subscriber.h:33, from /opt/ros/indigo/include/ros/node_handle.h:33, from /opt/ros/indigo/include/ros/ros.h:45, from /home/xact/test_ws/src/zed_ornt_subscriber/src/zed_ornt_subscriber_node.cpp:2: /opt/ros/indigo/include/ros/parameter_adapter.h: In instantiation of 'static ros::ParameterAdapter::Parameter ros::ParameterAdapter::getParameter(const Event&) [with M = boost::shared_ptr>>&; ros::ParameterAdapter::Parameter = boost::shared_ptr>>&; ros::ParameterAdapter::Event = ros::MessageEvent>>>; typename boost::remove_reference::type>::type = boost::shared_ptr>>]': /opt/ros/indigo/include/ros/subscription_callback_helper.h:144:54: required from 'void ros::SubscriptionCallbackHelperT

::call(ros::SubscriptionCallbackHelperCallParams&) [with P = boost::shared_ptr>>&; Enabled = void]' /home/xact/test_ws/src/zed_ornt_subscriber/src/zed_ornt_subscriber_node.cpp:23:1: required from here /opt/ros/indigo/include/ros/parameter_adapter.h:78:30: error: invalid initialization of reference of type 'ros::ParameterAdapter>>&>::Parameter {aka boost::shared_ptr>>&}' from expression of type 'const boost::shared_ptr>>' return *event.getMessage(); ^ In file included from /opt/ros/indigo/include/ros/publisher.h:34:0, from /opt/ros/indigo/include/ros/node_handle.h:32, from /opt/ros/indigo/include/ros/ros.h:45, from /home/xact/test_ws/src/zed_ornt_subscriber/src/zed_ornt_subscriber_node.cpp:2: /opt/ros/indigo/include/ros/serialization.h: In instantiation of 'static void ros::serialization::Serializer::read(Stream&, typename boost::call_traits::reference) [with Stream = ros::serialization::IStream; T = boost::shared_ptr>>; typename boost::call_traits::reference = boost::shared_ptr>>&]': /opt/ros/indigo/include/ros/serialization.h:163:32: required from 'void ros::serialization::deserialize(Stream&, T&) [with T = boost::shared_ptr>>; Stream = ros::serialization::IStream]' /opt/ros/indigo/include/ros/subscription_callback_helper.h:136:34: required from 'ros::VoidConstPtr ros::SubscriptionCallbackHelperT

::deserialize(const ros::SubscriptionCallbackHelperDeserializeParams&) [with P = boost::shared_ptr>>&; Enabled = void; ros::VoidConstPtr = boost::shared_ptr]' /home/xact/test_ws/src/zed_ornt_subscriber/src/zed_ornt_subscriber_node.cpp:23:1: required from here /opt/ros/indigo/include/ros/serialization.h:136:5: error: 'class boost::shared_ptr>>' has no member named 'deserialize' t.deserialize(stream.getData()); ^ make[2]: *** [zed_ornt_subscriber/CMakeFiles/zed_ornt_subscriber_node.dir/src/zed_ornt_subscriber_node.cpp.o] Error 1 make[1]: *** [zed_ornt_subscriber/CMakeFiles/zed_ornt_subscriber_node.dir/all] Error 2 make: *** [all] Error 2


Viewing all articles
Browse latest Browse all 417

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>