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

Azeey/marsupial #424

Merged
merged 14 commits into from
May 20, 2020
10 changes: 9 additions & 1 deletion docker/json2docker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,13 @@
robotStr += "robotName#{index+1}:=#{robot['name']} robotConfig#{index+1}:=#{robot['type']} "
end

marsupialChildren = []
submission['marsupials'].each_with_index do |(parent, child), index|
robotStr += "marsupial#{index+1}:=#{parent}:#{child} "
marsupialChildren.append(child)
end


# Set where the output is going
if options['run']
output = Tempfile.new()
Expand Down Expand Up @@ -225,10 +232,11 @@

# Output bridge and solution definitions
submission['robots'].each_with_index do |robot, index|
marsupialStr = "marsupial:=true" if marsupialChildren.include? robot['name']
output.puts <<EOF
bridge#{index+1}:
image: #{options['bridge_image']}
command: circuit:=#{submission['circuit']} worldName:=#{submission['world']} robotName1:=#{robot['name']} robotConfig1:=#{robot['type']}
command: circuit:=#{submission['circuit']} worldName:=#{submission['world']} robotName1:=#{robot['name']} robotConfig1:=#{robot['type']} #{marsupialStr}
networks:
relay_net#{index+1}:
ipv4_address: 172.#{29+index}.1.1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
def spawner(_name, _modelURI, _worldName, _x, _y, _z, _roll, _pitch, _yaw)
<<-HEREDOC
<plugin name="ignition::launch::GazeboFactory"
filename="libignition-launch-gazebo-factory.so">
<spawn name='#{_name}'>
<name>#{_name}</name>
<allow_renaming>false</allow_renaming>
<pose>#{_x} #{_y} #{_z + 0.2} #{_roll} #{_pitch} #{_yaw}</pose>
Expand Down Expand Up @@ -54,7 +53,7 @@ def spawner(_name, _modelURI, _worldName, _x, _y, _z, _roll, _pitch, _yaw)
</plugin>
</include>
</sdf>
</plugin>
</spawn>
HEREDOC
end

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
def spawner(_name, _modelURI, _worldName, _x, _y, _z, _roll, _pitch, _yaw)
<<-HEREDOC
<plugin name="ignition::launch::GazeboFactory"
filename="libignition-launch-gazebo-factory.so">
<spawn name='#{_name}'>
<name>#{_name}</name>
<allow_renaming>false</allow_renaming>
<pose>#{_x} #{_y} #{_z + 0.2} #{_roll} #{_pitch} #{_yaw}</pose>
Expand Down Expand Up @@ -70,7 +69,7 @@ def spawner(_name, _modelURI, _worldName, _x, _y, _z, _roll, _pitch, _yaw)
</plugin>
</include>
</sdf>
</plugin>
</spawn>
HEREDOC
end

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
def spawner(_name, _modelURI, _worldName, _x, _y, _z, _roll, _pitch, _yaw)
<<-HEREDOC
<plugin name="ignition::launch::GazeboFactory"
filename="libignition-launch-gazebo-factory.so">
<spawn name='#{_name}'>
<name>#{_name}</name>
<allow_renaming>false</allow_renaming>
<pose>#{_x} #{_y} #{_z + 0.2} #{_roll} #{_pitch} #{_yaw}</pose>
Expand Down Expand Up @@ -54,7 +53,7 @@ def spawner(_name, _modelURI, _worldName, _x, _y, _z, _roll, _pitch, _yaw)
</plugin>
</include>
</sdf>
</plugin>
</spawn>
HEREDOC
end

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
def spawner(_name, _modelURI, _worldName, _x, _y, _z, _roll, _pitch, _yaw)
<<-HEREDOC
<plugin name="ignition::launch::GazeboFactory"
filename="libignition-launch-gazebo-factory.so">
<spawn name='#{_name}'>
<name>#{_name}</name>
<allow_renaming>false</allow_renaming>
<pose>#{_x} #{_y} #{_z + 0.2} #{_roll} #{_pitch} #{_yaw}</pose>
Expand Down Expand Up @@ -70,7 +69,7 @@ def spawner(_name, _modelURI, _worldName, _x, _y, _z, _roll, _pitch, _yaw)
</plugin>
</include>
</sdf>
</plugin>
</spawn>
HEREDOC
end

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
def spawner(_name, _modelURI, _worldName, _x, _y, _z, _roll, _pitch, _yaw)
"<plugin name=\"ignition::launch::GazeboFactory\"\n"\
" filename=\"libignition-launch-gazebo-factory.so\">\n"\
"<spawn name=\"#{_name}\">\n"\
" <name>#{_name}</name>\n"\
" <allow_renaming>false</allow_renaming>\n"\
" <pose>#{_x} #{_y} #{_z+0.063494} #{_roll} #{_pitch} #{_yaw}</pose>\n"\
Expand Down Expand Up @@ -53,7 +52,7 @@ def spawner(_name, _modelURI, _worldName, _x, _y, _z, _roll, _pitch, _yaw)
" </plugin>\n"\
" </include>\n"\
" </sdf>\n"\
"</plugin>\n"\
"</spawn>\n"\
end

def rosExecutables(_name, _worldName)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
def spawner(_name, _modelURI, _worldName, _x, _y, _z, _roll, _pitch, _yaw)
<<-HEREDOC
<plugin name="ignition::launch::GazeboFactory"
filename="libignition-launch-gazebo-factory.so">
<spawn name='#{_name}'>
<name>#{_name}</name>
<allow_renaming>false</allow_renaming>
<pose>#{_x} #{_y} #{_z + 0.2} #{_roll} #{_pitch} #{_yaw}</pose>
Expand Down Expand Up @@ -58,7 +57,7 @@ def spawner(_name, _modelURI, _worldName, _x, _y, _z, _roll, _pitch, _yaw)

</include>
</sdf>
</plugin>
</spawn>
HEREDOC
end

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
def spawner(_name, _modelURI, _worldName, _x, _y, _z, _roll, _pitch, _yaw)
<<-HEREDOC
<plugin name="ignition::launch::GazeboFactory"
filename="libignition-launch-gazebo-factory.so">
<spawn name='#{_name}'>
<name>#{_name}</name>
<allow_renaming>false</allow_renaming>
<pose>#{_x} #{_y} #{_z + 0.2} #{_roll} #{_pitch} #{_yaw}</pose>
Expand Down Expand Up @@ -224,7 +223,7 @@ def spawner(_name, _modelURI, _worldName, _x, _y, _z, _roll, _pitch, _yaw)

</include>
</sdf>
</plugin>
</spawn>
HEREDOC
end

Expand Down
5 changes: 2 additions & 3 deletions submitted_models/ssci_x2_sensor_config_1/launch/spawner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ def spawner(_name, _modelURI, _worldName, _x, _y, _z, _roll, _pitch, _yaw)
if _config == "6"
lidar3d=1
end
<plugin name=\"ignition::launch::GazeboFactory\"
filename=\"libignition-launch-gazebo-factory.so\">
<spawn name='#{_name}'>
<name>#{_name}</name>
<allow_renaming>false</allow_renaming>
<pose>#{_x} #{_y} #{_z + 0.2} #{_roll} #{_pitch} #{_yaw}</pose>
Expand Down Expand Up @@ -68,7 +67,7 @@ def spawner(_name, _modelURI, _worldName, _x, _y, _z, _roll, _pitch, _yaw)
</plugin>
</include>
</sdf>
</plugin>
</spawn>
HEREDOC
end

Expand Down
5 changes: 2 additions & 3 deletions submitted_models/ssci_x4_sensor_config_1/launch/spawner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ def spawner(_name, _modelURI, _worldName, _x, _y, _z, _roll, _pitch, _yaw)
topScan=1
bottomScan=1
rgbdCam=1
<plugin name="ignition::launch::GazeboFactory"
filename="libignition-launch-gazebo-factory.so">
<spawn name='#{_name}'>
<name>#{_name}</name>
<allow_renaming>false</allow_renaming>
<pose>#{_x} #{_y} #{_z + 0.2} #{_roll} #{_pitch} #{_yaw}</pose>
Expand Down Expand Up @@ -244,7 +243,7 @@ def spawner(_name, _modelURI, _worldName, _x, _y, _z, _roll, _pitch, _yaw)
</plugin>
</include>
</sdf>
</plugin>
</spawn>
HEREDOC
end

Expand Down
5 changes: 2 additions & 3 deletions submitted_models/ssci_x4_sensor_config_2/launch/spawner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ def spawner(_name, _modelURI, _worldName, _x, _y, _z, _roll, _pitch, _yaw)
bottomScan=1
rgbdCam=1
end
<plugin name="ignition::launch::GazeboFactory"
filename="libignition-launch-gazebo-factory.so">
<spawn name='#{_name}'>
<name>#{_name}</name>
<allow_renaming>false</allow_renaming>
<pose>#{_x} #{_y} #{_z + 0.2} #{_roll} #{_pitch} #{_yaw}</pose>
Expand Down Expand Up @@ -239,7 +238,7 @@ def spawner(_name, _modelURI, _worldName, _x, _y, _z, _roll, _pitch, _yaw)
</plugin>
</include>
</sdf>
</plugin>
</spawn>
HEREDOC
end

Expand Down
5 changes: 2 additions & 3 deletions submitted_models/x1_sensor_config_6/launch/spawner.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
def spawner(_name, _modelURI, _worldName, _x, _y, _z, _roll, _pitch, _yaw)
<<-HEREDOC
<plugin name="ignition::launch::GazeboFactory"
filename="libignition-launch-gazebo-factory.so">
<spawn name='#{_name}'>
<name>#{_name}</name>
<allow_renaming>false</allow_renaming>
<pose>#{_x} #{_y} #{_z + 0.2} #{_roll} #{_pitch} #{_yaw}</pose>
Expand Down Expand Up @@ -54,7 +53,7 @@ def spawner(_name, _modelURI, _worldName, _x, _y, _z, _roll, _pitch, _yaw)
</plugin>
</include>
</sdf>
</plugin>
</spawn>
HEREDOC
end

Expand Down
5 changes: 2 additions & 3 deletions submitted_models/x2_sensor_config_7/launch/spawner.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
def spawner(_name, _modelURI, _worldName, _x, _y, _z, _roll, _pitch, _yaw)
<<-HEREDOC
<plugin name="ignition::launch::GazeboFactory"
filename="libignition-launch-gazebo-factory.so">
<spawn name='#{_name}'>
<name>#{_name}</name>
<allow_renaming>false</allow_renaming>
<pose>#{_x} #{_y} #{_z+0.063494} #{_roll} #{_pitch} #{_yaw}</pose>
Expand Down Expand Up @@ -54,7 +53,7 @@ def spawner(_name, _modelURI, _worldName, _x, _y, _z, _roll, _pitch, _yaw)
</plugin>
</include>
</sdf>
</plugin>
</spawn>
HEREDOC
end

Expand Down
5 changes: 2 additions & 3 deletions submitted_models/x3_sensor_config_5/launch/spawner.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
def spawner(_name, _modelURI, _worldName, _x, _y, _z, _roll, _pitch, _yaw)
<<-HEREDOC
<plugin name="ignition::launch::GazeboFactory"
filename="libignition-launch-gazebo-factory.so">
<spawn name='#{_name}'>
<name>#{_name}</name>
<allow_renaming>false</allow_renaming>
<pose>#{_x} #{_y} #{_z + 0.2} #{_roll} #{_pitch} #{_yaw}</pose>
Expand Down Expand Up @@ -171,7 +170,7 @@ def spawner(_name, _modelURI, _worldName, _x, _y, _z, _roll, _pitch, _yaw)
</plugin>
</include>
</sdf>
</plugin>
</spawn>
HEREDOC
end

Expand Down
5 changes: 2 additions & 3 deletions submitted_models/x4_sensor_config_6/launch/spawner.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
def spawner(_name, _modelURI, _worldName, _x, _y, _z, _roll, _pitch, _yaw)
<<-HEREDOC
<plugin name="ignition::launch::GazeboFactory"
filename="libignition-launch-gazebo-factory.so">
<spawn name='#{_name}'>
<name>#{_name}</name>
<allow_renaming>false</allow_renaming>
<pose>#{_x} #{_y} #{_z + 0.2} #{_roll} #{_pitch} #{_yaw}</pose>
Expand Down Expand Up @@ -220,7 +219,7 @@ def spawner(_name, _modelURI, _worldName, _x, _y, _z, _roll, _pitch, _yaw)
</plugin>
</include>
</sdf>
</plugin>
</spawn>
HEREDOC
end

Expand Down
Loading