Robotics StackExchange | Archived questions

an error in rosmatlab usage

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,

Asked by A.M Dynamics on 2015-07-06 09:33:21 UTC

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?

Asked by gvdhoorn on 2015-07-07 02:39:52 UTC

Thanks for your notice. I added those information.

Asked by A.M Dynamics on 2015-07-07 08:56:41 UTC

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

Asked by gvdhoorn on 2015-07-07 10:38:57 UTC

Yes I use the official Robotics System toolbox

Asked by A.M Dynamics on 2015-07-07 11:28:53 UTC

Answers