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
24 changes: 24 additions & 0 deletions subt_ign/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,30 @@ install(TARGETS ${connection_validator_name}
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin)

add_executable(validate_connections
src/validate_connections.cc
src/ConnectionValidator.cc
src/ConnectionValidatorPrivate.cc
src/ConnectionHelper.cc
src/SimpleDOTParser.cc)
target_link_libraries(validate_connections
PRIVATE
ignition-gazebo${IGN_GAZEBO_VER}::core
ignition-common3::ignition-common3
ignition-launch1::ignition-launch1
ignition-math6::ignition-math6
ignition-msgs4::ignition-msgs4
ignition-plugin1::loader
ignition-transport7::ignition-transport7
${catkin_LIBRARIES}
${protobuf_lib_name}
)
install(TARGETS validate_connections
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin)


# Create the libCommsBrokerPlugin.so library.
set(comms_broker_plugin_name CommsBrokerPlugin)
add_library(${comms_broker_plugin_name}
Expand Down
10 changes: 7 additions & 3 deletions subt_ign/launch/cave_circuit.ign
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,13 @@

<%
# disable levels for simple cave worlds
levels = "true"
$levels = "true"
if $worldName.include?('simple_cave_')
levels = "false"
$levels = "false"
end

if defined?(levels) && levels != nil && !levels.empty?
$levels = levels.downcase == "true"
end
%>

Expand Down Expand Up @@ -232,7 +236,7 @@
<update_rate><%= updateRate %></update_rate>
<%end%>
<run>true</run>
<levels><%= levels %></levels>
<levels><%= $levels %></levels>
<record>
<enabled>true</enabled>
<!-- This path is used by cloudsim, please do not change -->
Expand Down
10 changes: 7 additions & 3 deletions subt_ign/launch/cloudsim_sim.ign
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,13 @@

<%
# disable levels for simple cave worlds
levels = "true"
$levels = "true"
if $worldName.include?('simple_cave_')
levels = "false"
$levels = "false"
end

if defined?(levels) && levels != nil && !levels.empty?
$levels = levels.downcase == "true"
end
%>

Expand Down Expand Up @@ -238,7 +242,7 @@
<update_rate><%= updateRate %></update_rate>
<%end%>
<run>true</run>
<levels><%= levels %></levels>
<levels><%= $levels %></levels>
<record>
<enabled>true</enabled>
<!-- This path is used by cloudsim, please do not change -->
Expand Down
15 changes: 12 additions & 3 deletions subt_ign/src/ConnectionValidatorPrivate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -327,18 +327,27 @@ void ConnectionValidatorPrivate::PopulateConnections()
{
for (auto cap: caps)
{
if (point.Equal(cap, 1))
if (point.Equal(cap, 1.0))
{
igndbg << "Found cap!" << std::endl;
found_caps += 1;
}
else if (point.Equal(cap, 12.6))
{
igndbg << "Found cap (with expanded tolerance)" << std::endl;
found_caps += 1;
}
}
}

if (actual + found_caps != data)
{
igndbg << name << " " << actualConnections[name] << "/" << data <<
" (" << this->vertData[name].tileType << ")" << std::endl;
igndbg << "Actual connections[" << actualConnections[name]
<< "] do not match expected connections[" << data
<< "] for tile name[" << name << "] with type["
<< this->vertData[name].tileType << "]. "
<< "Missing an end cap or connecting tile."
<< std::endl;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
*
*/

/// Helper test to evaluate graph population without starting gazebo.
/// Call with TEST_connection_validator <world_name>
/// Helper to evaluate graph population without starting gazebo.
/// Call with `validate_connections` <world_name>
#include "ConnectionValidatorPrivate.hh"

#include <ignition/common/Console.hh>
Expand Down
134 changes: 134 additions & 0 deletions subt_ign/worlds/cave_circuit_practice_01.sdf
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,140 @@
<uri>https://fuel.ignitionrobotics.org/1.0/OpenRobotics/models/Samsung J8 Black</uri>
</include>

<model name="performer_detector_1">
<static>true</static>
<pose>287.47 -105.5 -19.67 0 0 0</pose>
<!--Uncomment <link> to preview detector region-->
<!--<link name='body'>-->
<!-- <visual name="v1">-->
<!-- <transparency>0.5</transparency>-->
<!-- <geometry>-->
<!-- <box>-->
<!-- <size>20 30 20</size>-->
<!-- </box>-->
<!-- </geometry>-->
<!-- </visual>-->
<!-- <material>-->
<!-- <ambient>0.0 1.0 0.0 1</ambient>-->
<!-- <diffuse>0.0 1.0 0.0 1</diffuse>-->
<!-- <specular>0.5 0.5 0.5 1</specular>-->
<!-- </material>-->
<!-- <cast_shadows>false</cast_shadows>-->
<!--</link>-->
<plugin filename="libignition-gazebo-performer-detector-system.so"
name="ignition::gazebo::systems::PerformerDetector">
<topic>/subt_performer_detector</topic>
<geometry>
<box>
<size>20 30 20</size>
</box>
</geometry>
</plugin>

<!--Triggered by performer_detector_1-->
<plugin name="ignition::gazebo::systems::TriggeredPublisher" filename="libignition-gazebo-triggered-publisher-system.so">
<input type="ignition.msgs.Pose" topic="/subt_performer_detector">
<match field='header.data'>{ key: "frame_id" value: "performer_detector_1" }</match>
<match field='header.data'>{ key: "state" value: "1" }</match>
</input>
<output type="ignition.msgs.Empty" topic="/model/medium_rock_fall_1/breadcrumbs/Rock/deploy"/>
</plugin>
</model>
<include>
<uri>https://fuel.ignitionrobotics.org/1.0/OpenRobotics/models/Medium Rock Fall</uri>
<name>medium_rock_fall_1</name>
<pose>284.95 -104.381 -15.65 0 -1.0147 0</pose>
</include>
<model name="performer_detector_2">
<static>true</static>
<pose>101 -296 4 0 0 0</pose>
<!--Uncomment <link> to preview detector region-->
<!--<link name='body'>-->
<!-- <visual name="v1">-->
<!-- <transparency>0.5</transparency>-->
<!-- <geometry>-->
<!-- <box>-->
<!-- <size>16 16 15</size>-->
<!-- </box>-->
<!-- </geometry>-->
<!-- </visual>-->
<!-- <material>-->
<!-- <ambient>0.0 1.0 0.0 1</ambient>-->
<!-- <diffuse>0.0 1.0 0.0 1</diffuse>-->
<!-- <specular>0.5 0.5 0.5 1</specular>-->
<!-- </material>-->
<!-- <cast_shadows>false</cast_shadows>-->
<!--</link>-->
<plugin filename="libignition-gazebo-performer-detector-system.so"
name="ignition::gazebo::systems::PerformerDetector">
<topic>/subt_performer_detector</topic>
<geometry>
<box>
<size>16 16 15</size>
</box>
</geometry>
</plugin>

<!--Triggered by performer_detector_2-->
<plugin name="ignition::gazebo::systems::TriggeredPublisher" filename="libignition-gazebo-triggered-publisher-system.so">
<input type="ignition.msgs.Pose" topic="/subt_performer_detector">
<match field='header.data'>{ key: "frame_id" value: "performer_detector_2" }</match>
<match field='header.data'>{ key: "state" value: "0" }</match>
</input>
<output type="ignition.msgs.Empty" topic="/model/large_rock_fall_1/breadcrumbs/Rock/deploy"/>
</plugin>
</model>
<include>
<uri>https://fuel.ignitionrobotics.org/1.0/OpenRobotics/models/Large Rock Fall</uri>
<name>large_rock_fall_1</name>
<pose>102.692000 -295.402000 3.005300 0 0.402990 -0.915400</pose>
</include>

<model name="performer_detector_3">
<static>true</static>
<pose>178 -270 -45 0 0 0</pose>
<!--Uncomment <link> to preview detector region-->
<!--<link name='body'>-->
<!-- <visual name="v1">-->
<!-- <transparency>0.5</transparency>-->
<!-- <geometry>-->
<!-- <box>-->
<!-- <size>16 16 15</size>-->
<!-- </box>-->
<!-- </geometry>-->
<!-- </visual>-->
<!-- <material>-->
<!-- <ambient>0.0 1.0 0.0 1</ambient>-->
<!-- <diffuse>0.0 1.0 0.0 1</diffuse>-->
<!-- <specular>0.5 0.5 0.5 1</specular>-->
<!-- </material>-->
<!-- <cast_shadows>false</cast_shadows>-->
<!--</link>-->
<plugin filename="libignition-gazebo-performer-detector-system.so"
name="ignition::gazebo::systems::PerformerDetector">
<topic>/subt_performer_detector</topic>
<geometry>
<box>
<size>16 16 15</size>
</box>
</geometry>
</plugin>

<!--Triggered by performer_detector_2-->
<plugin name="ignition::gazebo::systems::TriggeredPublisher" filename="libignition-gazebo-triggered-publisher-system.so">
<input type="ignition.msgs.Pose" topic="/subt_performer_detector">
<match field='header.data'>{ key: "frame_id" value: "performer_detector_3" }</match>
<match field='header.data'>{ key: "state" value: "0" }</match>
</input>
<output type="ignition.msgs.Empty" topic="/model/large_rock_fall_2/breadcrumbs/Rock/deploy"/>
</plugin>
</model>
<include>
<uri>https://fuel.ignitionrobotics.org/1.0/OpenRobotics/models/Large Rock Fall</uri>
<name>large_rock_fall_2</name>
<pose>178.14 -270 -47.83 0.210254 0 1.57</pose>
</include>

<!-- Auto generated: level_generator 161 182 140 40 -->
<plugin name="ignition::gazebo" filename="dummy">
<level name="level0">
Expand Down
Loading