Ask Your Question
1

Subscribe /ar_pose_marker in matlab [closed]

asked 2017-03-04 18:09:53 -0600

Paulo gravatar image

Hello, I am having a problem with matlab and ROS. I would like to subscribe /ar_pose_marker in matlab but i am getting a error

Thats the Matlab code:

clear,close, clc;

%addpath(genpath('/home/Downloads/email'));
%addpath('/home/Downloads/email');

global pos;
 setenv('ROS_MASTER_URI','http://paulo-Inspiron-7537:11311')
 setenv('ROS_IP','192.168.1.2')

rosinit('http://paulo-Inspiron-7537:11311','NodeHost','192.168.1.2','NodeName','/teste')
camera = rossubscriber('/ar_pose_marker',@getPose);

Thats the error that I get:

Initializing global node /teste with NodeURI http://192.168.1.2:34676/
Error using qr_pose (line 13)
Failed to create a subscriber with topic name /ar_pose_marker and type ar_track_alvar_msgs/AlvarMarkers.

And if I try to do rostopic echo /ar_pose_marker on matlab I also get these error:

>> rostopic echo /ar_pose_marker
Failed to create a subscriber with topic name /ar_pose_marker and type ar_track_alvar_msgs/AlvarMarkers.

There is no problem in ROS Linux terminal, the rostopic echo is working and also a Subscribe code that I made on cpp.

Does anybody have a clue ? Edit: I am using Kinetic on Ubuntu 16. Other things are working on matlab like subscribing /turtle1/pose Thanks for your help, I really appreciate it !!!

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by tfoote
close date 2019-09-20 02:44:25.915682

Comments

Have you posted as much code as you can? I have a feeling you may have not, because I don't see where you're trying to use qr_pose.

130s gravatar image130s ( 2017-04-18 21:48:16 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-06-18 16:02:39 -0600

martine gravatar image

hi guys

I have the same error. Anybody found a solution?

My connection with the ros master is successful. I can list the nodes and topics. However, the echoing gives me the 'Failed to create a subscriber error'.

The node that is publishing the topic I am trying to echo is running on a third computer (i.e. not the master and not my remote computer running matlab). This third computer has a hostname COMPUTER1. When I rosnode info the node that publishes the topic I want to monitor, it tells me the URI is [ http://COMPUTER1:33117/ ]. The problem seems to be that COMPUTER1 is not recognized as an host or something. I already added COMPUTER1 and its IP address to C:\Windows\System32\drivers\etc. I am able to ping COMPUTER1 from a terminal.

Anybody has any idea what's going on here? Thank you Martine

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2017-03-04 17:48:15 -0600

Seen: 217 times

Last updated: Mar 04 '17