Skip to content
Snippets Groups Projects
Unverified Commit 5368b730 authored by jenniferdavid's avatar jenniferdavid Committed by GitHub
Browse files

Update Readme.md

parent e99799c5
No related branches found
No related tags found
No related merge requests found
......@@ -3,24 +3,26 @@
* ROS Kinetic
* Assuming you use [catkin](http://wiki.ros.org/catkin) build system
* Gazebo 7.14
* You can use this script [here](https://raw.githubusercontent.com/PX4/Devguide/master/build_scripts/ubuntu_sim_ros_gazebo.sh):
1. Download or save it somewhere
* OR You can use download and run this script [here](https://raw.githubusercontent.com/PX4/Devguide/master/build_scripts/ubuntu_sim_ros_gazebo.sh):
1. Download and save it
2. Go to the location that you saved it
3. source ubuntu_sim_ros_gazebo.sh
3. Run `source ubuntu_sim_ros_gazebo.sh`
![gazebo_quadtest](https://user-images.githubusercontent.com/2436747/48624033-bdee7180-e9ab-11e8-8414-801eee34f4e9.png)
# OpenUAV #
This simulation is based on [OpenUAV](https://github.com/Open-UAV) project.
1. In your home directory create a `src` folder by typing `mkdir src` in your terminal
2. `cd src`
2. Go to the src folder `cd src`
3. Clone all git repositories in OpenUAV to this folder by `git clone` command
4. Go to the `Firmware` repository by typing `cd Firmware`
5. `source setup-install.sh` (press <kbd>Return</kbd> to continue when asked)
6. When it finishes, type `make posix_sitl_default`
7. Then try to run Gazebo by typing `gazebo` in your terminal
7. Then run Gazebo by typing `gazebo` in your terminal
8. Connect the `sitl_gazebo` folder with your `catkin_ws/src` folder by typing `sudo ln -s ~/sitl_gazebo ~/catkin_ws/src` in your terminal
9. Connect the `src/Firmware` folder with your `catkin_ws/src` folder by typing `sudo ln -s ~/src/Firmware ~/catkin_ws/src` in your terminal
10. Go to your `catkin_ws/src` folder (`cd ~/catkin_ws/src`) and build it by typing `catkin build` in the terminal.
11. `source devel/setup.bash`
12. Now do the folliwing to configure your ROS environment
11. Type `source devel/setup.bash`
12. Now do the following to configure your ROS environment:
1. `roscd`
2. `cd ..`
3. `cd src/Firmware`
......@@ -29,67 +31,47 @@ This simulation is based on [OpenUAV](https://github.com/Open-UAV) project.
6. `source Tools/setup_gazebo.bash $(pwd) $(pwd)/build_posix_sitl_default`
7. `export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:$(pwd)`
8. `export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:$(pwd)/Tools/sitl_gazebo`
13. `roslaunch px4 posix_sitl.launch`
14. `roslaunch mavros px4.launch fcu_url:="udp://:14550@127.0.0.1:14557"`
13. Open a terminal and type: `roslaunch px4 posix_sitl.launch`
14. Open a terminal and type: `roslaunch mavros px4.launch fcu_url:="udp://:14550@127.0.0.1:14557"`
# Gripper Setup #
1. Open the terminal and write ""printenv | grep GAZEBO"
1. Open a terminal and type `printenv | grep GAZEBO`
2. Two or more paths should be displayed:
GAZEBO_MODEL_PATH=:/home/user/src/Firmware/Tools/sitl_gazebo/models:/home/user/catkin_ws/src/simulation_control/src/models
GAZEBO_PLUGIN_PATH=:/home/user/src/Firmware/Tools/sitl_gazebo/Build
3. Gazebo gets it's models in this case from two paths which are told apart by the : sign.
4. Add the file gripper_plugin.cc in the folder one step up from your GAZEBO_PLUGIN_PATH which in this case would be "/home/user/src/Firmware/Tools/sitl_gazebo/src"
5. Add the following under plugins to the CMakeLists.txt file located at "/home/user/src/Firmware/Tools/sitl_gazebo/src"
# -----GripperPlugin
find_package(roscpp REQUIRED)
find_package(std_msgs REQUIRED)
include_directories(${roscpp_INCLUDE_DIRS})
include_directories(${std_msgs_INCLUDE_DIRS})
find_package(gazebo REQUIRED)
include_directories(${GAZEBO_INCLUDE_DIRS})
link_directories(${GAZEBO_LIBRARY_DIRS})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GAZEBO_CXX_FLAGS}")
add_library(gripper_plugin SHARED src/gripper_plugin.cc)
target_link_libraries(gripper_plugin ${GAZEBO_libraries} ${roscpp_LIBRARIES})
# -----/GripperPlugin
6. Type in TERMINAL:
cd ~/home/user/src/Firmware/Tools/sitl_gazebo/Build (GAZEBO_PLUGIN_PATH)
cmake ../
make
7. Add the folder "simulation_control" to your "catkin_ws/src" folder.
8. Type in TERMINAL: (building the catkin workspace)
cd ~/catkin_ws
catkin build
9. Double check if you're missing any dependencies like pysci etc. and install them if not. Then build again.
If you want it to work there can be no errors in the build.
10. Type in terminal: (adding gazebo model path)
sudo nano ~/.bashrc
11. Add the following line to the end of your GAZEBO_MODEL_PATH:
:/home/user/catkin_ws/src/simulation_control/src/models
GAZEBO_PLUGIN_PATH=:/home/user/src/Firmware/Tools/sitl_gazebo/Build (Gazebo gets it's models in this case from two paths which are told apart by the `:` sign.)
3. Add the file `gripper_plugin.cc` in the folder one step up from your GAZEBO_PLUGIN_PATH. In this case, it would be "/home/user/src/Firmware/Tools/sitl_gazebo/src"
4. Add the following under plugins to the `CMakeLists.txt` file located at "/home/user/src/Firmware/Tools/sitl_gazebo/src"
` -----GripperPlugin`
`find_package(roscpp REQUIRED)`
`find_package(std_msgs REQUIRED)`
`include_directories(${roscpp_INCLUDE_DIRS})`
`include_directories(${std_msgs_INCLUDE_DIRS}) `
`find_package(gazebo REQUIRED)`
`include_directories(${GAZEBO_INCLUDE_DIRS})`
`link_directories(${GAZEBO_LIBRARY_DIRS})`
`set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GAZEBO_CXX_FLAGS}")`
`add_library(gripper_plugin SHARED src/gripper_plugin.cc)`
`target_link_libraries(gripper_plugin ${GAZEBO_libraries} ${roscpp_LIBRARIES})`
5. Open a terminal and type the following:
1. `cd ~/home/user/src/Firmware/Tools/sitl_gazebo/Build (GAZEBO_PLUGIN_PATH)`
2. `cmake ../`
3. `make`
6. Add the folder `simulation_control` to your `catkin_ws/src` folder.
7. Open a terminal and type the following to build the catkin workspace:
1. `cd ~/catkin_ws`
2. `catkin build`
8. Double check if you're missing any dependencies like `pysci` etc. and install them if not. Then build again.
9. Open a terminal and type: (adding gazebo model path to bashrc)
`sudo nano ~/.bashrc`
10. In your bashrc, add the following line along with your GAZEBO_MODEL_PATH:
`:/home/user/catkin_ws/src/simulation_control/src/models`
For example if it looks like this:
export GAZEBO_MODEL_PATH=:/home/user/src/Firmware/Tools/sitl_gazebo/models
`export GAZEBO_MODEL_PATH=:/home/user/src/Firmware/Tools/sitl_gazebo/models`
After editing it should look like this:
export GAZEBO_MODEL_PATH=:/home/user/src/Firmware/Tools/sitl_gazebo/models:/home/user/catkin_ws/src/simulation_control/src/models
12. Add the file f550_amazing to "/home/user/src/Firmware/posix-configs/SITL/init/lpe".
`export GAZEBO_MODEL_PATH=:/home/user/src/Firmware/Tools/sitl_gazebo/models:/home/user/catkin_ws/src/simulation_control/src/models`
11. Add the file `f550_amazing` to `/home/user/src/Firmware/posix-configs/SITL/init/lpe`
# FAQ #
## If after making `posix_sitl`, Gazebo doesn’t launch and gives you a error message regarding `geographiclib` ##
Do the following:
* In your terminal type: `sudo apt-get install ros-kinetic-mavros ros-kinetic-mavros-extras`
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment