0
$\begingroup$

Rosanswers logo

Hello, I'm working with the ROS kinetic of Ubuntu 16.04.

I'm also using Hokuyo's lidar sensor and recently realized that there are some strange data in the returned data of /scan topic.

The nan data, which stands for 'not a number', is that; if so, what is the 'nan'?

Although I've worked with a lidar sensor for over 2 years, I have no idea about when the nan data is created.

What's the nan in this? It doesn't matter when it comes to the g-mapping or other packages, but I need to do another work whit this data and nan makes no sense.

If someone familiar with lidar's range data is here, would you please give me some help?

The below is the /scan data including nan.

header: 
  seq: 6147
  stamp: 
    secs: 1627028918
    nsecs: 664962817
  frame_id: "base_footprint"
angle_min: -2.07394194603
angle_max: 2.07394218445
angle_increment: 0.00613592332229
time_increment: 2.71259814326e-05
scan_time: 0.0277769993991
range_min: 0.019999999553
range_max: 5.59999990463
ranges: [nan, nan, 2.802000045776367, 2.7309999465942383, 2.7090001106262207, 2.677000045776367,...]

Thanks :)


(add)

According to this page, I think the nan data might mean the max_range value. Is it right?


Originally posted by kane_choigo on ROS Answers with karma: 195 on 2021-07-23

Post score: 1


Original comments

Comment by Ktysai on 2021-07-23:
It's corect! There is no obstacle at the maximum reading range. BTW, you've tested this lidar only indoor?

Comment by kane_choigo on 2021-07-23:
@Ktysai Thanks for the kind comment. Yeah, I've never used it on the road..

Comment by Lennart on 2021-07-25:
Your linked questions (or the best answer to that) speaks from two modes ( urg_node or the hokuyo_node). Which mode are you using? Which error code do you get?

$\endgroup$

3 Answers 3

0
$\begingroup$

Rosanswers logo

If the driver follows REP-117, NAN means "erroneous, invalid or missing measurement". While not every ROS driver follows REP-117, most do.


Originally posted by fergs with karma: 13902 on 2021-07-25

This answer was ACCEPTED on the original site

Post score: 3


Original comments

Comment by kane_choigo on 2021-07-25:
Yeah, you're right. I just modified those nan data to be the max_range value, and it worked. Although all the nan doesn't mean out of range, it would be up to the user :)

$\endgroup$
0
$\begingroup$

Rosanswers logo

As far as I know, nan has no standard interpretation beyond "ray value is not in supported range". In general, you can't interpret it as "greater than range_max", although with testing you might decide that is true for your specific lidar. What I do is ignore a ray with this value.


Originally posted by Mike Scheutzow with karma: 4903 on 2021-07-23

This answer was NOT ACCEPTED on the original site

Post score: 1

$\endgroup$
0
$\begingroup$

Rosanswers logo

It seems not to be a ROS specific question but a LIDAR specific question. nan means mostly the LIDAR didn't received the his laser-ray. The most reasonable answer is "out of range". It could also have other reasons like bright light as noise or "bad" surfaces that don't reflect the ray back to the LIDAR. At your place I would search the answer to your question in first point by the LIDAR. I guess it's a measuring issue.


Originally posted by Lennart with karma: 40 on 2021-07-25

This answer was NOT ACCEPTED on the original site

Post score: 1


Original comments

Comment by kane_choigo on 2021-07-25:
Thanks for the answer. I'm using urg_node, so I couldn't sure whether the nan really comes from 'out of range'. I still can't say all the nan should mean that clearly, it seems I need to check the test room concerning a surface or reflected light more carefully.

For the error message, I didn't get any messages but only the bugs without them, which is one of the most annoying situations :)

$\endgroup$

Your Answer

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