coincar-sim / lanelet_rviz_plugin_ros

BSD 3-Clause "New" or "Revised" License
32 stars 11 forks source link

Map is not displayed on some machines #9

Closed autonomobil closed 4 years ago

autonomobil commented 4 years ago

Hey, I use the plugin to visualize a lanelet map in rviz and it works well on my machine. All the lines of the lanelets are displayed.

However if I try it on another machine (same code, same OS, same ROS version, etc.) nothing is displayed in rviz. There is no error or warning message, everything seems ok. I checked in _laneletplugin.cpp if the map pointer and origin frame id are received and that is the case. Can somebody give me a hint where to look to solve this problem?

image

m-naumann commented 4 years ago

Hi Moritz, my guess is that the decimal "point" is the problem: At least in rviz, it is , but should be .. You should see this error(edit: warning) in your console.

Could you try to set it to . as in the full simulation framework setup (Or simply install/launch the full framework on the machine with problems, as described here)?

autonomobil commented 4 years ago

You are right!

With (in terminal were rviz is started)

export LC_NUMERIC="en_US.UTF-8"

or

(in launch file which starts rviz)

    <!-- Define point instead of comma as decimal seperator -->
    <env name="LC_NUMERIC" value="en_US.UTF-8"/>

it works.

The only thing: There was no warning whatsoever. Would it make sense to change std::cerr to ROS_ERROR_STREAM ?

m-naumann commented 4 years ago

Perfect.

Thanks for the hint, displaying the warning in rviz would be the best I guess, we'll look into that. (ROS_ERROR_STREAM is not possible because lanelet2 is ROS-independent)

Wing-ka-king commented 3 years ago

Hi! On my machine, I cannot visualize any lanelet from the map on rviz even after setting the export LC_NUMERIC="en_US.UTF-8". I see no error while launching the sample_lanelet_viz.launch file. Screenshot from 2020-12-30 11-47-33

m-naumann commented 3 years ago

Could you please pull again and try again? Actually, the sample launchfile was missing the lat lon arguments (default values were removed in lanelet2_interface_ros) so I wonder why it did start at all on your machine. If you just set lat and lon to 0 each, the map is displayed but somewhere far away from the origin of the map frame

Wing-ka-king commented 3 years ago

Yeah, it works now. Also, for my custom osm maps, besides changing the lat and lon, I also had to change x-y focal points in rviz settings file to locate the map.

m-naumann commented 3 years ago

It is implemented such that 0,0 of the map frame is exactly in the lat lon coordinates you specify. So if you set the origin correctly, there should be no need do change xy