0
$\begingroup$

Rosanswers logo

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.33896613121032715, 0.34454524517059326, 0.35042041540145874, 0.3505733013153076, 0.34469038248062134, 0.3391039967536926, 0.33379659056663513, 0.3287521004676819, 0.3239557445049286, 0.31939390301704407, 0.31505414843559265, 0.31092482805252075, 0.3069953918457031, 0.30325591564178467, 0.29969730973243713, 0.2963111102581024, 0.29308953881263733, 0.2900252938270569, 0.28711166977882385, 0.28434237837791443, 0.2817116379737854, 0.2792140245437622, 0.2768445312976837, 0.27459844946861267, 0.27247148752212524, 0.2704595923423767, 0.26855897903442383, 0.26676619052886963, 0.26507797837257385, 0.26349136233329773, 0.2620035409927368, 0.26061195135116577, 0.25931423902511597, 0.2581081986427307, 0.25699183344841003, 0.2559632658958435, 0.2550208568572998, 0.25416308641433716, 0.25338855385780334, 0.25269606709480286, 0.2520844638347626, 0.25155285000801086, 0.2511003613471985, 0.2507263123989105, 0.2504301071166992, 0.25021126866340637, 0.2500695288181305, 0.2500045895576477, 0.2500164210796356, 0.25010499358177185, 0.25027045607566833, 0.2505130469799042, 0.2508331835269928, 0.2512313425540924, 0.25170812010765076, 0.25226426124572754, 0.2529006898403168, 0.2536183297634125, 0.25441834330558777]


Originally posted by ish45 on ROS Answers with karma: 151 on 2014-11-13

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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.


Originally posted by dornhege with karma: 31395 on 2014-11-14

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.