bitcraze / crazyflie-simulation

MIT License
68 stars 27 forks source link

Unable to start ignition gazebo simulation from README instructions #23

Closed electrobusy closed 6 months ago

electrobusy commented 2 years ago

Hej Kimberly,

After following your README instructions, I am unable to start the simulation, because it seems that it can't locate simulation world:

electrobusy@mmk-laptop:~$ ign gazebo crazyflie_world.sdf 
Unable to find or download file 

Environment variable set in bashrc file:

(...)

source /opt/ros/noetic/setup.bash
source catkin_ws/devel/setup.bash --extended

# add path to where crazyflie gazebo ignition sim files are
export IGN_GAZEBO_RESOURCE_PATH="$HOME/crazyflie-simulation/gazebo-ignition/"

After sourcing it (knowing that Ignition gazebo looks for IGN_GAZEBO_RESOURCE_PATH* as mentioned here under "Models, lights, actors"), the absolute paths seem to be correctly set:

electrobusy@mmk-laptop:~$ echo $IGN_GAZEBO_RESOURCE_PATH*
/home/electrobusy/crazyflie-simulation/gazebo-ignition/controllers /home/electrobusy/crazyflie-simulation/gazebo-ignition/crazyflie /home/electrobusy/crazyflie-simulation/gazebo-ignition/worlds
electrobusy@mmk-laptop:~$ echo $IGN_GAZEBO_RESOURCE_PATH
/home/electrobusy/crazyflie-simulation/gazebo-ignition/
electrobusy@mmk-laptop:~$ ign gazebo crazyflie_world.sdf 
Unable to find or download file 

Some questions (that might help me):
1) Did you happen to install ignition from source or binaries? 2) Have you set any other environment variables (for ignition gazebo)?

Thank you,
Rohan

Ps.: I am using Ubuntu 20.04 with Ignition gazebo 6.9.0 (Ignition Fortress)

knmcguire commented 2 years ago

Hi! Let's try to solve this for you.

  1. I installed ignition from binaries
  2. Yes I do, which is IGN_GAZEBO_SYSTEM_PLUGIN_PATH, but that is for building the controller. that is still not working yet, see this issue #6. This is not what should have affected you what you are having now though.

Perhaps the export should point to the world folder instead? Sorry, I have it setup on my old computer as I'm now converting to my new one, so I can't double check it right now.

knmcguire commented 2 years ago

So some more information on my previous system now that I got a hold of it again:

Ignition gazebo: 6.6.0 Ubuntu 20.04

In .bashrc: export IGN_GAZEBO_RESOURCE_PATH="$HOME/Development/Bitcraze/Simulation/crazyflie_simulation/gazebo-ignition/"

I indeed get the same issue as you, and now I remember why. The IGN_GAZEBO_RESOURCE_PATH is not for the world file, but to find the crazyflie model. So you would need to still cd into the worlds folder in order to run that .sdf file. But I also saw that the world folder itself can be added to the IGN_GAZEBO_RESOURCE_PATH as well, so I'll update the readme.

electrobusy commented 2 years ago

Sorry for the late reply.

I tried your latest fix and, after sourcing the bashrc file, it still does not find the world file.

I only managed to run the simulation with the following steps: 1) cd to the crazyflie folder and run the .config file (to load the 3D model of the crazyflie): ign gazebo model.config 2) cd to the worlds folder and run the crazyflie_world.sdf file

NOTE: I also tried to set the IGN_GAZEBO_SERVER_CONFIG_PATH with the (absolute) path of .config file. Surprisingly, even that did not make a difference.

# add path to where gazebo ignition sim files are 
export IGN_GAZEBO_RESOURCE_PATH="$HOME/crazyflie-simulation/gazebo-ignition/":"$HOME/crazyflie_simulation/gazebo-ignition/worlds/"
export IGN_GAZEBO_SERVER_CONFIG_PATH="$HOME/crazyflie-simulation/gazebo-ignition/crazyflie/model.config"

Ps.: I wonder if the ign gazebo version difference plays a role here (to be checked on my side whenever I get the chance)

knmcguire commented 2 years ago

ah oke.. at least you got it to run.

I'm afraid then that this is an issue that we have to pass to the gazebo answers then. Wonder if this has anything with the name change they have done, as they reverted it all back to good old 'only' gazebo, not ignition gazebo.