diff --git a/subt_ign/launch/cave_circuit.ign b/subt_ign/launch/cave_circuit.ign index 524b7d8f..05375d6e 100644 --- a/subt_ign/launch/cave_circuit.ign +++ b/subt_ign/launch/cave_circuit.ign @@ -1290,15 +1290,15 @@ return spawn, exec end - def spawnTeamBase(_x, _y, _z, _yaw) + def spawnTeamBase(_name, _x, _y, _z, _yaw) spawn = <<-HEREDOC - - TEAMBASE + + #{_name} false #{$worldName} false - + #{_x} #{_y} #{_z} 0 0 #{_yaw} true @@ -1318,10 +1318,10 @@ exec = <<-HEREDOC - roslaunch --wait subt_ros teambase_description.launch world_name:=#{$worldName} + roslaunch --wait subt_ros teambase_description.launch world_name:=#{$worldName} name:=#{_name} - roslaunch --wait subt_ros teambase_topics.launch world_name:=#{$worldName} + roslaunch --wait subt_ros teambase_topics.launch world_name:=#{$worldName} name:=#{_name} HEREDOC @@ -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 @@ -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 diff --git a/subt_ign/launch/cloudsim_bridge.ign b/subt_ign/launch/cloudsim_bridge.ign index d0eefdeb..b5db900d 100644 --- a/subt_ign/launch/cloudsim_bridge.ign +++ b/subt_ign/launch/cloudsim_bridge.ign @@ -179,12 +179,12 @@ "\n" end - def spawnTeamBase() + def spawnTeamBase(_name) "\n"\ - " roslaunch --wait subt_ros teambase_description.launch world_name:=#{$worldName}\n"\ + " roslaunch --wait subt_ros teambase_description.launch world_name:=#{$worldName} name:=#{_name}\n"\ "\n"\ "\n"\ - " roslaunch --wait subt_ros teambase_topics.launch world_name:=#{$worldName}\n"\ + " roslaunch --wait subt_ros teambase_topics.launch world_name:=#{$worldName} name:=#{_name}\n"\ "\n" end %> @@ -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. diff --git a/subt_ign/launch/cloudsim_sim.ign b/subt_ign/launch/cloudsim_sim.ign index cde273fc..a6bf3297 100644 --- a/subt_ign/launch/cloudsim_sim.ign +++ b/subt_ign/launch/cloudsim_sim.ign @@ -1291,15 +1291,15 @@ return spawn, exec end - def spawnTeamBase(_x, _y, _z, _yaw) + def spawnTeamBase(_name, _x, _y, _z, _yaw) spawn = <<-HEREDOC - - TEAMBASE + + #{_name} false #{$worldName} false - + #{_x} #{_y} #{_z} 0 0 #{_yaw} true @@ -1319,10 +1319,10 @@ exec = <<-HEREDOC - roslaunch --wait subt_ros teambase_description.launch world_name:=#{$worldName} + roslaunch --wait subt_ros teambase_description.launch world_name:=#{$worldName} name:=#{_name} - roslaunch --wait subt_ros teambase_topics.launch world_name:=#{$worldName} + roslaunch --wait subt_ros teambase_topics.launch world_name:=#{$worldName} name:=#{_name} HEREDOC @@ -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 @@ -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 diff --git a/subt_ign/launch/competition.ign b/subt_ign/launch/competition.ign index 91853638..a599b932 100644 --- a/subt_ign/launch/competition.ign +++ b/subt_ign/launch/competition.ign @@ -1287,15 +1287,15 @@ return spawn, exec end - def spawnTeamBase(_x, _y, _z, _yaw) + def spawnTeamBase(_name, _x, _y, _z, _yaw) spawn = <<-HEREDOC - - TEAMBASE + + #{_name} false #{$worldName} false - + #{_x} #{_y} #{_z} 0 0 #{_yaw} true @@ -1315,10 +1315,10 @@ exec = <<-HEREDOC - roslaunch --wait subt_ros teambase_description.launch world_name:=#{$worldName} + roslaunch --wait subt_ros teambase_description.launch world_name:=#{$worldName} name:=#{_name} - roslaunch --wait subt_ros teambase_topics.launch world_name:=#{$worldName} + roslaunch --wait subt_ros teambase_topics.launch world_name:=#{$worldName} name:=#{_name} HEREDOC @@ -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 @@ -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 diff --git a/subt_ign/launch/tunnel_circuit_practice.ign b/subt_ign/launch/tunnel_circuit_practice.ign index 1f1016f8..3f56068e 100644 --- a/subt_ign/launch/tunnel_circuit_practice.ign +++ b/subt_ign/launch/tunnel_circuit_practice.ign @@ -1290,15 +1290,15 @@ return spawn, exec end - def spawnTeamBase(_x, _y, _z, _yaw) + def spawnTeamBase(_name, _x, _y, _z, _yaw) spawn = <<-HEREDOC - - TEAMBASE + + #{_name} false #{$worldName} false - + #{_x} #{_y} #{_z} 0 0 #{_yaw} true @@ -1318,10 +1318,10 @@ exec = <<-HEREDOC - roslaunch --wait subt_ros teambase_description.launch world_name:=#{$worldName} + roslaunch --wait subt_ros teambase_description.launch world_name:=#{$worldName} name:=#{_name} - roslaunch --wait subt_ros teambase_topics.launch world_name:=#{$worldName} + roslaunch --wait subt_ros teambase_topics.launch world_name:=#{$worldName} name:=#{_name} HEREDOC @@ -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 @@ -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 diff --git a/subt_ign/launch/urban_circuit.ign b/subt_ign/launch/urban_circuit.ign index 7dcfada5..09c9568c 100644 --- a/subt_ign/launch/urban_circuit.ign +++ b/subt_ign/launch/urban_circuit.ign @@ -1290,15 +1290,15 @@ return spawn, exec end - def spawnTeamBase(_x, _y, _z, _yaw) + def spawnTeamBase(_name, _x, _y, _z, _yaw) spawn = <<-HEREDOC - - TEAMBASE + + #{_name} false #{$worldName} false - + #{_x} #{_y} #{_z} 0 0 #{_yaw} true @@ -1318,10 +1318,10 @@ exec = <<-HEREDOC - roslaunch --wait subt_ros teambase_description.launch world_name:=#{$worldName} + roslaunch --wait subt_ros teambase_description.launch world_name:=#{$worldName} name:=#{_name} - roslaunch --wait subt_ros teambase_topics.launch world_name:=#{$worldName} + roslaunch --wait subt_ros teambase_topics.launch world_name:=#{$worldName} name:=#{_name} HEREDOC @@ -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 @@ -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 diff --git a/subt_ros/launch/teambase_description.launch b/subt_ros/launch/teambase_description.launch index fae2f5b4..bc460b8d 100644 --- a/subt_ros/launch/teambase_description.launch +++ b/subt_ros/launch/teambase_description.launch @@ -1,4 +1,5 @@ - + + diff --git a/subt_ros/launch/teambase_topics.launch b/subt_ros/launch/teambase_topics.launch index 26de6110..4aed4b6d 100644 --- a/subt_ros/launch/teambase_topics.launch +++ b/subt_ros/launch/teambase_topics.launch @@ -1,4 +1,5 @@ - + + diff --git a/teambase_description/urdf/teambase.xacro b/teambase_description/urdf/teambase.xacro index 282359a6..427adfca 100644 --- a/teambase_description/urdf/teambase.xacro +++ b/teambase_description/urdf/teambase.xacro @@ -1,6 +1,7 @@ - + +