]> rtime.felk.cvut.cz Git - hubacji1/iamcar.git/commitdiff
Add bicycle car related macros
authorJiri Vlasak <hubacji1@fel.cvut.cz>
Wed, 3 Apr 2019 07:54:41 +0000 (09:54 +0200)
committerJiri Vlasak <hubacji1@fel.cvut.cz>
Fri, 5 Apr 2019 07:22:49 +0000 (09:22 +0200)
- Distance from wheelbase center to rear axle.
- Distance from wheelbase center to front axle.
- Diagonals in car (to rear, to front).
- Outer radius.

incl/bcar.h

index 0abd3dd26f9c6bf05eda30c82cd9845c0d98f33c..c09c65239749b00179accc3eab199493559e134c 100644 (file)
@@ -27,6 +27,13 @@ along with I am car. If not, see <http://www.gnu.org/licenses/>.
 #define BCAR_TURNING_RADIUS 10.820
 #define BCAR_WHEEL_BASE 2.450
 #define BCAR_WIDTH 1.625
+#define BCAR_DIST_REAR ((BCAR_LENGTH - BCAR_WHEEL_BASE) / 2)
+#define BCAR_DIST_FRONT (BCAR_LENGTH - BCAR_DIST_REAR)
+#define BCAR_DIAG_RADI pow(pow(BCAR_DIST_FRONT, 2) + pow(BCAR_WIDTH/2, 2), 0.5)
+#define BCAR_DIAG_RRADI pow(pow(BCAR_DIST_REAR, 2) + pow(BCAR_WIDTH/2, 2), 0.5)
+#define BCAR_OUT_RADI pow( \
+        pow(BCAR_TURNING_RADIUS + BCAR_WIDTH/2, 2) + \
+        pow(BCAR_DIST_FRONT, 2), 0.5)
 
 #define MAXSTEER(wb, tr) ((wb) / (tr))