an error in rosmatlab usage

asked 2015-07-06 09:33:21 -0500

A.M Dynamics gravatar image

updated 2015-07-07 11:28:23 -0500

Dear all,

I created a publisher in ROS which publishes messages successfully. I want to receive these messages by Matlab. This my code in Matlab (Ubuntu 12.04 64bit, ROS Hydro, Matlab2015a, toolbox: robotics system toolbox):

function test_ros
import rosmatlab.*
roscore = rosmatlab.roscore(11311);
node = rosmatlab.node('NODE', [], 11311);
subscriber = rosmatlab.subscriber(....
.
.
end

but Matlab gives me these errors:

Undefined variable "rosmatlab" or class "rosmatlab.roscore".

Error in test_ros (line 13)
    roscore = rosmatlab.roscore(11311);

or

enterUndefined variable "rosmatlab" or class "rosmatlab.node".

Error in test_ros (line 17)
     node = rosmatlab.node('NODE', [], 11311);

Dose anyone have any idea what the problem is? Thanks,

edit retag flag offensive close merge delete

Comments

Please add which specific pkgs you are using, which version of Matlab, any toolboxes (the official Mathworks ROS support, or any of the toolboxes created by the community fi). Also, which OS?

gvdhoorn gravatar imagegvdhoorn ( 2015-07-07 02:39:52 -0500 )edit

Thanks for your notice. I added those information.

A.M Dynamics gravatar imageA.M Dynamics ( 2015-07-07 08:56:41 -0500 )edit

You forgot to include which toolbox you are using, but I'm guessing the official Robotics System toolbox?

gvdhoorn gravatar imagegvdhoorn ( 2015-07-07 10:38:57 -0500 )edit

Yes I use the official Robotics System toolbox

A.M Dynamics gravatar imageA.M Dynamics ( 2015-07-07 11:28:53 -0500 )edit