I was wondering if someone could help me out setting up a simulation environment for testing missions or guided-mode dronekit python scripts.
So far I understand that there is a SITL file in the install directory for ardusub. I was wondering what other components of this do I need to successful send the simulated drone commands, and more specifically what each component does? And for example would I link the SITL to gazebo? I saw that there is a gazebo plugin on the bluerobotics github, do I need this and what exactly does it do ?
I’m sorry if these questions are elementary, it is just I’m struggling to find a tutorial specific to ardusub.
Sorry for taking so long to reply. I did a small documentation to help you with your simulation environment, this same documentation will be added in ardusub.com in the future.
S.I.T.L (Software In The Loop)
SITL is a simulator that allows you to run ArduSub without any hardware. It is a build of the autopilot code using an ordinary C++ compiler, giving you a native executable that allows you to test the behaviour of the vehicle.
Installation
To configure and run SITL for the first time in your computer, take a look in Running SITL ArduPilot documentation.
Running ArduSub SITL
This part assumes that you have already set up SITL on your machine.
First is necessary to be inside ArduSub folder.
Install ardupilot_gazebo/add_link plugin for ardupilot-gazebo communication. add_link is a branch that provides actuation over sdf links, after the git clone, it’s necessary to run git checkout add_link.
I really appreciate the help! So I’m trying to setup Gazebo but I keep running into low level problems. Particularly with building the freebuoyancy plugin. I cannot seem to find a version number for which that plugin was designed for. The cpp file in the src folder makes me think it is not the current version as it is not using ignition math. Seeing as the next step says to use 7 or 8 I guess it is not the latest version.
So I try to install Gazebo 8.2, but even then I’m running into more low level problems particularly with missing/mismatching libraries. Do they have an easier way of installing Gazebo 8.2 like they do for 9? I keep getting stuck. I would appreciate any more guidance if possible.
Not sure if these are easier/cleaner installations though I will try that soon. Should I go for gazebo 7 or 8? I also noticed that the freebuouyancy plugin was designed to use without ROS, should this be of concern to me even if I install a gazebo package with ROS? Is there any particular reason that the plugin has been built not to use ROS?
Sorry for taking so long to reply, I was O.o.O in this last days.
I did this tutorial with Gazebo 8. It’s necessary to have all versions of all necessary libraries compatible between them, and that’s a big pain to solve sometimes depending of the OS.
What is the operating system that you are using and which version ?
I have tried your tutorial on Ubuntu 16 Xenial and gazebo7 and was able to get gazebo linked with the SITL. I was not able to set waypoints and upload a mission to the rov but manual mode worked fine. Since you said you made the tutorial in gazebo8 I’ll try to set that up and see if I get the same sort of errors before I say anything more.
I’m assuming most things are compatible with Xenial and I should stick on Xenial for development purposes?
Thanks a ton for all the support!
Note to others who may be stuck:
I tried to install gazebo 8 from source because I could not find the gazebo8 package when using apt. This was because I was on Ubuntu 18 Bionic Beaver. The only supported gazebo version on Bionic is gazebo9. I had to look through the packages file in the osrf online repository to find this out. When I backtracked to Ubuntu 16 Xenial, everything worked fine because the gazebo7 and gazebo8 packages exist on that distro, and you should be able to follow the tutorial above and everything worked well. There were a few hiccups but nothing massive like when compiling from source.
I’m assuming most things are compatible with Xenial and I should stick on Xenial for development purposes?
It’s compatible with any operating system that can run gazebo 8.
I’ll try to update the tutorial to be compatible with Ubuntu 18.04 (last LTS) and probably 16.04 as well.
I let the ROV run in auto mode to go form the home position to the first waypoint. It seems to be struggling to get there at all. I guess I wanted to check if I’m doing something wrong or if this is expected behavior?
Also my ROV doesn’t seem to have a texture like in your screenshot though I believe I did everything as you said. Not sure why this is the case. Your screenshot has that frame in front of the ROV what looks like it is what the camera is seeing, is this the case? Is it possible to get that camera feed back into QGC?
It’s running like in The Fast and the Furious mode, but a bit of tuning will make it better.
Also my ROV doesn’t seem to have a texture like in your screenshot though I believe I did everything as you said.
I need confirm that, but probably is related to your gazebo version.
Your screenshot has that frame in front of the ROV what looks like it is what the camera is seeing, is this the case? Is it possible to get that camera feed back into QGC?
The image with the camera is a picture of the bluerov_playground simulation module, it was not from the SITL, but we are working to stream the gazebo camera to QGC.
It appears that you are using ubuntu or any linux distro. Did you installed all dependencies via install some required packages ? Can you check if mavproxy is installed with whereis mavproxy or pip list | grep mavproxy -i.
If mavproxy is not installed, please run the ubuntu install packages script or install the packages manually.
Also, have you done the add some directories to your search path ? You can check this with echo $PATH | grep ardupilot , it will show the */ardupilot/Tools/autotest.
If you don’t have the ardupilot path in your PATH env variable, please check the previous link and cloning with the command line.