Simulating uav using gazebo and ros

Iam trying to give commands from terminal to simulate an iris drone which I loaded in gazebo
and it is not receiving when trying to do so

These are the commands Iam trying to give which are not reflecting in gazebo

Hi,
Have you followed this tutorial : http://ardupilot.org/dev/docs/using-gazebo-simulator-with-sitl.html ?
Can you be more specific about your experience. Is Gazebo working well, and you see the drone itself on the environment ?
Do you have data publishing in mavros, after running apm.launch ?
Can you list all the commands that you execute on the terminal, and the result (especially if there is any crash happening) ?

Hi,
I tried to follow the tutorial you mentioned and Iam getting these errors and gazebo is working fine help me to solve these errors

Obviously, you have a version problem with Gazebo. During the Cmake command, you can see “You need at least Gazebo 8.0. You version : 7.0”.
If you go the github of ardupilot_gazebo (https://github.com/khancyr/ardupilot_gazebo), you can see in the README.md that you need to be in a special branch to make it work for Gazebo 7.

So you need to use this branch : https://github.com/khancyr/ardupilot_gazebo/tree/gazebo7
For that, you have two choice : You can copy it directly from the github site.
Or you can change your git branch like this :

  • remove your build directory
  • cd ~/ardupilot_gazebo
  • git checkout gazebo7
  • mkdir build && cd build
  • cmake .. && make -j4 && sudo make install

I did as you said but iam facing some problem while performing
gazebo --verbose worlds/iris_arducopter_runway.world

I suggest you to use the command "gazebo --verbose (…) " in the folder ~/ardupilot_gazebo

You use the directory worlds/, which is not in the build.

why this so even after giving command in ~/ardupilot_gazebo$
Thank you

Check the README of ardupilot_gazebo github :

echo 'source /usr/share/gazebo/setup.sh' >> ~/.bashrc
echo 'export GAZEBO_MODEL_PATH=~/ardupilot_gazebo/models' >> ~/.bashrc
source ~/.bashrc

Then restart. Always read the README :wink: