arshadlab / gazebo_map_creator

Apache License 2.0
32 stars 9 forks source link

gazebo not opening with the .so file #3

Open madhu-korada opened 7 months ago

madhu-korada commented 7 months ago
gzserver: symbol lookup error: /home/madhu/work/gazebo_map_creator_ws/install/gazebo_map_creator/lib/libgazebo_map_creator.so: undefined symbol: _ZN10gazebo_ros4Node3GetEv

When I try to run gazebo -s libgazebo_map_creator.so myworld.world command I get the above issue. What could be the issue here?

arshadlab commented 7 months ago

Looks like you haven't sourced ROS2 env before initiating gazebo launch. e.g source /opt/ros/<humble|foxy>/setup.bash

madhu-korada commented 7 months ago

I don't think that is the case. I have sourced the environments correctly. But I also have ROS 1 in my environment, could that cause this issue?

webtjs commented 2 days ago

I also faced this issue and I too have both ROS 1 (Noetic) and ROS 2 (Foxy) installed on my system. I managed to find a solution which involves modifying the ~/.bashrc file. When I previously installed ROS 1, I ran echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc in my shell which automatically sources ROS 1 whenever a shell is opened. Hence when sourcing ROS 2, two different versions of ROS are being sourced in the same environment. This results in issues with the rosdep tool, and might also be what's causing this issue wth gzserver.

After opening the ~/.bashrc file and removing the line source /opt/ros/noetic/setup.bash, I created a new workspace and followed the guide again which got it to work.