Skip to content

Commit

Permalink
Add test world to test collada_exporter with submeshes
Browse files Browse the repository at this point in the history
Signed-off-by: Jorge Perez <[email protected]>
  • Loading branch information
Blast545 committed Apr 21, 2021
1 parent c4f6718 commit 327d0cc
Show file tree
Hide file tree
Showing 29 changed files with 66,190 additions and 37 deletions.
15 changes: 11 additions & 4 deletions test/integration/collada_world_exporter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

#include <ignition/common/Console.hh>
#include <ignition/common/Filesystem.hh>
#include <ignition/common/Util.hh>

#include "ignition/gazebo/Server.hh"
#include "ignition/gazebo/test_config.hh"
Expand Down Expand Up @@ -74,23 +75,29 @@ TEST_F(ColladaWorldExporterFixture, ExportWorld)

TEST_F(ColladaWorldExporterFixture, ExportWorldFromFuelWithSubmesh)
{
ignition::common::setenv("IGN_GAZEBO_RESOURCE_PATH",
(std::string(PROJECT_SOURCE_PATH) + "/test/worlds:" +
std::string(PROJECT_SOURCE_PATH) + "/test/worlds/models").c_str());

this->LoadWorld(common::joinPaths("test", "worlds",
"collada_world_exporter_submesh.sdf"));

const std::string outputPath = "./collada_world_exporter_tiles_test";

// Cleanup
common::removeAll("./collada_world_exporter_tiles_test");
common::removeAll(outputPath);

// The export directory shouldn't exist.
EXPECT_FALSE(common::exists("./collada_world_exporter_tiles_test"));
EXPECT_FALSE(common::exists(outputPath));

// Run one iteration which should export the world.
server->Run(true, 1, false);

// The export directory should now exist.
EXPECT_TRUE(common::exists("./collada_world_exporter_tiles_test"));
EXPECT_TRUE(common::exists(outputPath));

// Cleanup
common::removeAll("./collada_world_exporter_tiles_test");
common::removeAll(outputPath);
}

/////////////////////////////////////////////////
Expand Down
41 changes: 8 additions & 33 deletions test/worlds/collada_world_exporter_submesh.sdf
Original file line number Diff line number Diff line change
@@ -1,46 +1,21 @@
<?xml version="1.0" ?>
<!--
Test world downloading two tile files
Test world loading a tile with submeshes
-->
<sdf version="1.6">
<world name="collada_world_exporter_tiles_test">

<physics name="1ms" type="ode">
<max_step_size>0.004</max_step_size>
<real_time_factor>1.0</real_time_factor>
</physics>

<scene>
<ambient>0.1 0.1 0.1 1.0</ambient>
<background>0 0 0 1.0</background>
<grid>false</grid>
<origin_visual>false</origin_visual>
</scene>

<plugin
filename="ignition-gazebo-collada-world-exporter-system"
name="ignition::gazebo::systems::ColladaWorldExporter">
filename="libignition-gazebo-physics-system.so"
name="ignition::gazebo::systems::Physics">
</plugin>

<atmosphere type="adiabatic">
<temperature>288</temperature>
<temperature_gradient>0.2</temperature_gradient>
</atmosphere>

<!-- Tunnel tile-->
<include>
<static>true</static>
<name>tile_1</name>
<pose>22 100 -10 0 -0 -3.14159</pose>
<uri>https://fuel.ignitionrobotics.org/1.0/OpenRobotics/models/Tunnel Tile 6</uri>
</include>
<plugin
filename="ignition-gazebo-collada-world-exporter-system"
name="ignition::gazebo::systems::ColladaWorldExporter">
</plugin>

<include>
<static>true</static>
<name>tile_2</name>
<pose>22 111 -10 0 -0 0</pose>
<uri>https://fuel.ignitionrobotics.org/1.0/OpenRobotics/models/Tunnel Tile Blocker</uri>
<uri>model://tunnel_tile_6</uri>
</include>

</world>
</sdf>
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
material TunnelTile/Light_Diffuse
{
technique
{
pass
{
texture_unit
{
texture Light_Albedo.png
}
}
}
}

material TunnelTile/Walls_Diffuse
{
technique
{
pass
{
texture_unit
{
texture Walls_Albedo.png
}
}
}
}

material TunnelTile/Wood_Diffuse
{
technique
{
pass
{
texture_unit
{
texture Wood_Albedo.png
}
}
}
}

material TunnelTile/Ground_Diffuse
{
technique
{
pass
{
texture_unit
{
texture Ground_Albedo.png
}
}
}
}

material TunnelTile/Chainlink_Diffuse
{
technique
{
pass
{
texture_unit
{
texture Chainlink_Albedo.png
}
}
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 327d0cc

Please sign in to comment.