Robotics StackExchange | Archived questions

Reading data from AR.Drone 2.0 with ROS and sending to Matlab through IPC

Hi,

I'm trying to use IPC to send data collected from the Parrot's AR.Drone 2.0 with ROS to Matlab R2009a, but empty structures are read.

I've followed the tutorial at Penn Robotics.

After some known arrangements, the "Run the example matlab subscriber" works and I'm able to understand (I guess) how matlabsubscriberexample.launch and ipcbridgeexample/example_subscriber.m work.

Currently I'm trying to send information from the topic /ardrone/imu (which is a topic type sensor_msgs/Imu, supported by IPC) to Matlab, but I can get it.

My publisher launcher, similar to the example, is:



so, I made changes to: 1. node pkg="ipcsensormsgs" 2. type="sensormsgsImu_subscriber" 3. from="/ardrone/imu" 4. value="imu"

The Matlab subscriber is:


% IPC-Bridge Example Subscriber % 1/24/2011 % Ben Cohen clear all; clc;

% add the ipcbridgematlab binaries to your path %[a, p] = system('rospack find ipcgeometrymsgs') %addpath(strcat(p, '/bin')); addpath('/opt/ros/fuerte/stacks/ipcmsgs/ipcsensor_msgs/bin')

% create a publisher that publishes a geometrymsgs/Twist message pid=sensormsgsImu('connect','subscriber','examplemodule','imu');

% create an empty geometrymsgs/Twist message structure msg=sensormsgs_Imu('empty');

% read a message and print to screen while (1) msg = sensormsgsImu('read',pid,100) %msg.linear.x %msg.linear.y %msg.linear.z %msg.angular.x %msg.angular.y %msg.angular.z end


hence, changes are: 1. addpath('/opt/ros/fuerte/stacks/ipcmsgs/ipcsensormsgs/bin') 2. pid=sensormsgsImu('connect','subscriber','examplemodule','imu'); 3. msg=sensormsgsImu('empty'); 4. msg = sensormsgsImu('read',pid,100)

I did chmod +x on the publisher launch and everything is running, but it is returned in the command window that a 0-by-1 Cell is obtained.

Thanks for your help.

Asked by Cecilio Angulo on 2013-01-27 23:29:12 UTC

Comments

Answers