0
$\begingroup$

Rosanswers logo

Hi there,

i just installed ROS fuerte (ubuntu 11.10 32bit) and now i am trying to establish a connection between matlab and ros. I found this tutorial. Is there a better way to get it working? It was the only solution i found in the web. I started the tutorial and it worked well until point 7. I can't compile the message folders. The first one seems to work, but the second gives me a long error list. Is anyone familiar with the ipc_bridge? Here is the terminal output from the "roscd ipc_std_msgs && make" command:

bash -c "mkdir -p bin" bash -c "rospack find ipc_bridge/generate_msgs.sh ." Generating std_msgs_Bool.h mex -I./include -I/home/simon/ros_workspace/ipc_msgs/ipc_roslib/include -I/home/simon/ros_workspace/ipc_bridge_stack/ipc_bridge_matlab/include -I/home/simon/ros_workspace/ipc_bridge_stack/ipc_bridge/include -I/home/simon/ros_workspace/ipc_bridge_stack/ipc/include -I/home/simon/ros_workspace/ipc_bridge_stack/ipc_bridge/include -lstdc++ -L/home/simon/ros_workspace/ipc_bridge_stack/ipc/lib -lipc mex/std_msgs_Bool.cc -output bin/std_msgs_Bool

Warning: You are using gcc version "4.6.1-9ubuntu3)". The version currently supported with MEX is "4.4.6". For a list of currently supported compilers see: http://www.mathworks.com/support/compilers/current_release/

g++ -I./include -I/home/simon/ros_workspace/ipc_msgs/ipc_roslib/include -I/home/simon/ros_workspace/ipc_bridge_stack/ipc_bridge_ros/include -I/opt/ros/fuerte/include -I/home/simon/ros_workspace/ipc_bridge_stack/ipc/include -I/home/simon/ros_workspace/ipc_bridge_stack/ipc_bridge/include -I/home/simon/ros_workspace/ipc_bridge_stack/ipc_bridge/include -lstdc++ -L/home/simon/ros_workspace/ipc_bridge_stack/ipc/lib -lipc -L/opt/ros/fuerte/lib -lroscpp -lrostime -lrosconsole -lroscpp_serialization -lxmlrpcpp ros/std_msgs_Bool_publisher.cc -o bin/std_msgs_Bool_publisher /tmp/cc4DJBiO.o: In function main': std_msgs_Bool_publisher.cc:(.text+0xc1): undefined reference to ros::init(int&, char**, std::basic_string<char, std::char_traits, std::allocator > const&, unsigned int)' std_msgs_Bool_publisher.cc:(.text+0x123): undefined reference to ros::NodeHandle::NodeHandle(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::map<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > const&)' std_msgs_Bool_publisher.cc:(.text+0x321): undefined reference to ros::this_node::getName()' std_msgs_Bool_publisher.cc:(.text+0x372): undefined reference to ros::console::g_initialized' std_msgs_Bool_publisher.cc:(.text+0x381): undefined reference to ros::console::initialize()' std_msgs_Bool_publisher.cc:(.text+0x3d2): undefined reference to ros::console::initializeLogLocation(ros::console::LogLocation*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, ros::console::levels::Level)' std_msgs_Bool_publisher.cc:(.text+0x40e): undefined reference to ros::console::setLogLocationLevel(ros::console::LogLocation*, ros::console::levels::Level)' std_msgs_Bool_publisher.cc:(.text+0x41a): undefined reference to ros::console::checkLogLocationEnabled(ros::console::LogLocation*)' std_msgs_Bool_publisher.cc:(.text+0x44b): undefined reference to ros::this_node::getName()' std_msgs_Bool_publisher.cc:(.text+0x4a0): undefined reference to ros::console::print(ros::console::FilterBase*, log4cxx::Logger*, ros::console::levels::Level, char const*, int, char const*, char const*, ...)' std_msgs_Bool_publisher.cc:(.text+0x4b1): undefined reference to ros::console::g_initialized' std_msgs_Bool_publisher.cc:(.text+0x4c0): undefined reference to ros::console::initialize()' std_msgs_Bool_publisher.cc:(.text+0x511): undefined reference to ros::console::initializeLogLocation(ros::console::LogLocation*, std::basic_string<char, std::char_traits, std::allocator > const&, ros::console::levels::Level)' std_msgs_Bool_publisher.cc:(.text+0x54c): undefined reference to ros::console::setLogLocationLevel(ros::console::LogLocation*, ros::console::levels::Level)' std_msgs_Bool_publisher.cc:(.text+0x558): undefined reference to ros::console::checkLogLocationEnabled(ros::console::LogLocation*)' std_msgs_Bool_publisher.cc:(.text+0x589): undefined reference to ros::this_node::getName()' std_msgs_Bool_publisher.cc:(.text+0x5de): undefined reference to ros::console::print(ros::console::FilterBase*, log4cxx::Logger*, ros::console::levels::Level, char const*, int, char const*, char const*, ...)' std_msgs_Bool_publisher.cc:(.text+0x5e3): undefined reference to ros::spin()' std_msgs_Bool_publisher.cc:(.text+0x600): undefined reference to ros::Subscriber::~Subscriber()' std_msgs_Bool_publisher.cc:(.text+0x624): undefined reference to ros::NodeHandle::~NodeHandle()' std_msgs_Bool_publisher.cc:(.text+0x676): undefined reference to ros::NodeHandle::~NodeHandle()' std_msgs_Bool_publisher.cc:(.text+0x72c): undefined reference to ros::Subscriber::~Subscriber()' std_msgs_Bool_publisher.cc:(.text+0x7a2): undefined reference to ros::Subscriber::~Subscriber()' std_msgs_Bool_publisher.cc:(.text+0x7d2): undefined reference to ros::NodeHandle::~NodeHandle()' /tmp/cc4DJBiO.o: In function ipc_bridge::Interface::BaseConnect()': std_msgs_Bool_publisher.cc:(.text._ZN10ipc_bridge9Interface11BaseConnectEv[ipc_bridge::Interface::BaseConnect()]+0x30): undefined reference to IPC_setVerbosity' std_msgs_Bool_publisher.cc:(.text._ZN10ipc_bridge9Interface11BaseConnectEv[ipc_bridge::Interface::BaseConnect()]+0x8c): undefined reference to IPC_connectModule' std_msgs_Bool_publisher.cc:(.text._ZN10ipc_bridge9Interface11BaseConnectEv[ipc_bridge::Interface::BaseConnect()]+0xc0): undefined reference to IPC_isConnected' std_msgs_Bool_publisher.cc:(.text._ZN10ipc_bridge9Interface11BaseConnectEv[ipc_bridge::Interface::BaseConnect()]+0xfb): undefined reference to IPC_setCapacity' /tmp/cc4DJBiO.o: In function ipc_bridge::Interface::BaseDisconnect()': std_msgs_Bool_publisher.cc:(.text._ZN10ipc_bridge9Interface14BaseDisconnectEv[ipc_bridge::Interface::BaseDisconnect()]+0x7): undefined reference to IPC_isConnected' std_msgs_Bool_publisher.cc:(.text._ZN10ipc_bridge9Interface14BaseDisconnectEv[ipc_bridge::Interface::BaseDisconnect()]+0x16): undefined reference to IPC_disconnect' /tmp/cc4DJBiO.o: In function ipc_bridge::Publisher<std_msgs_Bool>::Publish(std_msgs_Bool const&)': std_msgs_Bool_publisher.cc:(.text.ZN10ipc_bridge9PublisherI13std_msgs_BoolE7PublishERKS1[ipc_bridge::Publisher<std_msgs_Bool>::Publish(std_msgs_Bool const&)]+0x2e): undefined reference to IPC_publishData' /tmp/cc4DJBiO.o: In function void ros::NodeHandle::param<std::basic_string<char, std::char_traits, std::allocator > >(std::basic_string<char, std::char_traits, std::allocator > const&, std::basic_string<char, std::char_traits, std::allocator >&, std::basic_string<char, std::char_traits, std::allocator > const&) const': std_msgs_Bool_publisher.cc:(.text.ZNK3ros10NodeHandle5paramISsEEvRKSsRT_RKS4[void ros::NodeHandle::param<std::basic_string<char, std::char_traits, std::allocator > >(std::basic_string<char, std::char_traits, std::allocator > const&, std::basic_string<char, std::char_traits, std::allocator >&, std::basic_string<char, std::char_traits, std::allocator > const&) const]+0x14): undefined reference to ros::NodeHandle::hasParam(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const' std_msgs_Bool_publisher.cc:(.text._ZNK3ros10NodeHandle5paramISsEEvRKSsRT_RKS4_[void ros::NodeHandle::param<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const]+0x31): undefined reference to ros::NodeHandle::getParam(std::basic_string<char, std::char_traits, std::allocator > const&, std::basic_string<char, std::char_traits, std::allocator >&) const' /tmp/cc4DJBiO.o: In function ros::Subscriber ros::NodeHandle::subscribe<std_msgs::Bool_<std::allocator<void> > >(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int, void (*)(boost::shared_ptr<std_msgs::Bool_<std::allocator<void> > const> const&), ros::TransportHints const&)': std_msgs_Bool_publisher.cc:(.text._ZN3ros10NodeHandle9subscribeIN8std_msgs5Bool_ISaIvEEEEENS_10SubscriberERKSsjPFvRKN5boost10shared_ptrIKT_EEERKNS_14TransportHintsE[ros::Subscriber ros::NodeHandle::subscribe<std_msgs::Bool_<std::allocator<void> > >(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int, void (*)(boost::shared_ptr<std_msgs::Bool_<std::allocator<void> > const> const&), ros::TransportHints const&)]+0xad): undefined reference to ros::NodeHandle::subscribe(ros::SubscribeOptions&)' /tmp/cc4DJBiO.o: In function ipc_bridge::Publisher<std_msgs_Bool>::Connect()': std_msgs_Bool_publisher.cc:(.text._ZN10ipc_bridge9PublisherI13std_msgs_BoolE7ConnectEv[ipc_bridge::Publisher<std_msgs_Bool>::Connect()]+0x38): undefined reference to IPC_isMsgDefined' std_msgs_Bool_publisher.cc:(.text._ZN10ipc_bridge9PublisherI13std_msgs_BoolE7ConnectEv[ipc_bridge::Publisher<std_msgs_Bool>::Connect()]+0xa5): undefined reference to IPC_defineMsg' /tmp/cc4DJBiO.o: In function ros::SubscriptionCallbackHelperTboost::shared_ptr<std_msgs::Bool_<std::allocator<void > const> const&, void>::deserialize(ros::SubscriptionCallbackHelperDeserializeParams const&)': std_msgs_Bool_publisher.cc:(.text._ZN3ros27SubscriptionCallbackHelperTIRKN5boost10shared_ptrIKN8std_msgs5Bool_ISaIvEEEEEvE11deserializeERKNS_43SubscriptionCallbackHelperDeserializeParamsE[ros::SubscriptionCallbackHelperTboost::shared_ptr<std_msgs::Bool_<std::allocator<void > const> const&, void>::deserialize(ros::SubscriptionCallbackHelperDeserializeParams const&)]+0x36): undefined reference to ros::console::g_initialized' std_msgs_Bool_publisher.cc:(.text._ZN3ros27SubscriptionCallbackHelperTIRKN5boost10shared_ptrIKN8std_msgs5Bool_ISaIvEEEEEvE11deserializeERKNS_43SubscriptionCallbackHelperDeserializeParamsE[ros::SubscriptionCallbackHelperT<boost::shared_ptr<std_msgs::Bool_<std::allocator<void> > const> const&, void>::deserialize(ros::SubscriptionCallbackHelperDeserializeParams const&)]+0x45): undefined reference to ros::console::initialize()' std_msgs_Bool_publisher.cc:(.text._ZN3ros27SubscriptionCallbackHelperTIRKN5boost10shared_ptrIKN8std_msgs5Bool_ISaIvEEEEEvE11deserializeERKNS_43SubscriptionCallbackHelperDeserializeParamsE[ros::SubscriptionCallbackHelperTboost::shared_ptr<std_msgs::Bool_<std::allocator<void > const> const&, void>::deserialize(ros::SubscriptionCallbackHelperDeserializeParams const&)]+0x96): undefined reference to ros::console::initializeLogLocation(ros::console::LogLocation*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, ros::console::levels::Level)' std_msgs_Bool_publisher.cc:(.text._ZN3ros27SubscriptionCallbackHelperTIRKN5boost10shared_ptrIKN8std_msgs5Bool_ISaIvEEEEEvE11deserializeERKNS_43SubscriptionCallbackHelperDeserializeParamsE[ros::SubscriptionCallbackHelperT<boost::shared_ptr<std_msgs::Bool_<std::allocator<void> > const> const&, void>::deserialize(ros::SubscriptionCallbackHelperDeserializeParams const&)]+0xd1): undefined reference to ros::console::setLogLocationLevel(ros::console::LogLocation*, ros::console::levels::Level)' std_msgs_Bool_publisher.cc:(.text._ZN3ros27SubscriptionCallbackHelperTIRKN5boost10shared_ptrIKN8std_msgs5Bool_ISaIvEEEEEvE11deserializeERKNS_43SubscriptionCallbackHelperDeserializeParamsE[ros::SubscriptionCallbackHelperTboost::shared_ptr<std_msgs::Bool_<std::allocator<void > const> const&, void>::deserialize(ros::SubscriptionCallbackHelperDeserializeParams const&)]+0xdd): undefined reference to ros::console::checkLogLocationEnabled(ros::console::LogLocation*)' std_msgs_Bool_publisher.cc:(.text._ZN3ros27SubscriptionCallbackHelperTIRKN5boost10shared_ptrIKN8std_msgs5Bool_ISaIvEEEEEvE11deserializeERKNS_43SubscriptionCallbackHelperDeserializeParamsE[ros::SubscriptionCallbackHelperT<boost::shared_ptr<std_msgs::Bool_<std::allocator<void> > const> const&, void>::deserialize(ros::SubscriptionCallbackHelperDeserializeParams const&)]+0x14d): undefined reference to ros::console::print(ros::console::FilterBase*, log4cxx::Logger*, ros::console::levels::Level, char const*, int, char const*, char const*, ...)' /tmp/cc4DJBiO.o: In function void ros::serialization::Serializer<unsigned char>::read<ros::serialization::IStream>(ros::serialization::IStream&, unsigned char&)': std_msgs_Bool_publisher.cc:(.text._ZN3ros13serialization10SerializerIhE4readINS0_7IStreamEEEvRT_Rh[void ros::serialization::Serializer<unsigned char>::read<ros::serialization::IStream>(ros::serialization::IStream&, unsigned char&)]+0x3a): undefined reference to ros::serialization::throwStreamOverrun()' collect2: ld gab 1 als Ende-Status zurück make: *** [std_msgs_Bool_publisher] Fehler 1


Originally posted by mikemodanoxxx on ROS Answers with karma: 33 on 2012-05-04

Post score: 2

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

I just went through same problem recently, the solution is pretty long.

  1. you have to install older version of GCC (4.0 or 4.1 or 4.2) in your system. I could not install it through Apt-get so had to manulay install it after downloading the setup. (I am using Ubuntu 10.04)
  2. Update in the symbolic links of Matlab ( user/.matlab/(MatlabVersion)/mexopts.sh) from "gcc" to version u installed, (eg: "gcc" to "gcc-4.1").
  3. Next problem I faced which you will also face probably. will be error in matlab while compiling "libstdc++.so.6:version GLIBCxx_3.4.9 not found". problem:ipc_bridge is expecting the above version of libstdc++, but matlab refers to the libstdc++ version which was shipped with itself. Solution:
    • check if libstdc++.so.6 is present in "usr/lib/libstdc++.so.6". If not then install the package
    • Update the "LDPATH_PREFIX" variable in file (MATLABINSTALLATIONPATH/bin/.matlab7rc.sh) for OPENGL to point to "usr/lib/libstdc++.so.6"
    • Still Matlab will try to override the pointer to its own libstdc++. So remove all c++ and g++ related files from (MatlabInstallation/sys/os/glnx86). So Matlab has no choice but to use the library you installed. (may cause a bit of unstability in matlab)

PS:Backup Every file you edit or Remove.


Originally posted by sj haque with karma: 46 on 2012-05-05

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$
0
$\begingroup$

Rosanswers logo

I had the exact same problem while using ROS Fuerte in Ubuntu 12.04, and MATLAB 2012a. You don’t need to roll back to an earlier version of Ubuntu the problem is in the the gcc and g++ symbolic links. On my Ubuntu 12.04 I had two versions so I changed the symbolic links in /usr/bin to the 4.4 versions by navigation to the directory and using the following code:

ln -s g++ g++-4.4 ln -s gcc gcc-4.4

I also changes the symbolic links to MATLAB's libstdc++.so.6 as shown in the answer at the link below: http://answers.ros.org/question/33326/matlab-engine-and-ros-library-incompatible/

Everything compiled fine and I was able to run the MATLAB publisher and subscriber tutorials at: https://alliance.seas.upenn.edu/~meam620/wiki/index.php?n=Roslab.IpcBridge


Originally posted by Gus with karma: 11 on 2012-08-26

This answer was NOT ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.