Skip to content

Commit

Permalink
Merge pull request #411 from osrf/teambase
Browse files Browse the repository at this point in the history
Adding team base
  • Loading branch information
nkoenig authored May 11, 2020
2 parents 7e6f070 + c94f34e commit 5ef7adb
Show file tree
Hide file tree
Showing 12 changed files with 319 additions and 1 deletion.
43 changes: 43 additions & 0 deletions subt_ign/launch/cave_circuit.ign
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
spawnWorldYaw = 0
guiCameraPose = "-6.3 -4.2 3.6 0 0.268 0.304"
teamBaseSpawned = false
# Check if robotNameX and robotConfigX exists
spawnRowSize = 4
spawnColSize = 5
Expand Down Expand Up @@ -1087,6 +1089,38 @@
" <command>roslaunch --wait subt_ros vehicle_topics.launch world_name:=#{$worldName} name:=#{_name} uav:=#{uav} laser_scan:=#{laserScan} stereo_cam:=#{stereoCam} rgbd_cam:=#{rgbdCam} breadcrumbs:=0</command>\n"\
"</executable>\n"
end
def spawnTeamBase(_x, _y, _z, _yaw)
"<plugin name=\"ignition::launch::GazeboFactory\"\n"\
" filename=\"libignition-launch-gazebo-factory.so\">\n"\
" <name>TeamBase</name>\n"\
" <allow_renaming>false</allow_renaming>\n"\
" <world>#{$worldName}</world>\n"\
" <is_performer>false</is_performer>\n"\
" <sdf version='1.6'>\n"\
" <model name='TeamBase'>\n"\
" <pose>#{_x} #{_y} #{_z} 0 0 #{_yaw}</pose>\n"\
" <static>true</static>\n"\
" <link name='link'>\n"\
" <pose>0 0 0.05 0 0 0</pose>\n"\
" <visual name='visual'>\n"\
" <geometry>\n"\
" <box>\n"\
" <size>.1 .1 .1</size>\n"\
" </box>\n"\
" </geometry>\n"\
" </visual>\n"\
" </link>\n"\
" </model>\n"\
" </sdf>\n"\
"</plugin>\n"\
"<executable name='teambase_description'>\n"\
" <command>roslaunch --wait subt_ros teambase_description.launch world_name:=#{$worldName}</command>\n"\
"</executable>\n"\
"<executable name='teambase_ros_ign_bridge'>\n"\
" <command>roslaunch --wait subt_ros teambase_topics.launch world_name:=#{$worldName}</command>\n"\
"</executable>\n"
end
%>

<%
Expand Down Expand Up @@ -1122,6 +1156,15 @@
%>
<%= spawnX4(name, robotConfigN, posX, posY, spawnWorldZPos, spawnWorldYaw) %>
<%
elsif (name.downcase == "teambase" || name.downcase == "team_base") &&
(config.downcase == "teambase" || config.downcase == "team_base")
robotSpawned += 1
if !teamBaseSpawned
teamBaseSpawned = true
%>
<%= spawnTeamBase(posX, posY, spawnWorldZPos, spawnWorldYaw) %>
<%
end
else
# Try a team-submitted vehicle.
package = config.downcase
Expand Down
22 changes: 21 additions & 1 deletion subt_ign/launch/cloudsim_bridge.ign
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
%>

<%
teamBaseSpawned = false
# Check if robotNameX and robotConfigX exists
maxRobotCount = 20
robotNames = []
Expand Down Expand Up @@ -184,6 +186,15 @@
" <command>roslaunch --wait subt_ros vehicle_topics.launch world_name:=#{$worldName} name:=#{_name} uav:=#{uav} laser_scan:=#{laserScan} stereo_cam:=#{stereoCam} rgbd_cam:=#{rgbdCam} breadcrumbs:=0</command>\n"\
"</executable>\n"
end
def spawnTeamBase(_x, _y, _z, _yaw)
"<executable name='teambase_description'>\n"\
" <command>roslaunch --wait subt_ros teambase_description.launch world_name:=#{$worldName}</command>\n"\
"</executable>\n"\
"<executable name='teambase_ros_ign_bridge'>\n"\
" <command>roslaunch --wait subt_ros teambase_topics.launch world_name:=#{$worldName}</command>\n"\
"</executable>\n"
end
%>

<%
Expand All @@ -199,7 +210,16 @@
<%= spawnX3(robotNames[i], robotConfigs[i][-1]) %>
<% elsif robotConfigs[i][1] == "4" and (robotConfigN == "1" or robotConfigN == "2" or robotConfigN == "3" or robotConfigN == "4" or robotConfigN == "5") %>
<%= spawnX4(robotNames[i], robotConfigs[i][-1]) %>
<% else
<%
elsif (name.downcase == "teambase" || name.downcase == "team_base") &&
(config.downcase == "teambase" || config.downcase == "team_base")
robotSpawned += 1
if !teamBaseSpawned
teamBaseSpawned = true
%>
<%= spawnTeamBase(posX, posY, spawnWorldZPos, spawnWorldYaw) %>
<% end
else
# Try a team-submitted vehicle.
package = config.downcase
installDir = `rospack find #{package}`.chomp
Expand Down
37 changes: 37 additions & 0 deletions subt_ign/launch/cloudsim_sim.ign
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@
guiCameraPose = "-6.3 -4.2 3.6 0 0.268 0.304"
end
teamBaseSpawned = false
# Check if robotNameX and robotConfigX exists
spawnRowSize = 4
spawnColSize = 5
Expand Down Expand Up @@ -1077,6 +1079,32 @@
" </sdf>\n"\
"</plugin>\n"
end
def spawnTeamBase(_x, _y, _z, _yaw)
"<plugin name=\"ignition::launch::GazeboFactory\"\n"\
" filename=\"libignition-launch-gazebo-factory.so\">\n"\
" <name>TeamBase</name>\n"\
" <allow_renaming>false</allow_renaming>\n"\
" <world>#{$worldName}</world>\n"\
" <is_performer>false</is_performer>\n"\
" <sdf version='1.6'>\n"\
" <model name='TeamBase'>\n"\
" <pose>#{_x} #{_y} #{_z} 0 0 #{_yaw}</pose>\n"\
" <static>true</static>\n"\
" <link name='link'>\n"\
" <pose>0 0 0.05 0 0 0</pose>\n"\
" <visual name='visual'>\n"\
" <geometry>\n"\
" <box>\n"\
" <size>.1 .1 .1</size>\n"\
" </box>\n"\
" </geometry>\n"\
" </visual>\n"\
" </link>\n"\
" </model>\n"\
" </sdf>\n"\
"</plugin>\n"
end
%>

<%
Expand Down Expand Up @@ -1112,6 +1140,15 @@
%>
<%= spawnX4(name, robotConfigN, posX, posY, spawnWorldZPos, spawnWorldYaw) %>
<%
elsif (name.downcase == "teambase" || name.downcase == "team_base") &&
(config.downcase == "teambase" || config.downcase == "team_base")
robotSpawned += 1
if !teamBaseSpawned
teamBaseSpawned = true
%>
<%= spawnTeamBase(posX, posY, spawnWorldZPos, spawnWorldYaw) %>
<%
end
else
# Try a team-submitted vehicle.
package = config.downcase
Expand Down
43 changes: 43 additions & 0 deletions subt_ign/launch/competition.ign
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
%>

<%
teamBaseSpawned = false
# Check if robotNameX and robotConfigX exists
spawnRowSize = 4
spawnColSize = 5
Expand Down Expand Up @@ -959,6 +961,38 @@
" <command>roslaunch --wait subt_ros vehicle_topics.launch world_name:=#{$worldName} name:=#{_name} uav:=#{uav} laser_scan:=#{laserScan} stereo_cam:=#{stereoCam} rgbd_cam:=#{rgbdCam} breadcrumbs:=0</command>\n"\
"</executable>\n"
end
def spawnTeamBase(_x, _y, _z, _yaw)
"<plugin name=\"ignition::launch::GazeboFactory\"\n"\
" filename=\"libignition-launch-gazebo-factory.so\">\n"\
" <name>TeamBase</name>\n"\
" <allow_renaming>false</allow_renaming>\n"\
" <world>#{$worldName}</world>\n"\
" <is_performer>false</is_performer>\n"\
" <sdf version='1.6'>\n"\
" <model name='TeamBase'>\n"\
" <pose>#{_x} #{_y} #{_z} 0 0 #{_yaw}</pose>\n"\
" <static>true</static>\n"\
" <link name='link'>\n"\
" <pose>0 0 0.05 0 0 0</pose>\n"\
" <visual name='visual'>\n"\
" <geometry>\n"\
" <box>\n"\
" <size>.1 .1 .1</size>\n"\
" </box>\n"\
" </geometry>\n"\
" </visual>\n"\
" </link>\n"\
" </model>\n"\
" </sdf>\n"\
"</plugin>\n"\
"<executable name='teambase_description'>\n"\
" <command>roslaunch --wait subt_ros teambase_description.launch world_name:=#{$worldName}</command>\n"\
"</executable>\n"\
"<executable name='teambase_ros_ign_bridge'>\n"\
" <command>roslaunch --wait subt_ros teambase_topics.launch world_name:=#{$worldName}</command>\n"\
"</executable>\n"
end
%>

<%
Expand Down Expand Up @@ -988,6 +1022,15 @@
%>
<%= spawnX4(name, robotConfigN, posX, posY) %>
<%
elsif (name.downcase == "teambase" || name.downcase == "team_base") &&
(config.downcase == "teambase" || config.downcase == "team_base")
robotSpawned += 1
if !teamBaseSpawned
teamBaseSpawned = true
%>
<%= spawnTeamBase(posX, posY, spawnWorldZPos, spawnWorldYaw) %>
<%
end
else
# Try a team-submitted vehicle.
package = config.downcase
Expand Down
43 changes: 43 additions & 0 deletions subt_ign/launch/tunnel_circuit_practice.ign
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
%>

<%
teamBaseSpawned = false
# Check if robotNameX and robotConfigX exists
spawnRowSize = 4
spawnColSize = 5
Expand Down Expand Up @@ -950,6 +952,38 @@
" <command>roslaunch --wait subt_ros vehicle_topics.launch world_name:=#{$worldName} name:=#{_name} uav:=#{uav} laser_scan:=#{laserScan} stereo_cam:=#{stereoCam} rgbd_cam:=#{rgbdCam} breadcrumbs:=0</command>\n"\
"</executable>\n"
end
def spawnTeamBase(_x, _y, _z, _yaw)
"<plugin name=\"ignition::launch::GazeboFactory\"\n"\
" filename=\"libignition-launch-gazebo-factory.so\">\n"\
" <name>TeamBase</name>\n"\
" <allow_renaming>false</allow_renaming>\n"\
" <world>#{$worldName}</world>\n"\
" <is_performer>false</is_performer>\n"\
" <sdf version='1.6'>\n"\
" <model name='TeamBase'>\n"\
" <pose>#{_x} #{_y} #{_z} 0 0 #{_yaw}</pose>\n"\
" <static>true</static>\n"\
" <link name='link'>\n"\
" <pose>0 0 0.05 0 0 0</pose>\n"\
" <visual name='visual'>\n"\
" <geometry>\n"\
" <box>\n"\
" <size>.1 .1 .1</size>\n"\
" </box>\n"\
" </geometry>\n"\
" </visual>\n"\
" </link>\n"\
" </model>\n"\
" </sdf>\n"\
"</plugin>\n"\
"<executable name='teambase_description'>\n"\
" <command>roslaunch --wait subt_ros teambase_description.launch world_name:=#{$worldName}</command>\n"\
"</executable>\n"\
"<executable name='teambase_ros_ign_bridge'>\n"\
" <command>roslaunch --wait subt_ros teambase_topics.launch world_name:=#{$worldName}</command>\n"\
"</executable>\n"
end
%>

<%
Expand Down Expand Up @@ -979,6 +1013,15 @@
%>
<%= spawnX4(name, robotConfigN, posX, posY) %>
<%
elsif (name.downcase == "teambase" || name.downcase == "team_base") &&
(config.downcase == "teambase" || config.downcase == "team_base")
robotSpawned += 1
if !teamBaseSpawned
teamBaseSpawned = true
%>
<%= spawnTeamBase(posX, posY, spawnWorldZPos, spawnWorldYaw) %>
<%
end
else
# Try a team-submitted vehicle.
package = config.downcase
Expand Down
43 changes: 43 additions & 0 deletions subt_ign/launch/urban_circuit.ign
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
spawnWorldZPos = 7.5
spawnWorldYaw = 0
teamBaseSpawned = false
# Check if robotNameX and robotConfigX exists
spawnRowSize = 4
spawnColSize = 5
Expand Down Expand Up @@ -1008,6 +1010,38 @@
" <command>roslaunch --wait subt_ros vehicle_topics.launch world_name:=#{$worldName} name:=#{_name} uav:=#{uav} laser_scan:=#{laserScan} stereo_cam:=#{stereoCam} rgbd_cam:=#{rgbdCam} breadcrumbs:=0</command>\n"\
"</executable>\n"
end
def spawnTeamBase(_x, _y, _z, _yaw)
"<plugin name=\"ignition::launch::GazeboFactory\"\n"\
" filename=\"libignition-launch-gazebo-factory.so\">\n"\
" <name>TeamBase</name>\n"\
" <allow_renaming>false</allow_renaming>\n"\
" <world>#{$worldName}</world>\n"\
" <is_performer>false</is_performer>\n"\
" <sdf version='1.6'>\n"\
" <model name='TeamBase'>\n"\
" <pose>#{_x} #{_y} #{_z} 0 0 #{_yaw}</pose>\n"\
" <static>true</static>\n"\
" <link name='link'>\n"\
" <pose>0 0 0.05 0 0 0</pose>\n"\
" <visual name='visual'>\n"\
" <geometry>\n"\
" <box>\n"\
" <size>.1 .1 .1</size>\n"\
" </box>\n"\
" </geometry>\n"\
" </visual>\n"\
" </link>\n"\
" </model>\n"\
" </sdf>\n"\
"</plugin>\n"\
"<executable name='teambase_description'>\n"\
" <command>roslaunch --wait subt_ros teambase_description.launch world_name:=#{$worldName}</command>\n"\
"</executable>\n"\
"<executable name='teambase_ros_ign_bridge'>\n"\
" <command>roslaunch --wait subt_ros teambase_topics.launch world_name:=#{$worldName}</command>\n"\
"</executable>\n"
end
%>

<%
Expand Down Expand Up @@ -1043,6 +1077,15 @@
%>
<%= spawnX4(name, robotConfigN, posX, posY, spawnWorldZPos, spawnWorldYaw) %>
<%
elsif (name.downcase == "teambase" || name.downcase == "team_base") &&
(config.downcase == "teambase" || config.downcase == "team_base")
robotSpawned += 1
if !teamBaseSpawned
teamBaseSpawned = true
%>
<%= spawnTeamBase(posX, posY, spawnWorldZPos, spawnWorldYaw) %>
<%
end
else
# Try a team-submitted vehicle.
package = config.downcase
Expand Down
Loading

0 comments on commit 5ef7adb

Please sign in to comment.