0
$\begingroup$

Rosanswers logo

Dear all,

I am currently investigating several methods for how Matlab code can be used within ROS.

I was able to use rosbridge to exchange data with Matlab. However, this requires a lot of ASCII-parsing on the Matlab side.

Then I found out about the possibility to package Matlab code into C++ shared libraries using the Matlab Compiler toolbox (deploytool). This would have been the ideal solution to my problem since Matlab would not need to be running and still ROS could use the Matlab functionality. However, because Matlab comes with its own Boost libraries integrated (version 1.44) it is not possible to use these shared libraries within ROS (linked against Boost version 1.46 under Ubuntu 12.04). Is there anyone else who tried to use Matlab shared libraries within ROS? And succeeded?

I also found the IPC-Bridge approach (IPC-Bridge) and TU Darmstadt's rosmatlab. However, both will need a running Matlab.

Furthermore, although IPC-Bridge solves the ASCII parsing problem, it is limited to support topic communication. Or has support for services been added already?

As to rosmatlab, linking ROS against Matlab's Boost libraries is not really suitable for my problem as I use other software packages depending on Boost as well. So it would get really nasty.

Anyway, I would like to hear about your experiences with any of the proposed solutions!

Best regards, Felix


Originally posted by Felix Messmer on ROS Answers with karma: 198 on 2013-03-12

Post score: 1

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

Giampiero Campa at MathWorks recently put up a well organized page documenting the different methods of communicating between Matlab & ROS here:

http://www.ros.org/wiki/groovy/Planning/Matlab


Originally posted by ben with karma: 674 on 2013-03-12

This answer was NOT ACCEPTED on the original site

Post score: 3

$\endgroup$
0
$\begingroup$

Rosanswers logo

Thank you, Ben. I already knew about the ROS Matlab SIG.

After reading about all the various approaches, I tried to test the IPC-Bridge approach. (Most importantly because I don't want to compile ROS from source against Matlab libs ;)

Firstly, my settings are the following: I am using ROS Fuerte under Ubuntu 12.04 with Matlab R2012b

I tried to follow the installation here.

In step 4, I simplified the LD_LIBRARY_PATH since all ROS libs are now in /opt/ros/fuerte/lib. Thus, my environment variables look like this:

/home/fxm/projects/miror/ipc-bridge/ipc_bridge_stack/ipc/lib:/opt/ros/fuerte/lib

The compilation of ipc_bridge_ros works fine as well.

But when running

roscd ipc_roslib && make

I get the following error messages:

fxm@sony-fxm:~$ roscd ipc_roslib && make
bash -c "mkdir -p bin"
bash -c "`rospack find ipc_bridge`/generate_msgs.sh ."
Generating roslib_Header.h
mex  -I./include   -I/home/fxm/projects/miror/ipc-bridge/ipc_bridge_stack/ipc_bridge_matlab/include  -I/home/fxm/projects/miror/ipc-bridge/ipc_bridge_stack/ipc_bridge/include  -I/home/fxm/projects/miror/ipc-bridge/ipc_bridge_stack/ipc/include -I/home/fxm/projects/miror/ipc-bridge/ipc_bridge_stack/ipc_bridge/include -lstdc++ -L/home/fxm/projects/miror/ipc-bridge/ipc_bridge_stack/ipc/lib -lipc mex/roslib_Header.cc -output bin/roslib_Header

Warning: You are using gcc version "4.6.3-1ubuntu5)".  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/

echo  -L/opt/ros/fuerte/lib
-L/opt/ros/fuerte/lib
echo  -lroscpp  -lrostime  -lrosconsole  -lroscpp_serialization  -lxmlrpcpp
-lroscpp -lrostime -lrosconsole -lroscpp_serialization -lxmlrpcpp
fxm@sony-fxm:~/projects/miror/ipc-bridge/ipc_msgs/ipc_roslib$ 

I can see that something is wrong with an unsupported mex-compiler within Matlab, but I don't know how to change the settings.

Has anyone worked with the IPC-Bridge under ROS-Fuerte? Does anyone know how to fix this?

And finally, is the IPC-Bridge still only supporting topic communication or has the service functionality been added yet?

Any help is appreciated!


Originally posted by Felix Messmer with karma: 198 on 2013-03-20

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by Procópio on 2013-03-21:
Please, bear in mind that this site is not a forum, so you should only post answers to the original question, and NOT responding to some given answer and asking a bunch of other stuff. You should mark the answer from @ben as correct, delete your answer and create a new question, with your new doubt.

Comment by odestcj on 2013-03-21:
Procópio, your comment seems overly strict and pedantic. I appreciated Felix's follow up questions and learned something from it. If we cannot have discussions and follow up on answers.ros.org, maybe such discussions should move back to ros-users.

Comment by Procópio on 2013-03-21:
Sorry, but it was not my intention. I am just trying to explain the proper way of using this website. Sure Felix post was interesting, but essentially he posted a question as the answer to a question. Asking a new question will trigger alerts and there is a higher chance people will see it and help.

Comment by Procópio on 2013-03-21:
I kindly suggest you read http://answers.ros.org/help/ (no pedantic intended)

Comment by odestcj on 2013-03-21:
I understand. Thanks for your kind explanation. That said, I think ros-users was better for facilitating this type of discussion at the cost of search-ability and larger email inbox.

Comment by Felix Messmer on 2013-03-23:
Procópio, to be honest (and I don't want to be rude), I am sick of reading "please use the forum" on answers.ros.org or "please use ros-answers" on the forum! There is no contribution to the question within your comment. Sorry!

Comment by Procópio on 2013-03-25:
@Felix Messmer I understand. But I have not suggested you to use the ROS forum, I suggested you to create a new question with your post. I think it is well written and useful, but the benefits for the community and for you could be bigger, if it was posted as a new question. Cheers!

$\endgroup$

Your Answer

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