Simple publisher in rosmatlab
Hi,
I am trying to write a simple publisher using rosmatlab, rosmatlab is installed perfectly and I can access ros-api (limited functionality) in the matlab command window, however I am having hard time advertising a topic, here's the matlab script:
argc=1;
argv='';
ros.init(argc,argv,'mat_ros');
P = ros.Publisher;
topic_name = 'chatter';
msg_type = 'std_msgs.String';
queue_size = 1000;
P.advertise(topic_name,'std_msgs.String',1000);
Error:
Error using internal
[ROS] Publisher.advertise: unknown datatype 'std_msgs.String'
Error in ros.Publisher/advertise (line 38)
result = internal(obj, 'advertise', topic, datatype,
varargin{:});
I have tried to change the datatype to 'String', 'string','ros_string' etc etc but still I am getting the same error. If I pass second arguments without the quotes, then I get this:
P.advertise(topic_name, std_msgs.String,1000);
Error using internal
[ROS] Publisher.advertise: need a datatype as 2nd argument
Error in ros.Publisher/advertise (line 38)
result = internal(obj, 'advertise', topic, datatype,
varargin{:});
Any idea how can I get rid of this data-type error ? If someone can please share a simple publisher/subscriber script for rosmatlab ? as the wiki page of rosmatlab only has the installation instructions and no sample code.
Thanks
Regards,
Usama