Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions subt_ign/launch/cloudsim_sim.ign
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,9 @@
<% elsif $worldName.include?('final_event') &&
!$worldName.include?('practice') %>
<world_file>final_event/<%= worldNumber %>/<%= $worldName %>.sdf</world_file>
<% elsif $worldName.include?('final_prelim') &&
!$worldName.include?('practice') %>
<world_file>final_prelim/<%= worldNumber %>/<%= $worldName %>.sdf</world_file>
<% else %>
<world_file><%= $worldName %>.sdf</world_file>
<% end %>
Expand Down
3 changes: 3 additions & 0 deletions subt_ign/launch/competition.ign
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,9 @@
<% elsif $worldName.include?('final_event') &&
!$worldName.include?('practice') %>
<world_file>final_event/<%= worldNumber %>/<%= $worldName %>.sdf</world_file>
<% elsif $worldName.include?('final_prelim') &&
!$worldName.include?('practice') %>
<world_file>final_prelim/<%= worldNumber %>/<%= $worldName %>.sdf</world_file>
<% else %>
<world_file><%= $worldName %>.sdf</world_file>
<% end %>
Expand Down
3 changes: 3 additions & 0 deletions subt_ign/launch/validate_artifacts.ign
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ ign service -s /artifact/move_to \
<% elsif $worldName.include?('final_event') &&
!$worldName.include?('practice') %>
<world_file>final_event/<%= worldNumber %>/<%= $worldName %>.sdf</world_file>
<% elsif $worldName.include?('final_prelim') &&
!$worldName.include?('practice') %>
<world_file>final_prelim/<%= worldNumber %>/<%= $worldName %>.sdf</world_file>
<% else %>
<world_file><%= $worldName %>.sdf</world_file>
<% end %>
Expand Down
3 changes: 3 additions & 0 deletions subt_ign/launch/validate_connections.ign
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ ign service -s /connection/prev \
<% elsif $worldName.include?('final_event') &&
!$worldName.include?('practice') %>
<world_file>final_event/<%= worldNumber %>/<%= $worldName %>.sdf</world_file>
<% elsif $worldName.include?('final_prelim') &&
!$worldName.include?('practice') %>
<world_file>final_prelim/<%= worldNumber %>/<%= $worldName %>.sdf</world_file>
<% else %>
<world_file><%= $worldName %>.sdf</world_file>
<% end %>
Expand Down
3 changes: 3 additions & 0 deletions subt_ign/launch/visibility.ign
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@
<% elsif $worldName.include?('final_event') &&
!$worldName.include?('practice') %>
<world_file>final_event/<%= worldNumber %>/<%= $worldName %>.sdf</world_file>
<% elsif $worldName.include?('final_prelim') &&
!$worldName.include?('practice') %>
<world_file>final_prelim/<%= worldNumber %>/<%= $worldName %>.sdf</world_file>
<% else %>
<world_file><%= $worldName %>.sdf</world_file>
<% end %>
Expand Down
7 changes: 7 additions & 0 deletions subt_ign/src/Common.cc
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ bool FullWorldPath(const std::string &_worldName,
const std::string urbanPrefix = "urban_circuit_";
const std::string cavePrefix = "cave_circuit_";
const std::string finalPrefix = "final_event_";
const std::string finalPrelimPrefix = "final_prelim_";
if (0 == _worldName.compare(0, tunnelPrefix.size(), tunnelPrefix))
{
std::string suffix = _worldName.substr(tunnelPrefix.size());
Expand Down Expand Up @@ -143,6 +144,12 @@ bool FullWorldPath(const std::string &_worldName,
worldsDirectory = ignition::common::joinPaths(worldsDirectory,
"final_event", suffix);
}
else if (_worldName.find(finalPrelimPrefix) != std::string::npos)
{
std::string suffix = _worldName.substr(finalPrelimPrefix.size());
worldsDirectory = ignition::common::joinPaths(worldsDirectory,
"final_prelim", suffix);
}
else if (_worldName.find("simple") == std::string::npos &&
_worldName.find("_qual") == std::string::npos &&
_worldName.find("_stix") == std::string::npos &&
Expand Down
132 changes: 123 additions & 9 deletions subt_ign/src/ConnectionHelper.cc

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion subt_ign/src/GameLogicPlugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1113,7 +1113,7 @@ void GameLogicPluginPrivate::OnEvent(const ignition::msgs::Pose &_msg)
// there should be only 1 key-value pair. Just in case, we will grab
// only the first. The key is currently always "type", which we can
// ignore when sending the ROS message.
if (regionEventType.empty())
if (regionEventType.empty() && data.first == "type")
{
if (data.second.find("performer_detector_rockfall") ==
std::string::npos)
Expand Down Expand Up @@ -2390,6 +2390,10 @@ bool GameLogicPluginPrivate::OnFinishCall(const ignition::msgs::Boolean &_req,
ignition::msgs::Time localSimTime(this->simTime);
if (this->started && _req.data() && !this->finished)
{
ignmsg << "User triggered OnFinishCall." << std::endl;
this->Log(localSimTime) << "User triggered OnFinishCall." << std::endl;
this->logStream.flush();

this->Finish(localSimTime);
_res.set_data(true);
}
Expand Down
20 changes: 15 additions & 5 deletions subt_ign/src/apps/dot_generator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,15 @@ void printGraph(std::vector<VertexData> &_vertexData,
_vertexData[i].tileType);
if (ct1It == subt::ConnectionHelper::circuitTypes.end())
{
ignwarn << "No circuit information for: " << _vertexData[i].tileType
<< std::endl;
std::cerr << "No circuit information for: "
<< _vertexData[i].tileType << std::endl;
}
auto ct2It = subt::ConnectionHelper::circuitTypes.find(
_vertexData[j].tileType);
if (ct2It == subt::ConnectionHelper::circuitTypes.end())
{
ignwarn << "No circuit information for: " << _vertexData[j].tileType
<< std::endl;
std::cerr << "No circuit information for: "
<< _vertexData[j].tileType << std::endl;
}

// Is one of the tile a starting area? If so, the cost should be 1.
Expand Down Expand Up @@ -191,7 +191,16 @@ void generateDOT(const std::string &_sdfFile, const std::string &_circuit)
filter = [](const std::string &/*_name*/,
const std::string &_type)
{
return subt::ConnectionHelper::connectionPoints.count(_type) <= 0;
for (const auto &connection : subt::ConnectionHelper::connectionPoints)
{
if (ignition::common::lowercase(connection.first) ==
ignition::common::lowercase(_type))
{
return false;
}
}

return true;
};

std::vector<VertexData> vertexData;
Expand All @@ -202,6 +211,7 @@ void generateDOT(const std::string &_sdfFile, const std::string &_circuit)
if (result == std::string::npos || result > str.size())
break;


VertexData vd;
bool filled = SdfParser::FillVertexData(includeStr, vd, filter);
if (filled)
Expand Down
Binary file not shown.
116 changes: 116 additions & 0 deletions subt_ign/worlds/final_prelim/01/final_prelim_01.dot
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
/* Visibility graph generated by dot_generator */

graph {
/* ==== Vertices ==== */

/* Base station / Staging area */
0 [label="0::base_station::BaseStation"];

1 [label="1::4-Way Finals Transition 2::tile_1"];
2 [label="2::Urban Service Room Straight Lights::tile_2"];
3 [label="3::Cave Vertical Shaft Straight Bottom Type A::tile_3"];
4 [label="4::Cave Straight 01 Type B::tile_4"];
5 [label="5::Cave Corner 01 Type B::tile_5"];
6 [label="6::Cave Tunnel Transition::tile_6"];
7 [label="7::Cave Tunnel Transition::tile_7"];
8 [label="8::Cave Transition Type A to and from Type B Lights::tile_8"];
9 [label="9::Cave Tunnel Transition::tile_9"];
10 [label="10::Urban 2 Story Lights::tile_10"];
11 [label="11::Urban Large Room Split Lights::tile_11"];
12 [label="12::Rough Tunnel Tile 90-degree Turn Lights::tile_12"];
13 [label="13::Rough Tunnel Tile Straight::tile_13"];
14 [label="14::Tunnel Tile 2::tile_14"];
15 [label="15::Universal Shift 5x5::tile_15"];
16 [label="16::Tunnel Bend Right::tile_16"];
17 [label="17::Universal Shift 5x5::tile_17"];
18 [label="18::Universal Shift 5x5::tile_18"];
19 [label="19::Universal Straight 10::tile_19"];
20 [label="20::Urban Large Room Split::tile_20"];
21 [label="21::Urban Service Room Straight Lights::tile_21"];
22 [label="22::4-Way Finals Transition 2::tile_22"];
23 [label="23::Constrained Tunnel Tile Short::tile_23"];
24 [label="24::Tunnel Tile 6::tile_24"];
25 [label="25::Tunnel Tile 1::tile_25"];
26 [label="26::Tunnel Tile 6::tile_26"];
27 [label="27::Tunnel Tile 2::tile_27"];
28 [label="28::Universal Straight 10::tile_28"];
29 [label="29::Universal Straight 5::tile_29"];
30 [label="30::Urban 3-Way Right Intersection::tile_30"];
31 [label="31::Universal Straight 10::tile_31"];
32 [label="32::Urban Tunnel Transition::tile_32"];
33 [label="33::Rough Tunnel Tile Vertical Shaft::tile_33"];
34 [label="34::Rough Tunnel Tile 4-way Intersection Lights::tile_34"];
35 [label="35::Rough Tunnel Tile 90-degree Turn Lights::tile_35"];
36 [label="36::Constrained Tunnel Tile Tall::tile_36"];
37 [label="37::Universal Straight 10::tile_37"];
38 [label="38::Universal Straight 10::tile_38"];
39 [label="39::Universal Straight 5::tile_39"];
40 [label="40::Cave Corner 04 Type A::tile_40"];
41 [label="41::Urban Service Room Centered Lights::tile_41"];
46 [label="46::Urban Platform::tile_46"];
51 [label="51::Cave Cap Type A::tile_51"];
53 [label="53::Rough Tunnel Tile Ramp::tile_53"];
54 [label="54::Rough Tunnel Tile Straight Lights::tile_54"];
56 [label="56::Rough Tunnel Tile Vertical Shaft::tile_56"];
57 [label="57::Constrained Tunnel Tile Short::tile_57"];
58 [label="58::Tunnel Tile 7::tile_58"];
60 [label="60::Rough Tunnel Tile Vertical Shaft::tile_60"];
61 [label="61::Cave Vertical Shaft Dead End Type A::shaft_1"];

/* ==== Edges ==== */

0 -- 1 [label=3];
1 -- 2 [label=3];
1 -- 4 [label=3];
2 -- 10 [label=3];
3 -- 61 [label=3];
3 -- 7 [label=3];
3 -- 9 [label=3];
4 -- 5 [label=3];
5 -- 8 [label=3];
6 -- 7 [label=1];
6 -- 8 [label=1];
6 -- 12 [label=3];
7 -- 23 [label=1];
9 -- 33 [label=1];
9 -- 40 [label=3];
10 -- 11 [label=6];
10 -- 41 [label=3];
11 -- 15 [label=3];
11 -- 20 [label=6];
12 -- 13 [label=2];
13 -- 14 [label=2];
14 -- 16 [label=3];
15 -- 17 [label=1];
16 -- 19 [label=3];
17 -- 18 [label=1];
18 -- 19 [label=1];
20 -- 21 [label=3];
21 -- 28 [label=1];
22 -- 26 [label=3];
22 -- 28 [label=2];
22 -- 31 [label=2];
23 -- 24 [label=1];
24 -- 25 [label=2];
25 -- 27 [label=3];
25 -- 53 [label=2];
26 -- 29 [label=1];
27 -- 29 [label=3];
30 -- 31 [label=3];
30 -- 32 [label=3];
30 -- 46 [label=6];
32 -- 37 [label=1];
33 -- 34 [label=2];
34 -- 36 [label=2];
34 -- 56 [label=2];
34 -- 60 [label=2];
35 -- 38 [label=3];
35 -- 39 [label=3];
36 -- 38 [label=1];
37 -- 39 [label=1];
40 -- 51 [label=6];
53 -- 54 [label=1];
56 -- 57 [label=1];
57 -- 58 [label=2];
}

Loading