Cannot see gazebo in env variables

Hi !

I ran Turtlebot3 gazebo on my local machine but the issue is that when I run :slight_smile:

env | grep GAZEBO

I cannot see anything on the terminal . But the course says I must see localhost as hostname.
Screenshot from 2023-12-07 16-32-39

Can you please guide me why ?

Hi @muhammadjunaid

You asked that when u enter env | grep GAZEBO, you don’t see localhost id as in the course. Well, the command env | grep GAZEBO is used to check the environment variables related to Gazebo. If you’re not seeing any output, it could mean that the Gazebo environment variables are not set.

You can set the Gazebo environment variables in your shell startup script (like .bashrc or .bash_profile), so they get loaded every time you open a new terminal. Here’s an example of how to do this:

echo "export GAZEBO_MASTER_URI=http://localhost:11345" >> ~/.bashrc
source ~/.bashrc

After running these commands, try the env | grep GAZEBO command again. You should now see the GAZEBO_MASTER_URI variable set to your localhost.

Please replace localhost and 11345 with your actual hostname and port if they are different. If you’re still having issues, please let me know!

Awais Adis

HI @Awais_Adis !

Thanks for your response. I have been using gazebo without have to set these Gazebo environment variables and Gazebo is working perfectly without any errors.

Why are these environment variables important then ?

Best regards,
Muhammad Junaid

1 Like

Only Environment Variable, GAZEBO_MODEL_PATH is important. You can export in Terminal as:

export GAZEBO_MODEL_PATH=<Your_Gazebo_Models_Path>

Because this path is used to locate custom models (if any) used and loaded in Gazebo Simulation.

1 Like

Hi @muhammadjunaid !
It seems that u are not using Constructsim’s setup, because normally, Constructsim’s setup has all the essential packages and variables sorted up( you don’t have to set them up yourself). And entering the command env | grep GAZEBO would have given you the specified output.
But if u are doing it on your own setup, and you have installed gazebo, then u have to include the environment variables yourself.
So if u are using Constructsim’s setup, then just reload the website, and try it again and it should work fine. Otherwise, enter the above-mentioned commands in yr CLI and your output would be the same as specified too.
Hope this helps!

Awais Adis

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.