Ask Your Question
0

How to detect obstacles using Laser Scanner Data?

asked 2014-11-13 15:12:05 -0500

ish45 gravatar image

updated 2014-11-13 15:45:50 -0500

I am simulating a mobile robot in Stage Simulator. The laser scanner is publishing data on the /base_scan topic. I have never worked with a laser scanner before and am new to ROS.

Can anybody please give me an idea on how to obtain this data inside a python program. Which message type is used for obtaining data from the laser scanner?

Thanks

the data from /base_scan is like this:

range_min: 0.0 range_max: 4.0 ranges: [3.2056713104248047, 3.2168056964874268, 3.2290120124816895, 3.2423102855682373, 3.2567219734191895, 3.272271156311035, 3.2889835834503174, 3.306887626647949, 3.3260140419006348, 3.34639573097229, 3.3680689334869385, 3.3910720348358154, 3.4154467582702637, 3.4412381649017334, 3.4684946537017822, 3.497267961502075, 3.359632730484009, 3.2770864963531494, 3.194019079208374, 3.110328435897827, 1.5129541158676147, 1.4703233242034912, 1.427213430404663, 1.3835630416870117, 1.3393069505691528, 1.3560137748718262, 1.3111344575881958, 1.2654712200164795, 1.2189438343048096, 1.2365480661392212, 1.1890031099319458, 1.1403684616088867, 1.1586997509002686, 1.1087034940719604, 1.1278331279754639, 1.115450382232666, 1.0969479084014893, 1.0793750286102295, 1.062677264213562, 1.0468045473098755, 1.0317111015319824, 1.0173543691635132, 1.0036956071853638, 0.9906986355781555, 0.9783303737640381, 0.9665601253509521, 0.9553593993186951, 0.9447018504142761, 0.934563159942627, 0.9249205589294434, 0.9157530665397644, 0.9070411324501038, 0.8987666368484497, 0.890912652015686, 0.8834635019302368, 0.8764046430587769, 0.8697224259376526, 0.8634043335914612, 0.8574385643005371, 0.851814329624176, 0.8465214371681213, 0.8415506482124329, 0.8368931412696838, 0.8325410485267639, 0.8284868597984314, 0.8247238397598267, 0.8212457299232483, 0.8180468678474426, 0.8151219487190247, 0.8124663233757019, 0.8100757598876953, 0.8079464435577393, 0.8060749769210815, 0.8044584393501282, 0.8030943870544434, 0.8019806146621704, 0.8011154532432556, 0.8004975318908691, 0.8001258969306946, 0.800000011920929, 0.8001196980476379, 0.8004850745201111, 0.8010967373847961, 0.8019556403160095, 0.8030630946159363, 0.8044207692146301, 0.8060308694839478, 0.807895839214325, 0.8100185990333557, 0.8124024868011475, 0.8150513768196106, 0.8179693818092346, 0.8211612701416016, 0.8246322274208069, 0.8283879160881042, 0.8324346542358398, 0.8367791175842285, 0.8414287567138672, 0.8463915586471558, 0.8516761660575867, 0.8572918772697449, 0.8632488250732422, 0.8695579171180725, 0.8762307167053223, 0.8832798600196838, 0.890718936920166, 0.898562490940094, 0.9068261384963989, 0.9155267477035522, 0.9246824383735657, 0.9343127608299255, 0.944438636302948, 0.9550827145576477, 0.9662693738937378, 0.9780248403549194, 0.9903776049613953, 1.0033581256866455, 1.0169998407363892, 1.0313383340835571, 1.046412706375122, 1.0622650384902954, 1.0789412260055542, 1.0964913368225098, 1.1149696111679077, 1.1283310651779175, 1.1091760396957397, 1.1591765880584717, 1.1408215761184692, 1.189459204673767, 1.2370057106018066, 1.219379186630249, 1.2659071683883667, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 0.9764657616615295, 0.9290837049484253, 0.8815606832504272, 0.8338493704795837, 0.7859013080596924, 0.7376668453216553, 0.6890949606895447, 0.6401330828666687, 0.590726912021637, 0.5949020981788635, 0.5993220210075378, 0.5490862131118774, 0.5535722374916077, 0.5024743676185608, 0.5069640874862671, 0.45483845472335815, 0.45926356315612793, 0.46391940116882324, 0.4102139472961426, 0.41471847891807556, 0.41945314407348633, 0.42442893981933594, 0.36827796697616577, 0.37298741936683655, 0.37793633341789246, 0.3831374943256378, 0.3238372802734375, 0.3286275565624237, 0.3336655795574188, 0 ... (more)

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2014-11-14 05:10:45 -0500

dornhege gravatar image

You should probably learn to use the basic ROS tools. rostopic info /base_scan will tell you the message type that is being published and rosmsg show sensor_msgs/LaserScan will display that message type for you.

In this case check out sensor_msgs/LaserScan.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2014-11-13 15:12:05 -0500

Seen: 898 times

Last updated: Nov 14 '14