Skip to content

This simulation works using Gazebo and ROS. The aim is to create a framework with which to implement different vehicles easily, to start the a drone will be implemented. The simulation of their physics will be executed on a C++ node which communicates with Gazebo the new state of the vehicle. To top it off, sensors like cameras, lidars, ultra so…

License

Notifications You must be signed in to change notification settings

WyllDuck/simulation_model2gazebo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fell free to improve the documentation on this project! Need Help? Tips on how to modify README.md files here!

USEFULL TIPS:

Close all the ROS & Gazebo processes:

killall -9 gazebo & killall -9 gzserver  & killall -9 gzclient
killall -9 rosmaster
killall -9 roscore

Purge all python compile files:

find . -name '*.pyc' -delete

FIRST STEPS TO MAKE YOUR GAZEBO_ROS PROJECT:

Create a catkin workspace:

  • mkdir -p ~/CATKIN_WORSPACE_NAME/src
  • cd ~/CATKIN_WORKSPACE_NAME/
  • catkin_make

Once your catkin workspace has been created navigate to the src folder to create your first package.

Create an empty package :

  • catkin_create_pkg NAME_PROJECT

Edit package.xml and create you first .launch file :

#f03c15 If you don't do this steps the world models you create will be unaccessible from your gazebo_ros project

  • Add this this term in the package.xml file inside the tag package. This allows Gazebo to access the meshes saved on your package, inside the folder meshes. It's preferably to add this lines at the end of the file.
<package>
...
  <export>
    <gazebo_ros gazebo_model_path="${prefix}/models"/>
    <gazebo_ros gazebo_media_path="${prefix}/models"/>
  </export>
</package>
  • Use this .launch file as a template for others:

#1589F0 This way every time you create a new .launch file you won't forget to add this two critical lines

<launch>
  ...
  <env name="GAZEBO_MODEL_PATH" value="$(find upc_driverless_gazebo)"/>
  <env name="GAZEBO_RESOURCE_PATH" value="$(find upc_driverless_gazebo)"/>
  ...
</launch>

USEFUL COMMAND FOR ROS:

This command runs a ROS .launch file from the gazebo_ros package, additionaly roslaunch is passing arguments: ( The arguments can change form file to file ).

  • roslaunch gazebo_ros empty_world.launch paused:=true use_sim_time:=false gui:=true throttled:=false recording:=false debug:=true verbose:=true

.launch FILES:

This a simple .launch program that opens a .world file. World files define the spaces in which we simulate our robots.

<launch>
  <include file="$(find gazebo_ros)/launch/empty_world.launch">
    <arg name="world_name" value="worlds/mud.world"/> <!-- The world_name changes in function of which file you want to open -->
    <arg name="paused" value="false"/>
    <arg name="use_sim_time" value="true"/>
    <arg name="gui" value="true"/>
    <arg name="recording" value="false"/>
    <arg name="debug" value="false"/>
  </include>
</launch>

We are importing empty_world.launch because the package gazebo_ros already defines the basic function of the world.

<include file="$(find gazebo_ros)/launch/empty_world.launch">

When it's time to pass the parameters to the empty_world.launch file we change the world_name argument to the one of the file we want to open. (Note: You must set the path to the file in relation to the directory you are working from, ROS has different tools to help you with this).

<arg name="world_name" value="worlds/mud.world"/> <!-- The world_name value changes in function of which file you want to open -->

RECOMMENDATIONS:

By adding this snippet at the beginning of your file the editor will automaticly set the type to XML saving you time and making the code easier to read.

<?xml version="1.0" ?>

Caution with this:

  • When writting code on any XML (.world, .launch, .urdf, ...) file remember to name links with different names. For instances the SDF files, that are responsible for diffining the maps, were not responding accordingly to what was expected because all the tags link had the same name. This meant that all the cones concured in the same position. The Visual Studio Code marketapp Insert Numbers help to speed up the process of name each link tag.

SOURCES AND OTHER INFORMATION:

Website Links Sujects converd
Gazebo Tutorials http://gazebosim.org/tutorials/?tut=ros_roslaunch roslaunch, world files, urdf models
Gazebo Tutorials http://gazebosim.org/tutorials?tut=build_world&cat=build_world edit world files, save world files
Gazebo Tutorials http://gazebosim.org/tutorials/?tut=ros_urdf#Nextsteps udrf models
Gazebo Tutorials http://gazebosim.org/tutorials?tut=ros_gzplugins plugins
ROS Tutorials http://wiki.ros.org/roslaunch/XML launch files
ROS Tutorials http://wiki.ros.org/urdf/XML/Transmission urdf Transmisions
ROS Tutorials http://wiki.ros.org/controller_manager controller manager

About

This simulation works using Gazebo and ROS. The aim is to create a framework with which to implement different vehicles easily, to start the a drone will be implemented. The simulation of their physics will be executed on a C++ node which communicates with Gazebo the new state of the vehicle. To top it off, sensors like cameras, lidars, ultra so…

Resources

License

Stars

Watchers

Forks

Packages

No packages published