<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to Programming</title><link>https://sourceforge.net/p/pybotwar/wiki/Programming/</link><description>Recent changes to Programming</description><atom:link href="https://sourceforge.net/p/pybotwar/wiki/Programming/feed" rel="self"/><language>en</language><lastBuildDate>Sat, 18 Mar 2023 13:56:19 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/pybotwar/wiki/Programming/feed" rel="self" type="application/rss+xml"/><item><title>Programming modified by Lee Harr</title><link>https://sourceforge.net/p/pybotwar/wiki/Programming/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v4
+++ v5
@@ -1,7 +1,6 @@
 # Introduction

-The computer in the pybotwar robots has 2 parts. One part, outside of user control, calls the other part 60 times per second and uses those result
-s to signal which actions are taken.
+The computer in the pybotwar robots has 2 parts. One part, outside of user control, calls the other part 60 times per second and uses those results to signal which actions are taken.


 ## Getting Started
@@ -29,8 +28,7 @@

 If you would like to run some code when your robot is first starting up, create an `initialize()` method and add your your startup code there.

-The `initialize()` method should take no parameters (other than `self`) and it must return in less than 1 second or the robot will be placed in to
- an error state and removed from the battle.
+The `initialize()` method should take no parameters (other than `self`) and it must return in less than 1 second or the robot will be placed in to an error state and removed from the battle.

 ```
 from robot import Robot
@@ -43,8 +41,7 @@

 ## Sensors

-There are a variety of [Sensors] available to your robot. Using the default `Robot` class for a base, the sensor readings will be set 
-automatically on each clock tick.
+There are a variety of [Sensors] available to your robot. Using the default `Robot` class for a base, the sensor readings will be set automatically on each clock tick.

 Get your sensor data like so:

&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Lee Harr</dc:creator><pubDate>Sat, 18 Mar 2023 13:56:19 -0000</pubDate><guid>https://sourceforge.net1648f293bdbe0b550fad8039c6b4fdb28a257dae</guid></item><item><title>Programming modified by Lee Harr</title><link>https://sourceforge.net/p/pybotwar/wiki/Programming/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v3
+++ v4
@@ -61,4 +61,4 @@
         robot_angle = self.sensors['GYRO']
 ```

-For more details, see the [Sensors](Sensors.md) page.
+For more details, see the [Sensors] page.
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Lee Harr</dc:creator><pubDate>Sat, 18 Mar 2023 13:49:01 -0000</pubDate><guid>https://sourceforge.netfa2e2ad287dcc923120d0e79d9f067fd41c0c7f8</guid></item><item><title>Programming modified by Lee Harr</title><link>https://sourceforge.net/p/pybotwar/wiki/Programming/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v2
+++ v3
@@ -43,7 +43,7 @@

 ## Sensors

-There are a variety of [Sensors](Sensors.md) available to your robot. Using the default `Robot` class for a base, the sensor readings will be set 
+There are a variety of [Sensors] available to your robot. Using the default `Robot` class for a base, the sensor readings will be set 
 automatically on each clock tick.

 Get your sensor data like so:
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Lee Harr</dc:creator><pubDate>Sat, 18 Mar 2023 13:48:38 -0000</pubDate><guid>https://sourceforge.netc653f658bd86f37dda4a122c7dc08b0a6c0c2ff9</guid></item><item><title>Programming modified by Lee Harr</title><link>https://sourceforge.net/p/pybotwar/wiki/Programming/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v1
+++ v2
@@ -22,7 +22,7 @@
         self.torque(50) # 50% of maximum torque
 ```

-For more information on what controls are available, see the [Controls](Controls.md) page
+For more information on what controls are available, see the [Controls] page


 ## Initialization
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Lee Harr</dc:creator><pubDate>Sat, 18 Mar 2023 13:48:06 -0000</pubDate><guid>https://sourceforge.net8043b4d769ff75388b11dc6aa7259985f852cbf0</guid></item><item><title>Programming modified by Lee Harr</title><link>https://sourceforge.net/p/pybotwar/wiki/Programming/</link><description>&lt;div class="markdown_content"&gt;&lt;h1 id="introduction"&gt;Introduction&lt;/h1&gt;
&lt;p&gt;The computer in the pybotwar robots has 2 parts. One part, outside of user control, calls the other part 60 times per second and uses those result&lt;br/&gt;
s to signal which actions are taken.&lt;/p&gt;
&lt;h2 id="getting-started"&gt;Getting Started&lt;/h2&gt;
&lt;p&gt;The easiest way to get started is to inherit from the &lt;code&gt;Robot&lt;/code&gt; class in the &lt;code&gt;robot&lt;/code&gt; module. Call your subclass &lt;code&gt;TheRobot&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;In your &lt;code&gt;TheRobot&lt;/code&gt; class, the method &lt;code&gt;respond&lt;/code&gt; will be called repeatedly as the robot runs.&lt;/p&gt;
&lt;p&gt;So, a very simple robot which would just turn in place would look like this:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;robot&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Robot&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;TheRobot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Robot&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;respond&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;torque&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;# 50% of maximum torque&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;For more information on what controls are available, see the &lt;a class="" href="../Controls.md"&gt;Controls&lt;/a&gt; page&lt;/p&gt;
&lt;h2 id="initialization"&gt;Initialization&lt;/h2&gt;
&lt;p&gt;If you would like to run some code when your robot is first starting up, create an &lt;code&gt;initialize()&lt;/code&gt; method and add your your startup code there.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;initialize()&lt;/code&gt; method should take no parameters (other than &lt;code&gt;self&lt;/code&gt;) and it must return in less than 1 second or the robot will be placed in to&lt;br/&gt;
 an error state and removed from the battle.&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;robot&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Robot&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;TheRobot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Robot&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;initialize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;health&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt; &lt;span class="c1"&gt;# Keep track of current health for later use&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h2 id="sensors"&gt;Sensors&lt;/h2&gt;
&lt;p&gt;There are a variety of &lt;a class="" href="../Sensors.md"&gt;Sensors&lt;/a&gt; available to your robot. Using the default &lt;code&gt;Robot&lt;/code&gt; class for a base, the sensor readings will be set &lt;br/&gt;
automatically on each clock tick.&lt;/p&gt;
&lt;p&gt;Get your sensor data like so:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;robot&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Robot&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;TheRobot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Robot&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;respond&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;tick&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sensors&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'TICK'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
        &lt;span class="n"&gt;health&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sensors&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'HEALTH'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
        &lt;span class="n"&gt;pos_x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pos_y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sensors&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'POS'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
        &lt;span class="n"&gt;turret_angle&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sensors&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'TUR'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
        &lt;span class="n"&gt;kind&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;angle&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;distance&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sensors&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'PING'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
        &lt;span class="n"&gt;robot_angle&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sensors&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'GYRO'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;For more details, see the &lt;a class="" href="../Sensors.md"&gt;Sensors&lt;/a&gt; page.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Lee Harr</dc:creator><pubDate>Sat, 18 Mar 2023 13:46:51 -0000</pubDate><guid>https://sourceforge.nete671f0ef780f0a97e9e63246c9bba9241a5d2cac</guid></item></channel></rss>