You are on page 1of 36

Zero Robotics SPHERES Challenge 2011

Mine the Future of Energy v1.0.9

Your Mission

Time is running out! Our planets energy sources are dwindling and we have little time left to save the situation! BUT, not all hope is lost. Scientists have detected the presence of Helium-3 ore on two Near-Earth Asteroids, Opulens and Indigens. MIT engineers have built SPHERES satellites that can mine the Helium-3 and collect it in mining stations for Earth-transfer. The SPHERES satellites can extract the ore by spinning on (drilling) or revolving around (surface collection) the asteroids. More ore can be extracted if one satellite drills while the other collects from the surface of the same asteroid. The ore on Opulens is more enriched; however, it is protected by a layer of thick ice which has to be melted to mine it. Therefore, the mission to Opulens is much more dicult, but much more rewarding. A large mining company has leased the SPHERES satellites and embarked upon a mission to maximize the collection and delivery of the Helium-3 ore from the asteroids before their orbits take them far from Earth. The satellites can collect items that will help their mission, but if used maliciously, can disrupt the navigation of the other. Your mission, as a team of expert strategists to the company, is to devise and implement a plan to pick up the best items, extract the Helium-3 ore, deposit it at the mining station near the asteroids and signal your success back to Earth. You will be paired up with a variety of strategist teams. If you top the charts of total ore mined for the whole mission, you will emerge as the winning team and get a large percentage of the companys prots. While you do want to get ahead of the other teams and mine more ore, it is in your best interest to collaborate to maximize ore collection. The energy future of mankind depends on you and fame and glory await you!

Contents
1 2 What is SPHERES? . . . . . . . . . . . . . Gameplay . . . . . . . . . . . . . . . . . . . 2.1 Phase 1: Item Collection . . . . . . . 2.2 Phase 2: Mining the Asteroids . . . . 2.3 Phase 3: Race to the Mining Stations 2.4 End of Game . . . . . . . . . . . . . 2.5 Collaboration . . . . . . . . . . . . . Game Layout . . . . . . . . . . . . . . . . . 3.1 Game Arena . . . . . . . . . . . . . . 3.2 Player Spawn . . . . . . . . . . . . . 3.3 Items . . . . . . . . . . . . . . . . . . 3.4 Asteroids and Mining Stations . . . . 3.5 Out of Bounds . . . . . . . . . . . . 3.6 Animation Visuals . . . . . . . . . . Players and Items . . . . . . . . . . . . . . . 4.1 SPHERE Controls . . . . . . . . . . 4.2 Collision Avoidance . . . . . . . . . . 4.3 Items . . . . . . . . . . . . . . . . . . Game Aspects . . . . . . . . . . . . . . . . . 5.1 Fuel, Charge and Code Size . . . . . 5.2 Points . . . . . . . . . . . . . . . . . 5.3 Game Variables . . . . . . . . . . . . 5.4 Tournament Structure and Scoring . 5.5 Alliances . . . . . . . . . . . . . . . . API and Functions . . . . . . . . . . . . . . 6.1 Zero Robotics Functions . . . . . . . 6.2 Math Functions . . . . . . . . . . . . 6.3 AsteroSPHERES General Functions . 6.4 AsteroSPHERES Asteroid Functions 6.5 AsteroSPHERES Item Functions . . Revision History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 3 4 4 7 8 9 10 10 10 10 11 11 14 17 17 18 18 20 20 21 23 25 26 29 29 30 30 31 32 33

What is SPHERES?

http://ssl.mit.edu/spheres/

Gameplay

AsteroSPHERES will proceed in three phases that will last 60 seconds each. Matches will be played between two SPHERES satellites, controlled by code written by two dierent teams/alliances, competing to collect more Helium-3 ore than the other and thus get more points. In the rst phase, both SPHERES will have the opportunity to collect useful items oating in the playing eld. In the second phase, SPHERES will have the opportunity to mine for Helium-3 ore on either or both of the asteroids, Opulens and Indigens. Opulens is shadowed from the Sun by Indigens, and is thus covered with a thick layer of ice which cannot melt naturally. The ice has to be melted using a laser to perform any mining operation on it. By the third phase, Opulens gradually comes out of the shadow and the Suns heat melts its ice sheet naturally. In this phase, the SPHERES can mine on either asteroid through the end. In the last 10 seconds of the match, they can deposit their collected ore in separate mining stations and use a laser to signal the completion of their mission to Earth. One match will last exactly 3 minutes, until both players run out of fuel or until mission completion is signalled to Earth, whichever occurs rst. Each competition will be of a round-robin kind and the winning team will be that which has the maximum total score, summed over all its matches. The game has been designed such that collaboration between the two SPHERES will be benecial to both teams for achieving higher scores, and thus increasing both their chances of winning the competition. Since each phase of the game has equal leverage in the nal outcome, it is possible for a dierent team to code each phase following a common strategy and combining the codes may lead to a stronger player. To demonstrate this feature of AsteroSPHERES, teams that qualify for the elimination rounds will be required to join forces in groups of three to form alliances. Thereafter, the SPHERES will be controlled by the integrated code of the alliances and not individual teams. (More detail in Section 5.2) During the rst rounds of the Zero Robotics tournament, namely the 2D Simulation and the Ground Competition rounds, the game will be played in a 2D playing space. For all subsequent rounds, the game will evolve to be played in a 3D playing space. (More detail in Section 5.2)

2.1

Phase 1: Item Collection

The game always begins in the rst phase. Your SPHERE will be at a location near the asteroids. Your objective is to move your satellite around the playing eld so that it can pick up useful items. The rules for this phase are as follows: Always lasts 60 seconds No points can be gained during this phase. All items can be used as soon as they are acquired. Both satellites start out with: 1. Weak repulsor (Pushes opponent away from self) 2. Weak tractor (Pulls opponent toward self) Details on these items can be found in Section 4.3. Various items are scattered throughout the eld on points that are equidistant from both players (with the exception of the two lasers). Detailed descriptions of these items can be found in Section 4.3. 1. Disruptor upgrade (Doubles the force due to the repulsor or tractor) 2. Laser (Destroys shield of player and Opulens ice layer) 3. Shield (Omni-directional; blocks repulsions/attractions) You can determine whether an item is owned by your satellite, owned by your opponents, or unclaimed. (More details in Section 6.4) In order to pick up an item, a SPHERE has to approach it within 5cm of the items position and have a speed of less than 1 cm/s. There is only one instance of all items except the laser. There are two unique instances of the laser and a player can pick up just one. All items that have not been claimed by the end of this phase are destroyed. At any time during the game, the SPHERES can pass messages between each other in the form of integer values (More details in Sections 2.5 and 4.1). It is a good idea to use this feature to communicate with your opponent in this phase itself to nalize your plan for collaborative strategies in phase 2 and 3. 2.2 Phase 2: Mining the Asteroids

In the next phase, the asteroids Opulens and Indigens will appear. Opulens has Helium-3 that is far more enriched i.e. worth more points, but has a thick layer of ice protecting the ore. Since Opulens is in Indigens shadow, the Suns heat is not strong enough to melt the ice. You can melt the ice of Opulens by ring your laser at it several times. Indigens has less enriched ore, i.e. worth less points, but it is possible to extract it without any pre-operations
4

- the Suns heat has already melted its ice sheet. In order to extract ore from either asteroid, the SPHERES will be required to spin on it or revolve around it. Revolving gathers more ore i.e. more points, but will cost more fuel. If the two SPHERES work together to extract ore from the same asteroid (one revolving around it while the other spins on it), both the players will get better ore i.e. more points than individual extraction. (Full details on points in Section 5.2) Begins after exactly 60 seconds have elapsed from the beginning of the game Lasts until 120 seconds have elapsed since the beginning of the game The orientation of asteroid bedding planes dene the plane of the asteroid and the direction of ecient extraction. The SPHERES will be required to spin/revolve with a particular angular velocity and about a particular orientation to extract maximum ore/gain maximum points. The orientation of the asteroid plane is not known to Earth and will be available only when mission operations begin. Your code has to be robust enough to implement mission operations for any random asteroid plane. To know the orientation to the asteroids normal, use the function PgetAsteroidNormal(asteroidNormal[3]). For the 2D game, the asteroid plane is Z = 0. There are three ways to gain points in this phase. (Detailed description of points in section 5.2) 1. Fire your laser at Opulens ice sheet while keeping the asteroid within your pointing cone (seen in the image below and described in more detail in Section 4.1). The ice melts when hit by 29 laser shots. You may only extract ore on Opulens only after the ice sheet has completely melted.

2. Spin on an asteroid with your axis of rotation normal to the asteroid plane at an angular velocity of 30 deg/s. For maneuvers that do not meet these conditions, points will be prorated. The projection of your SPHEREs angular velocity on the asteroid normal will be considered A linear ramp will be considered about 30 deg/s such that to gain any points, your SPHEREs angular velocity has to be between 0 and 60 deg/s,

For spinning to be valid, the SPHERE must be within asteroid bounds i.e. within 5 cm of its center with a linear velocity <1 cm/s. Spinning on Opulens will get you 1.3 times the points that spinning on Indigens will get. Spinning on any asteroid while another SPHERE is revolving around that same asteroid will get you 2 times the points than embarking on the spinning alone. (Full details on points in Section 5.2)

3. Revolve (not necessarily in a circle, square would also work) around an asteroid about an axis normal to the asteroid plane at an angular velocity of 4 deg/s. For maneuvers that do not meet these conditions, points will be prorated. The projection of your angular velocity on the asteroid normal will be considered A linear ramp will be considered about 4 deg/s such that to gain any points, your SPHEREs angular velocity has to be between 0 and 8 deg/s, For revolving to be valid, the SPHERE must be within 10-40 cm of the asteroid center for 3D and within 20-60 cm of the asteroid center for 2D. Revolving around Opulens will get you 1.3 times the points that revolving around Indigens will get. Revolving around any asteroid while another SPHERE is spinning on that same asteroid will get you 2 times the points than embarking on the revolving alone. (Full details on points in Section 5.2)

2.3

Phase 3: Race to the Mining Stations

By the nal phase, Opulens moves out of Indigens shadow and the Suns heat is enough to melt the ice sheet on Opulens naturally. In this phase, the two SPHERES will be able to mine on either asteroid to collect ore i.e. points. In the last 10 seconds of the game, you have the option of depositing your ore in one of two mining stations to begin processing it. At this point, your SPHERE may use its laser (if it has one) to signal to the Earth, announcing that its mission is complete - this will end the game. Begins when 120 seconds have elapsed since the beginning of the game. Ends after 180 seconds have elapsed since the beginning of the game or when either SPHERE lasers the Earth after reaching a mining station, whichever occurs rst. Opulens is no longer protected by a layer of ice and you may mine on it freely Earth is located at a great distance from the game volume at a pointing attitude of [0 1 0]. This attitude would lie within your SPHEREs pointing cone in order to be able to laser the Earth. There will be two symmetrically located mining stations available after 170 seconds since the beginning of the game. You may choose to go to the mining stations earlier at the opportunity cost of extraction points

SPHERES can deposit their ore only if they have collected points via spinning or revolving (i.e. they actually have ore to deposit). Only one SPHERE can deposit its ore at one mining station. It is advised that the SPHERES communicate, via messages, in advance to plan out their actions. There are three main ways to gain/lose points in this phase: 1. Spin on or revolve around Indigens or Opulens. Point collection descriptions are the same as that in Phase 2. 2. Reach a mining station in the last 10 seconds of the game. Reaching a mining station before your opponent will get you bonus points If you reach a mining station after your opponent, you will both get bonus points i.e. you will get more points added to those gained by nishing rst. See Section 5.2 for full details on points 3. Causing collision avoidance to activate when any sphere is within 15 cm of any mining station will cost both players 1 point/s for as long as there is a predicted collision. Collision avoidance is described in detail in Section 4.2.

* The winner of the race may not necessarily be the winner of the match. Winning the race may get you a lot of points but the total points you made through the match determines the match winner. 2.4 End of Game

The game ends for both players when any of these occurs rst: Laser end: when either of the SPHERES, after reaching a mining station in the last 10 seconds of the game res a laser in the direction of Earth to communicate that it has completed its mission Timeout: 180 seconds have elapsed, or Out of fuel: when both SPHERES run out of fuel, which means no more points can be gained Docking: when both SPHERES have docked to the mining stations
8

The raw score (full decimal number of points) of the two teams will be compared, and 2 bonus victory points will be awarded to the player with the higher score. Both players scores will be rounded to the nearest positive integer not exceeding 23 The number of points you get in a match is more important than the win/loss because each competition in the tournament is a round robin kind where the scores of each team for will be summed over all the matches. Teams with the best aggregate scores will proceed to the next round of the tournament. See Section 5.2 for more details about points and scoring and Section 5.4 for more details about the competition format In the simulation, ground tests and on the ISS, a test result code returned by each SPHERE will indicate the results of the game for that SPHERE as a function of the score and the team ID that was controlling the SPHERE. The following test result codes are possible, with the condition for winning/losing in parentheses: Errors Test error one of the satellites reset 255 Satellite reset 10-249 The game ended normally: the score of the team playing on this satellite can be calculated as follows Score = TestResultCode/10 - 1 2.5 Collaboration 0-9 7

The game of AsteroSPHERES has multiple opportunities for and encourages collaboration between teams. SPHERE Internal Collaboration refers to multiple teams working on the same satellite. Starting from the 3D Simulation II round (more details in Section 5.2), qualied competitors will form alliances of three teams each which will program the same player. Each team is expected to be responsible for one phase of the code. SPHERE-to-SPHERE Collaboration refers to collaboration between your SPHERE and your opponents SPHERE, which is possible via the PsendMessage() and PgetMessage() functions, by which players can send and receive messages to and from their opponents. More details on these functions is available in Section 4.1. For example, if one team wins every game by consistently trying to bully their opponent, that team might end up not gaining as many points as as other teams that collaboratively raised higher scores, and as a result might not be able to advance to the next round. Community Cooperation refers to the sharing of ideas, tips, knowledge and strategies between students in the Zero Robotics community, which is always encouraged. This can be done using Discuss forums on our website.

Game Layout

During the 2D Simulation round and the Ground Competition round, the competition will be run in 2D Space. In all subsequent rounds, the competition will be run in 3D Space.

3.1

Game Arena

The arena dimensions are: 2D 3D x: [-0.84m,0.84m] x: [-0.84m,0.84m] y: [-1.30m,1.30m] y: [-1.00m,1.00m] z: [-0.85m,0.85m] For the 3D game, there is a smaller region known as the Interaction Zone whose dimensions are specied below. For the 2D version of the game, the Interaction Zone spans the entire arena in order to allow more space for movement. Players will be penalized if they leave the Interaction Zone. All game items will be found within the interaction zone. 2D 3D x: [-0.84m,0.84m] x: [-0.64m,0.64m] y: [-1.30m,1.30m] y: [-0.80m,0.80m] z: [-0.65m,0.65m] 3.2 Player Spawn

A player will be placed at one of these two positions at the start of a round: 2D 3D SPHERE1: [0.4,-0.6] SPHERE1: [0.4,-0.6,0.0] SPHERE2: [-0.4,-0.6] SPHERE2: [-0.4,-0.6,0.0] Several noteworthy objects exist within this universe: several useful items, the asteroids (Indigens and Opulens) and the mining stations (two in number). 3.3 Items

Items have xed locations where they will appear in Phase 1 and disappear at the initiation of Phase 2. Item Disruptor Upgrade Shield Laser 1 Laser 2 2D 3D [0.0,0.2] [0.0,0.0,-0.4] [0.0,0.4] [0.0,0.0,0.4] [0.4,0.0] [0.4,0.0,0.0] [-0.4,0.0] [-0.4,0.0,0.0]

10

3.4

Asteroids and Mining Stations

Indigens and Opulens rst appear in Phase 2 and remain in the game until the end Mining Station 1 and Mining Station 2 appear and persist in the last 10 seconds of Phase 3 Asteroid/Station 2D 3D Indigens [0.0,0.6] [0.0, 0.35, 0.2] Opulens [0.0,-0.6] [0.0,-0.35, -0.2] Mining Station 1 [0.6,0.0] [0.5,-0.31,0.55] Mining Station 2 [-0.6,0.0] [-0.5,0.31,-0.55] 3.5 Out of Bounds

When your SPHERE goes outside of the Interaction Zone, it will be immune to all item eects from the other SPHERE. All movement controls except for moving back into the Interaction Zone will be disabled, and you will also be subjected to a 0.06 point penalty per second. The use of the tractor, repulsor and Laser by your SPHERE will be disabled. The top view of the 2D game for each of the phases as well as the top, side and front view of the 3D game for each of the phases is shown below. 2D:

Phase 1 top view

11

Phases 2 and 3 top view (Mining stations will appear only in the last 10 seconds of the match) 3D:

Phase 1 top view

Phase 1 front view


12

Phase 1 side view

Phase 2 and Phase 3 top view (Mining stations will appear only in the last 10 seconds of the match)

Phase 2 and Phase 3 front view (Mining stations will appear only in the last 10 seconds of the match)

13

Phase 2 and Phase 3 side view (Mining stations will appear only in the last 10 seconds of the match) 3.6 Animation Visuals

All simulated matches can be visualized using the ZR Flash animation tool. Dierent aspects of the game have been visually reinforced in dierent ways. Visual clues include: Fuel and charge status for each satellite in percentage of the total allocation Position, angular velocity and pointing direction (state vector values) of each satellite Status of item acquisition Current phase of the game and time elapsed in seconds since the match began Attraction or repulsion status of a satellite: If a player is being attracted, the SPHERE will glow pink and if being repelled, it will glow orange. Shield status: Once a player has picked up the shield, the SPHERE will be coated with a white layer whose thickness is proportionate to the strength of the shield. After 10 hits by a laser, this shield will no longer be visible. Laser ring status: If a player shoots the laser, a green beam of light will shoot out in the direction of pointing Opulens ice: In Phase 2, Opulens will be covered by an ice layer whose thickness progressively decreases as the ice is melted using a laser. Asteroid axes: The orientation of the asteroid axes will be clearly visible after 60s of game time, when the asteroids appear. When an asteroid is being mined, its axis will glow in the color of the satellite that is mining it. If both satellites mine the same asteroid together, the axis will glow magenta. The dierent game aspects are shown below in the animation environment.

14

2D:

Phase 1

Phases 2 and 3: Mining

Phase 3: Race (> 170 seconds)


15

3D:

Phase 1

Phases 2 and 3: Mining

Phase 3: Race (> 170 seconds)

16

Players and Items

Each AsteroSPHERES round will have two players: SPHERE1 and SPHERE2. Each player has been warped onto one side of the game arena. Special programming functions and items are available (see Section 6) to help you program your SPHERE. 4.1 SPHERE Controls

Movement: The Zero Robotics API provides three functions for changing the position of the sphere, ZRSetPositionTarget, ZRSetVelocityTarget, and ZRSetForces. See Section 6.1 for the specication on the use of these functions. Rotation: The Zero Robotics API provides a function for changing the orientation of the sphere, ZRSetAttitudeTarget and ZRSetTorques. The attitude vector of the satellite gives the direction to which it is pointing i.e. its orientation in space. See Section 6.1 for the specication on the use of this function. Messages: Each SPHERE may send a message token to the other SPHERE using sendMessage() and may decode tokens sent by the latter using getMessage(). This token doesnt aect the game state, but players can write their AI to respond to it. The function enables communication between the two satellites and promotes SPHERE-toSPHERE collaboration. There are several standard messages that the player can send to the other satellite. 1: Lets melt the ice sheet of Opulens together 2: I will spin on Opulens 3: I will revolve around Opulens 4: I will spin on Indigens 5: I will revolve around Indigens 6: I will go to mining station 1 (in +X plane) 7: I will go to mining station 2 (in -X plane) 8: I am not getting a Laser In addition to the above, competitors can come up with their own protocol of messages to send to other players and use any integer value from 9 to 65535 for this purpose (Note that the value 0 cannot be used). It is important to note that a satellite can send only one message and receive only one message per control cycle (per second) i.e. only the last message passed and received via the ZRUser() will be sent and stored respectively. GPS/Radar: You can determine where your player and where the other player is by calling the variables myState and otherState respectively, which are arguments to the ZRUser() function, within which you will be writing your code and thus are available to you - more details available in Section 6.1 and the IDE tutorial. You can also determine which of the items have been collected or your status on the asteroids using API functions available and described in Section 6.4 and 6.3 respectively.

17

Pointing Cone: Each players items are able to hit targets within /15 radians or 12 degrees of the attitude vector. The use of all items (repulsor tractor, and laser) is limited by the Pointing Cone. The tractor and the repulsor have an additional constraint: they are eective only if the opponent is no further than 1 m away.

4.2

Collision Avoidance

The satellites are programmed to autonomously avoid collisions during the game. If a potential collision is detected within the next 10 seconds, an autonomous collision avoidance algorithm will kick in and add to the satellites own controls in order to make the satellite change velocity to avoid the collision. If a potential collision is detected within the next 3 seconds, user control will be temporarily disabled for 3 seconds and the satellite will be controlled only by the collision avoidance algorithm. Collision is dened an event where the center of SPHERES come closer than the closest distance of approach allowed - 30 cm for the 3D game and 40 cm for the 2D game. You can use the function PisAvoidingCollision() to check if collision avoidance has activated. If collision avoidance activates in Phase 3 when any sphere is within 15 cm of any mining station, both players will be penalized by 1 point/s for as long as there is a predicted collision. 4.3 Items

All items may be used in one second bursts, as long as the teams have sucient charge to use them. Multiple items can be used simultaneously in any second. Weak Repulsor: A navigational disrupter that both players start with Pushes opponent away with a force that is inversely proportional to distance between the two players along the vector connecting both players for one second Maximum force of the weak repulsor is 0.024N at a distance of 40 cm or closer between the SPHERES centers and is zero a a distance greater than 1 m between the SPHERES centers. Note that collision avoidance forces will activate if the satellites are en-route to a collision i.e. an orientation where the sphere to sphere distance is less than 30cm in 3D and 40cm in 2D. When being repelled by the opponent, a satellite can move in any direction except towards the opponent i.e. the the satellites own controls will be added to the repulsor force only in directions away from opponent otherwise the satellites controls will be disabled. Only aects targets in the satellites Pointing Cone Using the repulsor costs one unit of charge, irrespective of its eect on the opponent.

18

See Section 5.1 for the specication on charge and Section 6.4 for details on the API to use the repulsor. Weak Tractor: A navigational disrupter that both players start with. Attracts other player with a force that is inversely proportional to distance between the two players along the vector connecting both players for one second Maximum force of the weak tractor is 0.024N at a distance of 40 cm or closer between the SPHERES centers and is zero a a distance greater than 1 m between the SPHERES centers. Note that collision avoidance forces will activate if the satellites are en-route to a collision i.e. an orientation where the sphere to sphere distance is less than 30cm in 3D and 40cm in 2D. When being attracted by the opponent, a satellite can move in any direction except away from the opponent i.e. the the satellites own controls will be added to the tractor force only in directions toward opponent otherwise the satellites controls will be disabled. Only aects targets in the satellites Pointing Cone Using the tractor costs one unit of charge, irrespective of its eect on the opponent. See Section 5.1 for the specication on charge and Section 6.4 for details on the API to use the tractor. Disruptor Upgrade: Doubles the force of your Weak Repulsor and the Weak Tractor i.e. the maximum force of the upgraded repulsor is 0.048N at a distance of 40 cm or closer between the SPHERES centers and is zero a a distance greater than 1 m between the SPHERES centers. Note that collision avoidance forces will activate if the satellites are en-route to a collision i.e. an orientation where the sphere to sphere distance is less than 30cm in 3D and 40cm in 2D.

Multi-purpose Laser: The laser in this game has multiple functions: Break the shield of an opponent (to reallow tractor/repulsor use) Melt and eventually remove the ice sheet of Opulens. To communicate with Earth and signal mission completion
19

The laser only aects targets in the satellites Pointing Cone and consumes 1 unit of charge per shot. only one laser shot is evaluated per second, irrespective of how many times you red the laser in a second. See Section 5.1 for the specication on charge and Section 6.4 for details on the API to use the Laser. Shield: Possession of the shield completely negates the eects of the tractor and repulsor The player who uses those items will still lose the charge they need to re them The shield is always active once picked up until destroyed by a laser Each laser shot that hits the shield does one point of damage to the shield and consumes one unit of charge from the player using the shield. If the shield takes 10 units of damage or the player runs out of charge, it is destroyed. Note that only one laser shot is evaluated per second, irrespective of how many times you red the laser. See Section 6.4 for API functions to check the status of your or your opponents shield

5
5.1

Game Aspects
Fuel, Charge and Code Size Each player has a limited amount of fuel. Moving and rotating, anything that requires the use of thrusters, will deplete fuel. No points can be gained or lost when a player is out of fuel. Therefore, players must be careful to conserve fuel. You can determine how much fuel your SPHERE has left at any point by calling the PgetPercentFuelRemaining() function. Each SPHERE begins with 30 units of charge. Charge is required to use the repulsor, tractor or laser. Using these items will deplete charge irrespective of its eect on the opponent. You will also lose charge (upto 10 units of charge) if your opponent res a laser at your shield. Costs for charge: Repulsor: 1 unit of charge Tractor: 1 unit of charge Laser: 1 unit of charge Shield (only if being broken by the opponent): 1 unit of charge per laser shot at the shield You can determine how much fuel your SPHERE has left at any point by calling the PgetPercentFuelRemaining() function. A SPHERES satellite can t a limited amount of code in its memory. Each project has a specic code size allocation. When you compile your project with a code size estimate, our compiler will provide the percentage of the code size allocation that your project is using. Formal competition submissions require that your code size be 100% or less of the total allocation.

20

5.2

Points

In each match, two players will be competing against as well as collaborating with each other in order to gain points. Points cannot be earned or lost when a player is out of fuel. After the match ends and the bonus victory points are awarded, the points that each player receives will be rounded to the nearest integer. (For example, 13.49 points will be rounded to 13, 21.50 will be rounded to 22). For the hardware competitions (Ground and ISS), the range of points returned by the satellites will be 0 to 23. Although negative points will be rounded up to zero and points exeeding 23 will be capped at 23, the satellite software will evaluate the winner when both players exceed this range (More details in Section 2.4). 1. Points are gained by: (a) Spinning on an asteroid while being within 5 cm of the Asteroids center and with your SPHERE axis of rotation normal to the asteroid plane. Points are calculated every second as a function of angular velocity of spinning - only the component of angular velocity normal to the asteroid plan will be considered. The SPHERES are limited to a maximum angular speed of 60 degrees/second and points are maximized by resonating with the Asteroid at 30 degrees/second. The maximum base points for Spinning is 0.06. i. Indigens: Points/sec = angular velocity 0.06 30 For 0 angular velocity 30 degrees/s (/6 radians/s) Points/sec = (60 angular velocity) 0.06 30 For 30 degrees/s (/6 radians/s) < angular velocity < 60 degrees/s (/3 radians/s) Points/sec = 0 For angular velocity > 60 degrees/s (/3 radians/s) If your SPHERE spins on Indigens while your opponents SPHERE is revolving around Indigens, your points (as calculated above) will be doubled ii. Opulens: Spinning on Opulens will fetch you 1.3 times the points than spinning on Indigens. The equations are: Points/sec = 1.3 angular velocity 0.06 30 For 0 angular velocity 30 degrees/s (/6 radians/s) Points/sec = 1.3 (60 angular velocity) 0.06 30 For 30 degrees/s (/6 radians/s) < angular velocity < 60 degrees/s (/3 radians/s) Points/sec = 0 For angular velocity > 60 degrees/s (/3 radians/s) If your SPHERE spins on Opulens while your opponents SPHERE is revolving around Opulens, your points (as calculated above) will be doubled (b) Revolving around an asteroid while being within the annular ring of 10-40 cm about the asteroid center for 3D or within the annular ring of 20-60 cm about the asteroid center for 2D and with the axis of revolution normal to the asteroid plane. Points are calculated every second as a function of angular velocity of revolution - only
21

the component normal to the asteroid plane will be considered. The SPHERES are limited to a maximum angular speed of 8 degrees/second and points are maximized by resonating with the Asteroid at 4 degrees/second. The maximum base points for Revolving is 0.066. Points will not be awarded when collision avoidance is activated. i. Indigens: Points/sec = angular velocity 0.066 4 For 0 angular velocity 4 degrees/s Points/sec = (8 angular velocity) 0.066 4 For 4 degrees/s < angular velocity < 8 degrees/s Points/sec = 0 For angular velocity > 8 degrees/s If your SPHERE revolves around Indigens while your opponents SPHERE is spinning on Indigens, your points (as calculated above) will be doubled ii. Opulens: Revolving around Opulens will fetch you 1.3 times the points than revolving around Indigens. The equations are: Points/sec = 1.3 angular velocity 0.066 4 For 0 angular velocity 4 degrees/s Points/sec = 1.3 (8 angular velocity) 0.066 4 For 4 degrees/s < angular velocity < 8 degrees/s Points/sec = 0 For angular velocity > 8 degrees/s If your SPHERE revolves around Opulens while your opponents SPHERE is spinning on Opulens, your points (as calculated above) will be doubled (c) Melting Opulens ice sheet: CooperativeHits are calculated as the minimum of hits by both you and your opponent in Phase 2. Example: If you shot Opulens ice sheet 15 times and your opponent shot it 5 times, then both of you have 5 collaborative hits. Only one laser shot is evaluated per second, irrespective of how many times you red the laser in a second. Only Collaborative Hits will be considered: 0.1 points/hit Total Points = 0.1 CooperativeHits (d) Reaching the mining station. Note that points can be gained for this activity only in the last ten seconds of the game! If you reach a mining station rst: Points = 4 If you reach a mining station rst AND your opponent nishes after: Bonus Points = 2 If you reach a mining station second: Points = 2 (e) Winning a match (having the most points when time runs out): 2 bonus victory points. Tiebreakers, for deciding who won the match and will claim the bonus points, will be based on the following in order of priority: Points before rounding
22

Closest satellite to the closest mining station at the end of the match. 2. Points are lost by: (a) Being outside the Interaction Zone: 0.06 points per second (b) Causing an collision avoidance to activate in Phase 3 when any sphere is within 15 cm of any mining station: 1 points per second 3. Tiebreakers (for deciding who will advance in the bracket) will be based on the following in order of priority: (a) (In Simulation Rounds only) Aggregate of raw (unrounded) points advances (b) Aggregate number of wins (c) Who won the match when the tied players played against each other

5.3

Game Variables

Game variables are variables that you can predene for a simulation. These include the game start time, the axis of the asteroid and whether a player has acquired a laser, shield or disruptor. When simulating, it is possible to enter in dierent values for these variables to test dierent aspects of your code. You will NOT be able to manipulate any of the game variables in a formal competition. For example, in AsteroSPHERES, your satellite is required to mine the asteroids in a particular orientation (dened by the asteroid axis) to get maximum points. The direction of the axis will be random and dierent for each competition of the tournament but xed for all matches within each competition. You may set the game variables for asteroid axes when running simulations to test if your player responds to dierent axis orientations.

23

The dierent game variables available in AsteroSPHERES are listed below: Game Time You can easily set the Game Time (or start time) by typing in the time that you want the simulation to start. In formal competitions, each match will always start at Game Time = 0. Axis of the Asteroid You can change the direction of the asteroid axis about which the rotation or revolution gains maximum points. This can be done one of three ways. The Default button will set the asteroid axis to the following:

The Randomize button will generate a random axis for the asteroid. The following is an example:

You may customize the axis orientation yourself by creating the values and entering them in. In a formal competition, the direction of the asteroid axis will be randomized but xed for all matches in that competition. Acquired Item There are 4 game variables for setting the Item Acquisition status of a satellite for each of the 4 items available. Setting appropriate values in these textboxes allow you to start a match with the corresponding items for a simulation run. The value of 1 in a textbox will cause Sphere 1 to start the match with that item and value of 2 in a textbox will cause Sphere 2 to start the match with that item. This feature is benecial when you are using the Game Time to start in a later phase but you still want to have a specic item in that phase. For example, if you are coding for Sphere 1 and testing only phase 2, you will set the Game Time to 61 and AQUIREDLASER1 to 1 then your simulation will start in phase 2 and you will be in possession of laser 1 and able to shoot at Opulens. In formal competitions, each match will always start at the acquisition of all items by both SPHERES equal to 0. Positioning Finally you can customize your initial position and attitude when the simulation starts. You can do this by entering in the x, y, and z coordinates of where you want your
24

SPHERE to begin the game or nx, ny, nz to start at a particular orientation.

By using the Set From Game Rules button and in formal competitions, the SPHERES will start in positions specied in Section 3.2.

5.4

Tournament Structure and Scoring

The tournament is made up of ve rounds of competitions: 1. 2D Simulation Competition All teams are eligible to participate in the 2D Simulation Round. The format of the competition is a round robin in which all teams play every other team exactly once. The total score for each team from every match is recorded and the aggregate points stored i.e. aggregate number of points for each team summed over all their matches (Score1). The 9 teams with the highest aggregate scores summed over all their matches will be chosen to participate in the Ground Demonstration. 2. Ground Demonstration The top scoring 9 teams from the 2D Simulation Round will be chosen to compete in the Ground Demonstration. Their 2D simulation codes will be run on physical satellites at MITs ground facilites, and the demo will be web-cast live. The purpose of the ground demonstration is to point out the similarities and dierences between simulations and ground hardware testing. No teams will be eliminated based on the ground demo scores. 3. 3D Simulation Competition I All teams are eligible to participate and compete in the 3D Simulation I Round. As in the 2D Simulation Round, the format of the competition is a round robin in which all teams play every other team exactly once. The total score for each team from every match is recorded and the aggregate points stored i.e. aggregate number of points for each team summed over all their matches (Score2). The elimination score for each team is the weighted sum of their 2D Simulation and 3D Simulation I normalized scores: Elimination Score = 0.25*NormalizedScore1 + 0.75*NormalizedScore2 Score where NormalizedScore = M aximumScoreInCompetition The top 54 teams in the elimination score chart will be eligible to compete in the 3D Simulation Competition II. 4. 3D Simulation Competition II The top 54 teams that performed best in the 2D Simulation Competition and 3D Simulation Competition I will be chosen to compete in this competition. Qualifying competitors will choose two other teams to form an alliance with i.e. 18 alliances will be
25

formed. An alliance is a group of teams that works together and submits a single entry for all subsequent competitions. For the purpose of forming alliances, all teams will be given 2 days after the 3D Simulation I Competition results are announced to submit their preferences (Details in Section 5.5). The preferences will be prioritized in order of elimination score seeds. The IDE will have features to allow users from dierent teams to edit a common project and submit the same for a competition (More details in the IDE tutorial). Each team will be responsible for one phase of the game. As in the 3D Simulation I, the format of the competition is a round robin in which all 18 alliances will play every other alliance exactly once. The total score from every match is recorded, and 9 alliances with the highest aggregate scores summed over all their matches will be chosen to compete in the ISS Final Competition 5. ISS Final Competition This round takes place aboard the International Space Station. All 9 alliances comprising 27 teams will be divided into three brackets, where the three players in each bracket will compete in a mini-round robin. The player with the highest score from each bracket will compete in another mini-round robin, and the three nalists will be ranked according to their score in the nal mini-round robin. In case of ambiguities, the result of a bracket/match will be at the discretion of the referee (ISS Astronaut conducting the event) and/or based on oine simulation results. 5.5 Alliances

Teams that qualify after the 2D and 3D team simulation competitions will form alliances to participate in the 2nd 3D simulation competition. Alliances of 3 will be required to submit one integrated project as their formal entry to the competition. The top seeded team in each alliance will make the submission on behalf of the alliance. The alliance selection algorithm will proceed in two phases: rst, participant teams will submit their preferences using the website and next, MIT will run an automated selection algorithm using the teams preferences and team seeds to form the nal alliances. The top 54 teams, ranked by the combined scores of the 2D and 3D simulation competitions, will be divided into 3 tiers of 18 teams each. In the rst phase, teams in the top tier will rank their preferences for alliance partners in the middle tier using a tool available on our website. Likewise, teams in the middle tier will rank will rank their preferences for alliance partners in the bottom tier.

26

In the second phase, MIT will use this information to form the alliances. Starting with the bottom seed of the middle layer, each team will be partnered with their rst remaining preference from the bottom tier. Now we have a partnership between each team of the middle tier and their corresponding selection from the bottom tier.

27

Similarly, starting with the top seed of the top layer, each team will be partnered with their rst remaining preference from the middle tier.

This results in an alliance comprised of one team from the top tier, its partner from the middle tier and the middle tiers partner from the bottom tier. An example of one alliance is shown below:

28

6
6.1

API and Functions


Zero Robotics Functions

These functions dene all interfaces accessible to the ZR user code. They can be called in any Zero Robotics Game and can also be used in the game free mode (refer to the IDE users manual). They include: void ZRUser (float myState[12], float otherState[12], float time) The main user code loop called at every iteration of gspControl (once per second). This function will be the main function available in each project and you will not be allowed to change its signature. The inputs, all in SI (MKS) units, are: myState is a oat array of length 12 which is the state vector of the user satellite [position x, position y, position x, velocity x, velocity y, velocity z, att vector x, att vector y, att vector z, att rates x, att rates y, att rates z]. The attitude and attitude rates are in radians and radians per second and NOT degrees. otherState is a oat array of length 12 which is the state vector of the other satellite [position x, position y, position x, velocity x, velocity y, velocity z, att vector x, att vector y, att vector z, att rates x, att rates y, att rates z]. The attitude and attitude rates are in radians and radians per second and NOT degrees. time since the user code was activated (in seconds) void ZRSetPositionTarget (float posTarget[3]) Sets an x, y, and z position target for closed loop PD position control. Cannot be combined with velocity control. Input: posTarget is a oat array of length = 3 containing the position targets x, y and z. void ZRSetVelocityTarget (float velTarget[3]) Sets an x, y, and z linear velocity target for closed loop velocity control. Cannot be combined with position control. Input: velTarget is a oat array of length = 3 containing the velocity targets velocity x, velocity y and velocity z.
29

void ZRSetAttitudeTarget (float attTarget[3]) Species a unit vector (called the attitude vector) for the satellite to point toward. The satellite will move its -X face (beacon/Velcro face) to point at the specied (length 3) unit vector. Note that the satellites are limited to a maximum angular speed of 60 degrees per second. Input: attTarget length 3 unit vector to point toward void ZRSetForces (float forces[3]) Sets the x, y, and z forces to be applied to the satellite. These forces will be added to any closed loop control forces commanded by ZRSetPositionTarget or ZRSetVelocityTarget so using both together may result in unexpected actuation. Input: forces length 3 oat array of forces. void ZRSetTorques (float torques[3]) Sets torques around the x, y, and z body axes to be applied to the satellite. These torques will be added to any closed loop control forces commanded by the satelliteZRSetPositionAttitudeTarget so using both together may result in unexpected actuation. Note that the state vector does not provide any information about the Y and Z body axes and this may limit the usefulness of this API function. Input: torques is a oat array of length = 3 containing the torques to be applied about the x, y, z axes. 6.2 Math Functions

float mathVecInner(float *a, float *b, int n) Returns the inner (dot) two vectors a and b each of size n void mathVecNormalize(float *a, int n) makes the supplied vector (a) a unit vector, where n is the number of elements in the vector float mathVecMagnitude(float *a, int n) returns the magnitude of the supplied vector (a), where n is the number of elements in the vector void mathVecCross(float vout[3], float a[3], float b[3]) returns the cross product of a and b in the supplied vector vout void mathVecAdd(float *c, float *a, float *b, int n) adds vector a to vector b and returns the result in vector c and n is the number of elements in the vector void mathVecSubtract(float *c, float *a, float *b, int n) subtracts vector b from vector a and returns the result in vector c and n is the number of elements in the vector float mathSquare(float a) returns a a All the standard C math functions will be available

6.3

AsteroSPHERES General Functions

unsigned char PgetPhase() - Returns the stage the game is in PHASE1 (1) for the rst stage, PHASE2 (2) for the second stage, and PHASE3 (3) for the third stage. unsigned short PgetCharge() - Returns the remaining charge

30

float PgetPercentFuelRemaining() - Returns the remaining fuel as a percentage of the total (0-100) void PsendMessage(unsigned short message) - Sends a message token to the other player with the specied message. If the input is a value outside the range of 1 to 65535, no message token will be sent. unsigned short PgetMessage() - Checks if a message token has been received. Returns the value of the last message sent by the other satellite, if any, or 0 otherwise. float PgetScore() - Returns the active players current score. float PgetOtherScore() - Returns the opponents current score. unsigned char PoutsideBoundary(float position[3]) - Returns true (1) if the satellite has exited the interactions zone, returns false (0) otherwise Inputs: position 3-element satellite position vector unsigned char PisAvoidingCollision() - Returns (1) if the internal collision avoidance algorithm activated within the satellite in the previous second. Collision avoidance takes over user controls for 3 seconds since the time it activates. unsigned char PatMining () - Checks if the satellite has reached any mining station. Returns 1 if station1 has been reached, 2 if station 2 has been reached and 0 if none have been reached. 6.4 AsteroSPHERES Asteroid Functions

void PgetAsteroidNormal(float asteroidNormal[3]) - Returns the normal to the asteroid plane in the supplied vector asteroidNormal[3] unsigned char PinAsteroid(float state[12]) - Checks if the satellite state is valid to collect points on an asteroid. Both position and velocity requirements must be met. Returns OPULENS (or 1) if the satellite is Opulens, INDIGENS (or 2) if the satellite is on Indigens, 0 otherwise. Parameter state is the state of the SPHERE for which you are checking the condition. unsigned char PisRevolving(float *state[12]) - Checks if the satellite position is valid to collect points by revolving around an asteroid. Only position requirements must be met. Returns OPULENS (or 1) if the satellite is around Opulens, INDIGENS (or 2) if the satellite is around Indigens, 0 otherwise. Parameter state is the state of the SPHERE for which you are checking the condition. unsigned char PiceMelted() - Returns true (1) if Opulens ore is no longer protected by a layer of ice, false (0) if the ice layer still exists unsigned short PiceHits() - Returns the number of hits on Opulens ice sheet by the active player unsigned short PotherIceHits() - Returns the number of hits on Opulens ice sheet by the other player

31

6.5

AsteroSPHERES Item Functions

unsigned char PdisruptorUpgraded() - Returns true (1) if the active satellite picked up the disruptor upgrade, returns false (0) otherwise. unsigned char PotherDisruptorUpgraded() - Returns true (1) if the other satellite picked up the disruptor upgrade, returns false (0) otherwise. unsigned char PhaveShield() - Returns true (1) if the active satellite picked up the shield, returns false (0) otherwise. unsigned char PotherHasShield() - Returns true (1) if the other satellite picked up the shield, returns false (0) otherwise. unsigned char PhaveLaser() - Call this to see whether the active satellite picked up a laser. Returns 1 for the rst laser, 2 for the second laser, and 0 if a laser has not been picked up. unsigned char PotherHasLaser() - Call this to see whether the other satellite picked up a laser. Returns 1 for the rst laser, 2 for the second laser, and 0 if a laser has not been picked up. void Prepulsor() - Activates the repulsor; pushes the other satellite by a particular amount in the direction in which you are facing it. Consumes charge. unsigned char PotherRepulsor() - Call this to nd out if the active satellite is being repelled by the other player. Returns true (1) if you are being repelled, and false (0) if otherwise. void Ptractor() - Activates the tractor; pushes the other satellite by a particular amount in the direction in which you are facing it. Consumes charge. unsigned char PotherTractor() - Call this to nd out if the active satellite is being attracted by the other player. Returns true(1) if you are being attracted and false (0) if otherwise. void Plaser() - Activates the laser if it has been acquired. unsigned char PotherLaser() - Call this to nd out if your opponent is using their laser on you or on Opulens (i.e. either you or Opulens is within its laser attack cone). Returns 1 if they are using Laser 1, 2 if they are using Laser 2 and 0 if they are not using a laser. unsigned char PgetShieldStrength() - Returns shield charge remaining for whoever has the shield, and returns void if no one has it

32

Revision History

If we make any changes to the game manual, we will post the revision details here so that it is easy to keep track of the changes. Note that minor tweaks to the 3D game may be implemented after the 2D competition. You may start playing the 3D game early on, with the knowledge that small changes may be introduced after the 2D results are declared. We do not expect any critical changes in the manual.

Document Revision History Date 2011/09/10 2011/09/18 2011/09/22 Revision 1.0.0 1.0.1 1.0.2 Description Initial Release Disruptor force values corrected in text and graph, disruptor description corrected Corrected the position of the mining stations in graphs, corrected a typo for coll. avoidance which kicks in approaching 20 cm S2S distance in 3D Corrected the collision penalty criteria in Phase 3 at the mining stations Claried that only one laser shot per second will be counted to break shield/melt ice, rebalanced the points in Section 5.2 Corrected a typo in the manual: Being outside the interaction zone costs 0.06 points per second not 0.03 Changed the base points for spinning and revolving to 0.065 from 0.05 and 0.0715 from 0.065 respectively Changed the ratio of earning points by mining on opulens to indigens from 1.5 to 1.3 Changed the points for winning the race from a maximum of 3 to a maximum of 4 Changed the 3D collision avoidance trigger distance from 20 cm to 30 cm, to reect the game Changed the radius of the penalty zone around the mining stations in Phase 3 from 30 cm to 15 cm, corrected the image on Pg 8 to read 0.4*TimeRemaining from 0.3, corrected a typo in the penalty to be out of bounds on Pg 22 to be 0.06/s from 0.03/s, described collision avoidance in more detail Changed the weight of the 2D competition to 0.25 from 0.3
33

Author ZR Team Sreeja Sreeja

2011/10/13

1.0.3

Sreeja

2011/10/13

1.0.4

Sreeja

2011/10/16

1.0.5

Sreeja

2011/10/18

1.0.6

Sreeja

2011/10/26

1.0.7

Sreeja

2011/11/06

1.0.8

2011/11/07

1.0.9

Lowered the base points gain for spin- Sreeja ning alone on Indigens to 0.06 from 0.065 and on Opulens from 0.715 to 0.066 Removed the dependence of race points on time remaining Changed the position of the mining stations Added the 3D grid pictures On Pg 13, up- Sreeja dated the picture on Pg 8, corrected a typo in Section 5.2 to make base points 0.06

34

Game Revision History Date 2011/09/10 2011/10/11 Revision 1.0.0 1.0.4 Description Initial Release Corrected the mapping function from game scores to test result numbers, capped o the maximum cooperative ice hits to 14 Changed the penalty in Phase 3 so that both spheres get penalized if any is near the station, only one laser shot per second will be counted to break shield/melt ice, rebalanced the points Changed the base points for spinning and revolving to 0.065 from 0.05 and 0.0715 from 0.065 respectively Changed the ratio of earning points by mining on opulens to indigens from 1.5 to 1.3 Changed the points for winning the race from a maximum of 3 to a maximum of 4 Changed the radius of the penalty zone around the mining stations in Phase 3 from 30 cm to 15 cm Lowered the base points gain for spinning alone on Indigens to 0.06 from 0.065 and on Opulens from 0.715 to 0.066 Removed the dependence of race points on time remaining Changed the position of the mining stations Author ZR Team Sreeja

2011/10/13

1.0.5

Sreeja

2011/10/13

1.0.6

Sreeja

2011/10/18

1.0.7

Sreeja

2011/11/06

1.0.9

Sreeja

35

You might also like