Ask Your Question
0

republishing the data from publisher

asked 2016-04-19 22:48:06 -0500

Zero gravatar image

Hi, I'm trying to subscribe the data from leddar/scan then publish it to rviz to compare after the median filtering the data will run off or not.

But after I collect it then publish it to rviz to visualize the data, it shows me a Vertical line compare to the leddar/scan visualize data.image description in the follow photo, the rainbow line is the leddar/scan and the white line is my collected then republish data.

My question is how to let the republish data become same display way with original data? It's this due to I miss some parameter or my collect data way was wrong? I can share the original cpp file with you by this link: https://drive.google.com/open?id=0B6J... inside the leddar.cpp was the original package src, the Readleddar.cpp was I writing to subscribe the data.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2016-04-20 01:38:43 -0500

updated 2016-04-20 06:19:41 -0500

The angle information (angle_min, angle_max, angle_increment) in your republished message are all zero. Looking at the code that most likely happens because you have not specified the parameter fov correctly, so your internal variable field_of_view gets set to 0 per default.

/edit: You can compute the field_of_view from the data you already have:

msg.angle_min = angles::from_degrees(-field_of_view / 2.0);
msg.angle_max = angles::from_degrees(field_of_view / 2.0);
msg.angle_increment = angles::from_degrees(field_of_view / BEAM_COUNT);

For instance, we know that BEAM_COUNT is 16, so computing field_of_view is straightforward. Computing it from the other two statements is even easier.

edit flag offensive delete link more

Comments

ok,thanks. let me try your method first.

Zero gravatar image Zero  ( 2016-04-20 01:59:10 -0500 )edit

Hi, I had try to look through the leddar.cpp program and find out the field_of_view where it to get the data from but I cannot find it. therefore, I cannot to specified, so it's there any way can teach me how to find out ? I mean like let field_of_view equal to some value?

Zero gravatar image Zero  ( 2016-04-20 02:42:17 -0500 )edit

See updated answer.

Stefan Kohlbrecher gravatar image Stefan Kohlbrecher  ( 2016-04-20 06:18:29 -0500 )edit

Thank you for your updated answer. Actually yesterday I had tried some similar way, because I find the fov get the value from launch file and the default value was 45. So i just simply initialize the field_of_view = 45, and it looks work for me.

Zero gravatar image Zero  ( 2016-04-20 20:06:29 -0500 )edit

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: 2016-04-19 22:48:06 -0500

Seen: 88 times

Last updated: Apr 20 '16