Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cave world generator #454

Merged
merged 8 commits into from
Sep 16, 2020
Merged

Add cave world generator #454

merged 8 commits into from
Sep 16, 2020

Conversation

iche033
Copy link
Contributor

@iche033 iche033 commented Jun 10, 2020

Update: Updated code to work with both Cave Type A and Type B tiles. Added an extra -t <type> arg that lets user specify the type of cave to create: anastomotic - creates world using Type A tiles, rectilinear - creates world using Type B tiles, and curvilinear - creates world using Type A and Type B tiles. Also updated PR description.


Added world_generator_cave that generates a world from type A and type B tiles. The tool constructs a world from a collection of prefab world sections and certain individual tiles. Note that the code is currently specific to Cave Type A and Type B Tiles.

Some options are available:

Usage: world_generator_cave [options]
Options:
    -h		 Print this help message
    -o <file>	 Output sdf filename
    -s <seed>	 Seed
    -c <count>	 Min tile count
    -n <name>	 World name
    -t <type>	 Cave Type:
             	    'anastomotic' or 'a',
             	    'curvilinear' or 'c',
             	    'rectilinear' or 'r'
    -g		 Generate sdf with GUI plugin

You can generate a different world by setting a different seed value and minimum tile count.

Note the optional g arg that lets users generate a world sdf with GUI plugin, which is useful for viewing the world without launching the whole subt stack. Leave out the g arg when generating the final world.

Example usage:

./install/share/subt_ign/world_generator_cave -g -t a -c 60 -n cave_test -s 25 -o cave_test.sdf

If you do not have the Cave Type A and Type B tiles in your fuel cache, the tool will go and download them as it needs to compute bounding box info for these tiles in order to do intersection checks.

View the world using ign-gazebo

ign gazebo -v 4 cave_test.sdf

world_generator_type_a_25

Signed-off-by: Ian Chen ichen@osrfoundation.org

iche033 added 3 commits June 9, 2020 17:02
Signed-off-by: Ian Chen <ichen@osrfoundation.org>
Signed-off-by: Ian Chen <ichen@osrfoundation.org>
Signed-off-by: Ian Chen <ichen@osrfoundation.org>
@mjcarroll mjcarroll self-requested a review June 10, 2020 13:55
Copy link
Contributor

@caguero caguero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It worked for me! I just left one minor comment about Ignition-fuel-tools4.

@@ -26,7 +26,8 @@ set(IGN_GAZEBO_VER ${ignition-gazebo2_VERSION_MAJOR})

file(MAKE_DIRECTORY ${CATKIN_DEVEL_PREFIX}/include)

find_package(ignition-common3 REQUIRED)
find_package(ignition-common3 REQUIRED COMPONENTS graphics)
find_package(ignition-fuel_tools4 REQUIRED)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So far master uses Ignition Blueprint and that contains ignition-fuel-tools3. Just checking if this is expected...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch, fixed in 3972783

iche033 added 5 commits June 15, 2020 10:36
Signed-off-by: Ian Chen <ichen@osrfoundation.org>
Signed-off-by: Ian Chen <ichen@osrfoundation.org>
Signed-off-by: Ian Chen <ichen@osrfoundation.org>
Signed-off-by: Ian Chen <ichen@osrfoundation.org>
Signed-off-by: Ian Chen <ichen@osrfoundation.org>
@iche033 iche033 requested a review from caguero June 26, 2020 21:00
@iche033 iche033 changed the title Add world generator for Type A tiles Add cave world generator Jun 26, 2020
@angelacmaio angelacmaio self-requested a review September 10, 2020 21:38
t.tileType;

ss << " <include>\n";
ss << " <static>true</static>\n";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should all tiles be static?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes they should be static. The models are actually already marked as static in the model.sdf file so this is probably redundant. I added this to be consistent with the existing world files.

math::Quaterniond(0, 0, IGN_PI/2)*rot);
}
ss << " <include>\n";
ss << " <static>true</static>\n";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should all caps be static?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes same as the tiles

@nkoenig nkoenig merged commit c026955 into master Sep 16, 2020
@nkoenig nkoenig deleted the world_a_gen branch December 10, 2020 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants