ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

a problem which readings from lidar data through node

asked 2017-03-12 14:11:05 -0500

Petr gravatar image

updated 2017-03-13 13:52:37 -0500

Hello,

On my Raspberry Pi 2B Ubuntu Mate 1604 running ROS kinetic and is connected Lidar Hokuyo URG-04LX. Data from lidar I needed to get into Matlab 16b running on a laptop.

In Matlab see a list of nodes from ROS, urg_out can even ping from lidar data but I read wrong.

Raspberry Pi is a laptop connected via an Ethernet cable, IP adress settings is OK.

rpi orders:
settings Lidar:
cd ..
cd ..
cd ..
sudu chmod 777 dev/ttyACM0

run roscore:
cd /opt/ros/kinetic/bin
roscore

another console:
cd
cd catkin_ws/devel
./setup.bash
rosrun urg_node urg_node

RPI will establish a master ros to the desired address.
rpi write - streaming data

Matlab code:

clc;
close all;
clear all;

rosshutdown
rosinit ('192.168.1.10')

rostopic list
rostopic info /scan
rs=rossubscriber('scan')
receive(rs, 100)

Matlab write:
Operation terminated by user during robotics.ros.internal.Util/waitUntilTrue (line
67)


In robotics.ros.Subscriber/receive (line 322)
                util.waitUntilTrue( @() obj.MessageListener.isNewMessage, timeout );

In Matlab_lidar (line 11)
receive(rs, 100)

The problem is that matlab does not list data from lidar. Please do not know what could be wrong?

Thank you for your help.

edit retag flag offensive close merge delete

Comments

"But I read data wrong" sounds like the problem here, but there's nothing in that description that might help debug the issue. You'll get better answers if you post your matlab code and post or describe the output, what you think it should be doing, and what it is actually doing.

ahendrix gravatar image ahendrix  ( 2017-03-12 15:08:09 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2017-03-13 14:38:15 -0500

ahendrix gravatar image

This looks vaguely like a network issue; I advise that you read the ROS Network Setup and ROS Multiple Machines tutorials and make sure that the ROS_MASTER_URI and hostnames are configured correctly on your machines, and that you can do a rosnode ping from the computer running matlab to the urg_node on your Raspberry Pi. I don't know much about the ROS bindings for Matlab, so the commands in matlab may be a little different from the tutorials.

edit flag offensive delete link more

Comments

Thank you very much for the comment and interest. Raspberry and computer goes to ping each other.

Petr gravatar image Petr  ( 2017-03-19 13:14:14 -0500 )edit

I tried it yet again. Ping rosout passes, ping urg_node fails. Please do not know what could be wrong? Thank you.

Petr gravatar image Petr  ( 2017-03-26 07:14:11 -0500 )edit

It sounds like something is missing from your network setup, but it's difficult to debug this without seeing the complete configuration of the routes, IP address assignments, ROS_IP, ROS_HOSTNAME, ROS_MASTER_URI, which nodes are running, which machine they're on, and rosnode info for every node.

ahendrix gravatar image ahendrix  ( 2017-03-26 17:46:32 -0500 )edit

If the wiki doesn't help, I suggest you watch my talk about networking and read the slides from ROSCon 2013.

ahendrix gravatar image ahendrix  ( 2017-03-26 17:47:48 -0500 )edit

Question Tools

Stats

Asked: 2017-03-12 14:11:05 -0500

Seen: 432 times

Last updated: Mar 13 '17