Skip to content

andb0p/f550_amazing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

___________________________________________________________________________________________________________
The package simulation_control is a modified version of https://github.com/Pateman16/ROS_simulation_control
___________________________________________________________________________________________________________

...OBS! the name user below refers to your own username that can be seen by opening the terminal ctrl+alt+t and writing pwd...

The following is based on having a working simulation with sitl_gazebo from openuav.us.

1. Open the terminal and write ""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

   For example if it looks like this:
	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".

---------------------------------------------------

13. To start:

open three new terminals
	terminal1: roslaunch simulation_control posix_sitl.launch
wait a little while
	terminal2: roslaunch simulation_control px4.launch fcu_url:="udp://:14550@127.0.0.1:14557"
	terminal3: roslaunch simulation_control simulation_control.launch 

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published