Skip to content

Tutorial Simulation Scene Objects

HalejoAS edited this page Apr 27, 2018 · 9 revisions

Tutorial: Simulation Scene Objects

This tutorial covers topics in relation with simulation objects, called scene objects which can be static objects (objects rigidly fixed on the robot workspace) or dynamic objects (objects with witch the robot can interact, i.g. pick, place, push ...etc), that can be considered in the motion planing for a collision free interpolation. This document covers specifically:

  • Static Objects:
    • Preparatin of scene objects CAD files
    • Set up of scene objetcs through the MoveIt Rviz panel
    • Loading of default simulation scene
  • Dynamic Objects:
    • Programatic insertion/deletion of scene objects

Static Objects

Preparation of scene objects CAD files

Rviz and MoveIt allow only for .stl or .dae file formats, this are both human readable files that define a 3D meshes. In this tutorial we will use .stl files which requires some preparation before importing to ROS.

STL files do not have units by definition but most 3D modeling softwares export meshes in Milimiters, since ROS uses Meters as default unit of measurment, importing this files directly will lead to enormous 3D meshes. This is why we need to scale the .stl files initially to have units of Meters and a origin point in a desired location; for this it is recomended to use Autodesk Print Studio (a free software that allows scaling and translation of mesh before the generation of the stl).

Set-up of scene objects through the Moveit Rviz panel

In this tutorial we are going to use the file structure.stl located in the invite_motoman_moveit_config/scenes/STL folder.

First launch the robot demo file.

roslaunch invite_motoman_moveit_config demo.launch

Then in the MoveIt Motion Planning panel open the Scene Objects window and click on the import file button on the bottom left part of the panel and select the structure.stl file, the mesh will be imported and in the pannel the position and orientation can be modified (scaling is not recomended with this pannel since scaling of STL files do not mantain the origin of the mesh relative to itself).

Modify the position of the structure to familiarize yourself with the panel, and then remove the mesh by clicking the remove button.

Loading of default simulation scene

A default group of scene objects is already setup for easy loading and use; to load it on the Scene Objects window press the Import from text button, then find the invite_motoman_moveit_config/scenes/default_scene_objects.scene file, once loaded you should get a result like the one shown below.

Dynamic Objects

Programatic insertion/deletion of scene objects

It is also possible to load objects to the robot scene directly from the source code, for this purpose a folder should be created where the CAD files of the objects must be saved.

The code for loading objects is in the file objects.cpp, where you can adjust the position and orientation of the object as required, in addition, a vector is used that scales the objects appropriately allowing you to directly load the models generated by CAD software. Then to execute the launch of our robot "demo.launch", we execute the next line

rosrun invite_beginner_tutorials objects

In this case a glass has been loaded in the scene