Search this site
Embedded Files
  • Home
  • Solar Energy
    • IECON2017
    • INTERCON2017
    • Thesis Research
    • Solar Energy
    • Solar Heater
  • Robotics
    • ROS2 Control
    • 3D Mapping
    • Starbots Coffee Shop Arm
    • Gtest & Unit Test
    • Robotics Web Development
    • Arms Kinematics
    • Mobile Kinematics
    • Perception & Manipulation
    • Autonomous Navigation
    • Obstacle Avoidance
    • Four Wheel Independent Steering
    • Turtlebot3
    • Gazebo Simulation
    • UGV
    • Sumo
    • Aurdiosity
    • Drone
  • Electronics
    • BLDC Motor Upgrade
    • NAS Server
    • Lenovo x250
    • Canon G3100
    • LG TV
    • Wasp Killer
  • Computer Vision
    • Tracking Algorithm Based on Yolact and SIFT
    • Yolo v5 Obstacle Detection
    • VR Simulator
    • Color Based Person Tracker
    • Discrete Cosine Transform
    • OpenGL
  • Courses & Certificates
 

Gazebo Simulation

In this project a Gazebo construction site environment for two TurtleBots 3 was created, the world includes a textured ground plane, clouds, and several textured 3D models. The 3D models were processed using Blender. This guide assumes you have a basic understanding of ROS 2 and simulation environments like Gazebo. 

Blender

Our downloaded model should have the following files:

  • model_file.fbx/stl/dae

  • Base Color

  • Roughness

  • Height

  • Normal

  • Metallic

  • Ambient Occlusion


After importing the 3D model (.dae, .stl, .fbx, ...) into Blender, the texture file can be loaded as follow:

  1.  Go to "shading view".

  2. Click on "Shading" on the top bar.

  3. Add.

  4. Texture

  5. Multiple Images

Now it is time to link each image with it corresponding slot. Pay attention to not use special blocks as shown on the images below. For more details you can check the following link:

  • https://www.cgbookcase.com/learn/how-to-use-pbr-textures-in-blender/

Full textures with operations doesn't work.

Simplified way can be exported.



When exporting the file, it must be saved as a DAE file and the textures must be copied, to generate the texture file.

3D model.

Files generated.

Downscaling Meshes

The meshes imported from Solidworks or Inventor have a very high face count and are not optimised for launch in Gazebo. The more complex mesh you spawn in Gazebo, the greater the computational time needed to determine potential collisions and rendering.  In Blender the Decimate Modifier function can be used to downscale meshes.


14.626 Faces.

1.199 faces.

Models

To optimize the simulation and not decrease the real time factor in Gazebo the collision part of the SDF file must be replaced by a primitive geometric form.

World

In the turtlebot3_tc_test.world file the camera initial position was defined to a more convenient location. The cloud speed was set just for aesthetic. To load model in a random location the distribution type "random" can be used and then defined the location, and size of the cube where the models will be placed, also it can be type "grid". Check the code below for more details

Also, disabling shadows also boosts the rendering FPS, especially when launching the simulation in CPU-only modes. 

Make sure to use minimal light sources as long as your perception algorithms perform optimally. Only proceed to add sources of directional light if you cannot modify the default Sun model’s range and attenuation parameters to achieve your end cause. The performance of vision-based algorithms such as image segmentation using Deep Learning Models or Visual SLAM depends on the amount of light in the environment, so this method will not be very useful in those cases.

Robot Meshes ROS 2

In order to load the meshes of the robot that are stored into the description package, in ROS 1 we can use the package://<path> command to find the location of the meshes. But this doesn't work in ROS2.

<ROS 1>

In ROS2, we must use file://$(find robot_description)/<path> as shown in the snippet below. 

<ROS 2>

Results


Simulation running at 60 FPS  and real time factor 1.0 in an old MSI laptop. This environment can be use to test SLAM algorithms as well to perform object detection.

Files

  • GitHub

Google Sites
Report abuse
Page details
Page updated
Google Sites
Report abuse