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

Teambase name updates #477

Merged
merged 1 commit into from
Jun 25, 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
22 changes: 11 additions & 11 deletions subt_ign/launch/cave_circuit.ign
Original file line number Diff line number Diff line change
Expand Up @@ -1290,15 +1290,15 @@
return spawn, exec
end

def spawnTeamBase(_x, _y, _z, _yaw)
def spawnTeamBase(_name, _x, _y, _z, _yaw)
spawn = <<-HEREDOC
<spawn name='TEAMBASE'>
<name>TEAMBASE</name>
<spawn name='#{_name}'>
<name>#{_name}</name>
<allow_renaming>false</allow_renaming>
<world>#{$worldName}</world>
<is_performer>false</is_performer>
<sdf version='1.6'>
<model name='TEAMBASE'>
<model name='#{_name}'>
<pose>#{_x} #{_y} #{_z} 0 0 #{_yaw}</pose>
<static>true</static>
<link name='link'>
Expand All @@ -1318,10 +1318,10 @@

exec = <<-HEREDOC
<executable name='teambase_description'>
<command>roslaunch --wait subt_ros teambase_description.launch world_name:=#{$worldName}</command>
<command>roslaunch --wait subt_ros teambase_description.launch world_name:=#{$worldName} name:=#{_name}</command>
</executable>
<executable name='teambase_ros_ign_bridge'>
<command>roslaunch --wait subt_ros teambase_topics.launch world_name:=#{$worldName}</command>
<command>roslaunch --wait subt_ros teambase_topics.launch world_name:=#{$worldName} name:=#{_name}</command>
</executable>
HEREDOC

Expand Down Expand Up @@ -1384,13 +1384,15 @@

spawnStringTmp, executables = spawnX4(name, robotConfigN, robot.pos.x, robot.pos.y, robot.pos.z, robot.rot.yaw)

elsif name == "TEAMBASE" and config == "TEAMBASE"
elsif config.upcase == "TEAMBASE"
robotSpawned += 1
if !teamBaseSpawned
teamBaseSpawned = true
spawnStringTmp, executables = spawnTeamBase(posX, posY, spawnWorldZPos, spawnWorldYaw)
spawnStringTmp, executables = spawnTeamBase(name, posX, posY, spawnWorldZPos, spawnWorldYaw)
else
puts "Error: Only 1 teambase is allows. Skpping[%s]." % [name]
end
elsif config != "TEAMBASE"
else
# Try a team-submitted vehicle.
package = config.downcase
installDir = `rospack find #{package}`.chomp
Expand Down Expand Up @@ -1432,8 +1434,6 @@
spawnStringTmp = spawner(name, modelURI, $worldName, robot.pos.x, robot.pos.y, robot.pos.z, 0, 0, robot.rot.yaw)
executables = rosExecutables(name, $worldName)
end
else
puts "Error: Invalid Name[%s] or Config[%s]. Skpping." % [name, config]
end

if executables != nil
Expand Down
10 changes: 5 additions & 5 deletions subt_ign/launch/cloudsim_bridge.ign
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,12 @@
"</executable>\n"
end

def spawnTeamBase()
def spawnTeamBase(_name)
"<executable name='teambase_description'>\n"\
" <command>roslaunch --wait subt_ros teambase_description.launch world_name:=#{$worldName}</command>\n"\
" <command>roslaunch --wait subt_ros teambase_description.launch world_name:=#{$worldName} name:=#{_name}</command>\n"\
"</executable>\n"\
"<executable name='teambase_ros_ign_bridge'>\n"\
" <command>roslaunch --wait subt_ros teambase_topics.launch world_name:=#{$worldName}</command>\n"\
" <command>roslaunch --wait subt_ros teambase_topics.launch world_name:=#{$worldName} name:=#{_name}</command>\n"\
"</executable>\n"
end
%>
Expand All @@ -203,11 +203,11 @@
<% 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]) %>
<%
elsif name == "TEAMBASE" and config == "TEAMBASE"
elsif config.upcase == "TEAMBASE"
if !teamBaseSpawned
teamBaseSpawned = true
%>
<%= spawnTeamBase() %>
<%= spawnTeamBase(robotNames[i]) %>
<% end
else
# Try a team-submitted vehicle.
Expand Down
22 changes: 11 additions & 11 deletions subt_ign/launch/cloudsim_sim.ign
Original file line number Diff line number Diff line change
Expand Up @@ -1291,15 +1291,15 @@
return spawn, exec
end

def spawnTeamBase(_x, _y, _z, _yaw)
def spawnTeamBase(_name, _x, _y, _z, _yaw)
spawn = <<-HEREDOC
<spawn name='TEAMBASE'>
<name>TEAMBASE</name>
<spawn name='#{_name}'>
<name>#{_name}</name>
<allow_renaming>false</allow_renaming>
<world>#{$worldName}</world>
<is_performer>false</is_performer>
<sdf version='1.6'>
<model name='TEAMBASE'>
<model name='#{_name}'>
<pose>#{_x} #{_y} #{_z} 0 0 #{_yaw}</pose>
<static>true</static>
<link name='link'>
Expand All @@ -1319,10 +1319,10 @@

exec = <<-HEREDOC
<executable name='teambase_description'>
<command>roslaunch --wait subt_ros teambase_description.launch world_name:=#{$worldName}</command>
<command>roslaunch --wait subt_ros teambase_description.launch world_name:=#{$worldName} name:=#{_name}</command>
</executable>
<executable name='teambase_ros_ign_bridge'>
<command>roslaunch --wait subt_ros teambase_topics.launch world_name:=#{$worldName}</command>
<command>roslaunch --wait subt_ros teambase_topics.launch world_name:=#{$worldName} name:=#{_name}</command>
</executable>
HEREDOC

Expand Down Expand Up @@ -1385,13 +1385,15 @@

spawnStringTmp, executables = spawnX4(name, robotConfigN, robot.pos.x, robot.pos.y, robot.pos.z, robot.rot.yaw)

elsif name == "TEAMBASE" and config == "TEAMBASE"
elsif config.upcase == "TEAMBASE"
robotSpawned += 1
if !teamBaseSpawned
teamBaseSpawned = true
spawnStringTmp, executables = spawnTeamBase(posX, posY, spawnWorldZPos, spawnWorldYaw)
spawnStringTmp, executables = spawnTeamBase(name, posX, posY, spawnWorldZPos, spawnWorldYaw)
else
puts "Error: Only 1 teambase is allows. Skpping[%s]." % [name]
end
elsif config != "TEAMBASE"
else
# Try a team-submitted vehicle.
package = config.downcase
installDir = `rospack find #{package}`.chomp
Expand Down Expand Up @@ -1433,8 +1435,6 @@
spawnStringTmp = spawner(name, modelURI, $worldName, robot.pos.x, robot.pos.y, robot.pos.z, 0, 0, robot.rot.yaw)
executables = rosExecutables(name, $worldName)
end
else
puts "Error: Invalid Name[%s] or Config[%s]. Skpping." % [name, config]
end

if executables != nil
Expand Down
22 changes: 11 additions & 11 deletions subt_ign/launch/competition.ign
Original file line number Diff line number Diff line change
Expand Up @@ -1287,15 +1287,15 @@
return spawn, exec
end

def spawnTeamBase(_x, _y, _z, _yaw)
def spawnTeamBase(_name, _x, _y, _z, _yaw)
spawn = <<-HEREDOC
<spawn name='TEAMBASE'>
<name>TEAMBASE</name>
<spawn name='#{_name}'>
<name>#{_name}</name>
<allow_renaming>false</allow_renaming>
<world>#{$worldName}</world>
<is_performer>false</is_performer>
<sdf version='1.6'>
<model name='TEAMBASE'>
<model name='#{_name}'>
<pose>#{_x} #{_y} #{_z} 0 0 #{_yaw}</pose>
<static>true</static>
<link name='link'>
Expand All @@ -1315,10 +1315,10 @@

exec = <<-HEREDOC
<executable name='teambase_description'>
<command>roslaunch --wait subt_ros teambase_description.launch world_name:=#{$worldName}</command>
<command>roslaunch --wait subt_ros teambase_description.launch world_name:=#{$worldName} name:=#{_name}</command>
</executable>
<executable name='teambase_ros_ign_bridge'>
<command>roslaunch --wait subt_ros teambase_topics.launch world_name:=#{$worldName}</command>
<command>roslaunch --wait subt_ros teambase_topics.launch world_name:=#{$worldName} name:=#{_name}</command>
</executable>
HEREDOC

Expand Down Expand Up @@ -1381,13 +1381,15 @@

spawnStringTmp, executables = spawnX4(name, robotConfigN, robot.pos.x, robot.pos.y, robot.pos.z, robot.rot.yaw)

elsif name == "TEAMBASE" and config == "TEAMBASE"
elsif config.upcase == "TEAMBASE"
robotSpawned += 1
if !teamBaseSpawned
teamBaseSpawned = true
spawnStringTmp, executables = spawnTeamBase(posX, posY, spawnWorldZPos, spawnWorldYaw)
spawnStringTmp, executables = spawnTeamBase(name, posX, posY, spawnWorldZPos, spawnWorldYaw)
else
puts "Error: Only 1 teambase is allows. Skpping[%s]." % [name]
end
elsif config != "TEAMBASE"
else
# Try a team-submitted vehicle.
package = config.downcase
installDir = `rospack find #{package}`.chomp
Expand Down Expand Up @@ -1429,8 +1431,6 @@
spawnStringTmp = spawner(name, modelURI, $worldName, robot.pos.x, robot.pos.y, robot.pos.z, 0, 0, robot.rot.yaw)
executables = rosExecutables(name, $worldName)
end
else
puts "Error: Invalid Name[%s] or Config[%s]. Skpping." % [name, config]
end

if executables != nil
Expand Down
22 changes: 11 additions & 11 deletions subt_ign/launch/tunnel_circuit_practice.ign
Original file line number Diff line number Diff line change
Expand Up @@ -1290,15 +1290,15 @@
return spawn, exec
end

def spawnTeamBase(_x, _y, _z, _yaw)
def spawnTeamBase(_name, _x, _y, _z, _yaw)
spawn = <<-HEREDOC
<spawn name='TEAMBASE'>
<name>TEAMBASE</name>
<spawn name='#{_name}'>
<name>#{_name}</name>
<allow_renaming>false</allow_renaming>
<world>#{$worldName}</world>
<is_performer>false</is_performer>
<sdf version='1.6'>
<model name='TEAMBASE'>
<model name='#{_name}'>
<pose>#{_x} #{_y} #{_z} 0 0 #{_yaw}</pose>
<static>true</static>
<link name='link'>
Expand All @@ -1318,10 +1318,10 @@

exec = <<-HEREDOC
<executable name='teambase_description'>
<command>roslaunch --wait subt_ros teambase_description.launch world_name:=#{$worldName}</command>
<command>roslaunch --wait subt_ros teambase_description.launch world_name:=#{$worldName} name:=#{_name}</command>
</executable>
<executable name='teambase_ros_ign_bridge'>
<command>roslaunch --wait subt_ros teambase_topics.launch world_name:=#{$worldName}</command>
<command>roslaunch --wait subt_ros teambase_topics.launch world_name:=#{$worldName} name:=#{_name}</command>
</executable>
HEREDOC

Expand Down Expand Up @@ -1384,13 +1384,15 @@

spawnStringTmp, executables = spawnX4(name, robotConfigN, robot.pos.x, robot.pos.y, robot.pos.z, robot.rot.yaw)

elsif name == "TEAMBASE" and config == "TEAMBASE"
elsif config.upcase == "TEAMBASE"
robotSpawned += 1
if !teamBaseSpawned
teamBaseSpawned = true
spawnStringTmp, executables = spawnTeamBase(posX, posY, spawnWorldZPos, spawnWorldYaw)
spawnStringTmp, executables = spawnTeamBase(name, posX, posY, spawnWorldZPos, spawnWorldYaw)
else
puts "Error: Only 1 teambase is allows. Skpping[%s]." % [name]
end
elsif config != "TEAMBASE"
else
# Try a team-submitted vehicle.
package = config.downcase
installDir = `rospack find #{package}`.chomp
Expand Down Expand Up @@ -1432,8 +1434,6 @@
spawnStringTmp = spawner(name, modelURI, $worldName, robot.pos.x, robot.pos.y, robot.pos.z, 0, 0, robot.rot.yaw)
executables = rosExecutables(name, $worldName)
end
else
puts "Error: Invalid Name[%s] or Config[%s]. Skpping." % [name, config]
end

if executables != nil
Expand Down
22 changes: 11 additions & 11 deletions subt_ign/launch/urban_circuit.ign
Original file line number Diff line number Diff line change
Expand Up @@ -1290,15 +1290,15 @@
return spawn, exec
end

def spawnTeamBase(_x, _y, _z, _yaw)
def spawnTeamBase(_name, _x, _y, _z, _yaw)
spawn = <<-HEREDOC
<spawn name='TEAMBASE'>
<name>TEAMBASE</name>
<spawn name='#{_name}'>
<name>#{_name}</name>
<allow_renaming>false</allow_renaming>
<world>#{$worldName}</world>
<is_performer>false</is_performer>
<sdf version='1.6'>
<model name='TEAMBASE'>
<model name='#{_name}'>
<pose>#{_x} #{_y} #{_z} 0 0 #{_yaw}</pose>
<static>true</static>
<link name='link'>
Expand All @@ -1318,10 +1318,10 @@

exec = <<-HEREDOC
<executable name='teambase_description'>
<command>roslaunch --wait subt_ros teambase_description.launch world_name:=#{$worldName}</command>
<command>roslaunch --wait subt_ros teambase_description.launch world_name:=#{$worldName} name:=#{_name}</command>
</executable>
<executable name='teambase_ros_ign_bridge'>
<command>roslaunch --wait subt_ros teambase_topics.launch world_name:=#{$worldName}</command>
<command>roslaunch --wait subt_ros teambase_topics.launch world_name:=#{$worldName} name:=#{_name}</command>
</executable>
HEREDOC

Expand Down Expand Up @@ -1384,13 +1384,15 @@

spawnStringTmp, executables = spawnX4(name, robotConfigN, robot.pos.x, robot.pos.y, robot.pos.z, robot.rot.yaw)

elsif name == "TEAMBASE" and config == "TEAMBASE"
elsif config.upcase == "TEAMBASE"
robotSpawned += 1
if !teamBaseSpawned
teamBaseSpawned = true
spawnStringTmp, executables = spawnTeamBase(posX, posY, spawnWorldZPos, spawnWorldYaw)
spawnStringTmp, executables = spawnTeamBase(name, posX, posY, spawnWorldZPos, spawnWorldYaw)
else
puts "Error: Only 1 teambase is allows. Skpping[%s]." % [name]
end
elsif config != "TEAMBASE"
else
# Try a team-submitted vehicle.
package = config.downcase
installDir = `rospack find #{package}`.chomp
Expand Down Expand Up @@ -1432,8 +1434,6 @@
spawnStringTmp = spawner(name, modelURI, $worldName, robot.pos.x, robot.pos.y, robot.pos.z, 0, 0, robot.rot.yaw)
executables = rosExecutables(name, $worldName)
end
else
puts "Error: Invalid Name[%s] or Config[%s]. Skpping." % [name, config]
end

if executables != nil
Expand Down
3 changes: 2 additions & 1 deletion subt_ros/launch/teambase_description.launch
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?xml version="1.0"?>
<launch>
<param name="TeamBase/robot_description" command="$(find xacro)/xacro '$(find teambase_description)/urdf/teambase.xacro'"/>
<arg name="name" doc="Name of TeamBase"/>
<param name="$(arg name)/robot_description" command="$(find xacro)/xacro '$(find teambase_description)/urdf/teambase.xacro' name:=$(arg name)"/>
</launch>
3 changes: 2 additions & 1 deletion subt_ros/launch/teambase_topics.launch
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?xml version="1.0"?>
<launch>
<node pkg="tf2_ros" type="static_transform_publisher" name="tf_teambase_static" args="0 0 0.05 0 0 0 TeamBase TeamBase/link"/>
<arg name="name" default="TEAMBASE"/>
<node pkg="tf2_ros" type="static_transform_publisher" name="tf_teambase_static" args="0 0 0.05 0 0 0 $(arg name) $(arg name)/link"/>
</launch>
3 changes: 2 additions & 1 deletion teambase_description/urdf/teambase.xacro
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<robot name="TeamBase" xmlns:xacro="http://ros.org/wiki/xacro">
<xacro:property name="robot_namespace" value="TeamBase"/>
<xacro:arg name="name" default="TeamBase"/>
<xacro:property name="robot_namespace" value="$(arg name)"/>

<link name='${robot_namespace}/link'>
<visual name='visual'>
Expand Down