Paintball Launcher - QuirkyCort/gears GitHub Wiki
This simulates a spring-loaded paintball launcher. It's a possible, if challenging build, using a typical educational robotics kit, but will likely be much larger and perform poorer than the one in the simulator (See here for one such build).
To operate the launcher, you must first run the motor in reverse (eg. "run motor on port D at 100% for -2 rotations"). This will pull the spring back. The further back you pull the spring, the more powerful the eventual launch. The default configurations allows you to pull it back for at most 1000 degrees.
To fire, turn the motor forward (eg. "run motor on port D at 100% for 1 rotations"). Any amount of forward rotation will cause the paintball to launch.
-
IMPORTANT: Gravity in the simulator is only 0.981 m/s2. This is because the physics engine used is not effective at simulating small objects (...less than 1m) resulting in a lot of jitter. The reduced gravity allows for a more stable simulation.
-
A typical paintball gun operates using compressed gasses and not springs.
-
A typical paintball gun can propel its paintball for about 90 meters (...but is effective for only a fraction of that range). In its default configurations, the simulated paintball can reach only around 4 meters (...but since it's just a computer simulation, it can be configured to reach Mars).
Default values are shown below.
"type": "PaintballLauncherActuator",
"options": {
"drawBackLimit": -1000,
"powerScale": 2,
"maxSpeed": 600,
"color": 0,
"ttl": 10000,
"ammo": -1,
"splatterTTL": -1
}
drawBackLimit: The limit that you can pull back the spring in degrees.
powerScale: This is multiplied by the spring drawback to determine the initial velocity of the paintball. Increasing this will increase the paintball speed.
maxSpeed: The maximum rotation speed of the motor. This is NOT the maximum speed of the paintball.
color: Color of the paintball. From 0 to 5, they are Cyan, Green, Yellow, Red, Magenta, Blue
ttl: Time-To-Live in milliseconds. After this duration, the paintball will be removed.
ammo: The amount of ammo available to the launcher at start. Set to "-1" for unlimited ammo. Some worlds may limit the available ammo and will override this setting.
splatterTTL: Time-To-Live in milliseconds for the paint splatter. After this duration, the paint splatter will be removed. Set a negative number to last forever.