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

Adding team base #411

Merged
merged 4 commits into from
May 11, 2020
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
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 @@ -1038,6 +1040,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}</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 @@ -1073,6 +1107,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 @@ -174,6 +176,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}</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 @@ -189,7 +200,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 @@ -1038,6 +1040,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 @@ -1073,6 +1101,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 @@ -946,6 +948,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}</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 @@ -975,6 +1009,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 @@ -938,6 +940,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}</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 @@ -967,6 +1001,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 @@ -999,6 +1001,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}</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 @@ -1034,6 +1068,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