Skip to content

uoy-research/ISA_Building_Models

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Blender and Gazebo (classic) Models of the ISA Building

This repository links to files containing models of the ISA Building for both Blender and Gazebo.
The models were created by Tom Feilden supervised by Victoria Hodge and James Walker in collaboration with Richard Hawkins and Matt Osborne for a Venables Internship 2022.
The models are available under a CC-BY-SA-4.0 licence - see the LICENSE file in the repo for details. You can distribute, remix, adapt, and build upon the material in any medium or format, so long as attribution is given to the creators.

  • The Blender models require

    • Blender version 300.43 or newer.

      • If the model appears black when imported into Blender then check the Blender version.

      • If parts of the model are coloured pink/purple then the necessary image files may not have imported correctly. These imports can be checked by going to
        File->External Data->Report Missing Files and viewing the resulting log.

  • The Gazebo models require

Blender

Blender models can be exported to a number of simulation environments suitable for robotics and autonomous systems. We have exported to Gazebo but, by downloading and exporting the Blender models, other simulation models can be created.

Blender models can be exported to Gazebo, Nvidia Isaac, Unity3D or other models

The following ISA Building Blender models are available (the models are packed so all required files are included):

An example view of the ISA Building Blender Model is below:

Blender model

Gazebo

We have created various Gazebo archives for the ISA Building models.

Gazebo and RViz models

The following archives are available:

  • Gazebo ISA Building Ground Floor model. This is a complete Gazebo World including the building's ground floor and a robot. The robot is a two-wheeled differential drive robot. Download Gazebo World here - 178 MB

Setting-up-a-world-in-Gazebo - by Tom Feilden

All the details (and unique quirks) that I found out during my Summer Internship

Prerequisites:

  • ROS2 Galactic installed on Ubuntu Linux 20.04
    • Note: this tutorial is designed for Ros2 Foxy so replace all "foxy" with "galactic"
  • You have created a ROS 2 workspace (I had "dev_ws")
  • Python 3.7 installed
  • You have a package named two_wheeled_robot inside ~/dev_ws/src

Useful Resources

A very useful series of websites is made by AutomaticAddison. Some of the sections in the website is out of date so take all the files from their Github

If in doubt:

  • StackOverflow
  • Gazebo Answers
  • ROS Answers

Adding a custom model to Gazebo:

Option 1

Follow these steps first. Only go to option 2 if you can't save the Gazebo world

  1. Load up gazebo (in verbose mode you can find any errors that come up)

    gazebo --verbose

  2. Go to Edit -> Model Editor (Ctrl + M)

  3. Go to Custom Shapes and click add

  4. Then browse for the model you want to add

    This will be a collada (.dae) file

    Make sure the collada file is in a folder with all the textures required

  5. Place your model in the world and save the model

  6. To change the model from grey to the textures you added:

    1. Go to your file manager and go to the folder model_editor_models
    2. Find the folder corresponding to the model name you just saved
    3. Open the model.sdf
    4. Delete this seciton of code:
       <material>
         <lighting>1</lighting>
         <script>
           <uri>file://media/materials/scripts/gazebo.material</uri>
           <name>Gazebo/Grey</name>
         </script>
         <shader type='pixel'/>
       </material>
    
  7. Delete the model from your world

  8. Insert the model (from the insert tab)

  9. Repeat these steps until you have created your desired world

  10. To save the world, go to File -> Save World As (Ctrl + shift + s)

Option 2

If you encounter an issue where you can't save your gazebo world, follow these steps

  1. Load up Gazebo using sudo

     `sudo gazebo --verbose`
    
  2. Follow steps 2 - 5 in Option 1

  3. To change the model from grey to the textures you added:

    1. Open a new terminal and type:

    sudo nautilus

    1. Find the folder corresponding to the model name you just saved
    2. Open the model.sdf
    3. Delete this seciton of code:
       <material>
         <lighting>1</lighting>
         <script>
           <uri>file://media/materials/scripts/gazebo.material</uri>
           <name>Gazebo/Grey</name>
         </script>
         <shader type='pixel'/>
       </material>
    
  4. Delete the model from your world

  5. Insert the model (from the insert tab)

  6. Repeat these steps until you have created your desired world

  7. To save the world, go to File -> Save World As (Ctrl + shift + s)

Make a world

  1. Open Gazebo
  2. Add what ever models to your world that you would like
  3. Save the model in thee two_wheeled_robots/worlds folder
  4. Open up that file and paste this section of code at the end just above :
    <include>
     <uri>model://two_wheeled_robot_description</uri>
     <static>false</static>
     <pose>-20.0 4.0 3.5 0 0 0</pose>
    </include> 
    

How to launch the world

  1. Creating the launch file

    colcon_cd two_wheeled_robot

    cd launch

    gedit load_world_into_gazebo.launch.py

  2. Add the code from the load_world_into_gazebo.launch.py file which is in the repository

  3. Change line 24 from world_file_name = 'CHANGE_ME.world' to the name of your world

  4. Save the file and close it

  5. Go to your root directory

    cd ~/dev_ws

  6. Build the package

    colcon build

  7. Open a new terminal and run the launch file using this command:

    ros2 launch two_wheeled_robot load_world_into_gazebo.launch.py

Creating a map for RVIZ

Creating a map for rviz involves taking a picture of the floor plan (either .png or .jpeg) and outputs a .pmg and a .yaml file which sets the scale of the map

BE AWARE: door diagrams and other marks in the picture will be perceived as a wall. Use software like paint to remove the unnecessary information

  1. Add the files needed which is in the maps folder in the root directory

    1. Add the file convert_to_binary.py
    2. Add the file MakeROSMap.py
  2. Change the file names in the "convert_to_binary.py" indicated by the CHANGE_ME

  3. Convert the floorplan to binary and then make the ros map

    To run code do python3 *insert file name here* in a terminal

    Follow the prompts in the terminal

  4. Edit the .yaml file kjhdsakjhsakjdhfkjsdhgkjsfkjheksjfhkjhkjdhksjhkjhkjhkjhkjkjhkjhkjh

Launch RVIZ

Editing the launch file:

Change the file names in the launch file

def generate_launch_description():
  package_name = 'two_wheeled_robot'
  robot_name_in_model = 'two_wheeled_robot'
  default_launch_dir = 'launch'
  gazebo_models_path = 'models'
  map_file_path = 'maps/CHANGE_ME.yaml'
  nav2_params_path = 'params/CHANGE_ME/nav2_params.yaml'
  robot_localization_file_path = 'config/ekf.yaml'
  rviz_config_file_path = 'rviz/CHANGE_ME/nav2_config.rviz'
  sdf_model_path = 'models/two_wheeled_robot_description/model.sdf'
  urdf_file_path = 'urdf/two_wheeled_robot.urdf'
  world_file_path = 'worlds/CHANGE_ME.world'

Launching

Note: After any edit of any file, you must rebuild the file

  1. Open a new terminal and go to the root directory and build the files

    cd ~/dev_ws

    colcon build

  2. Open another new terminal and type in this command:

    ros2 launch two_wheeled_robot *insert_launch_file_name*.launch.py

Setting up the Camera

Assumption that the two_wheeled_robot 's .sdf and .udrf has been set up for using a camera

  1. Click on the button "ADD" which is on the left of the screen
  2. Go to By topic -> /depth camera/ image and click OK
  3. Find the image in the Display section (on the left of the screen)
  4. Go to Topic -> Reliaility Pollicy and change from "Reliable" to "Best Effort"

Note: You can drag the image section out of the rviz window to have a seperate window of what the robot camera is seeing

Moving the robot

To install the the package type this command:

sudo apt-get install ros-galactic-rqt-robot-steering

Then open a new terminal and to run the program type this command:

rqt_robot_steering

You can either interact with the GUI with your mouse or using WASD to move the robot.

Note: Having the camera set up makes moving the robot around a lot easier

About

Blender and Gazebo Models of the ISA Building

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages