From e1e06ee2cb8e45c4591230f1c07fa49bf2bfe639 Mon Sep 17 00:00:00 2001 From: Unknown Date: Sun, 19 May 2019 15:54:46 +0200 Subject: [PATCH] better walk control --- .../.vs/Hexapod/v15/Server/sqlite3/storage.ide-shm | 2 +- .../.vs/Hexapod/v15/Server/sqlite3/storage.ide-wal | 2 +- 2018-unity-sim/Assets/Serial3.cs | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/2018-unity-sim/.vs/Hexapod/v15/Server/sqlite3/storage.ide-shm b/2018-unity-sim/.vs/Hexapod/v15/Server/sqlite3/storage.ide-shm index 144c84d..545618f 100644 --- a/2018-unity-sim/.vs/Hexapod/v15/Server/sqlite3/storage.ide-shm +++ b/2018-unity-sim/.vs/Hexapod/v15/Server/sqlite3/storage.ide-shm @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9b12b85d80593b3788a752c840c161c3268546335cc555e76e324629c4f83893 +oid sha256:9d88cf0f5d97ee5d432360c8648028e32f724e9759db7a6dce5b9a30cc18a6a8 size 32768 diff --git a/2018-unity-sim/.vs/Hexapod/v15/Server/sqlite3/storage.ide-wal b/2018-unity-sim/.vs/Hexapod/v15/Server/sqlite3/storage.ide-wal index 02c9ed0..063cdaa 100644 --- a/2018-unity-sim/.vs/Hexapod/v15/Server/sqlite3/storage.ide-wal +++ b/2018-unity-sim/.vs/Hexapod/v15/Server/sqlite3/storage.ide-wal @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e36a9fe21123888300a9a9acd66fa539c9b4ee21cc5f999f36da2a0890c9d78a +oid sha256:20a060fb1f3aa3d33eb59d4f11b5225d0479babe788d9f6de89c00445e1c5fd1 size 4140632 diff --git a/2018-unity-sim/Assets/Serial3.cs b/2018-unity-sim/Assets/Serial3.cs index 2c8b2c9..5277af8 100644 --- a/2018-unity-sim/Assets/Serial3.cs +++ b/2018-unity-sim/Assets/Serial3.cs @@ -91,6 +91,11 @@ public class Serial3 : MonoBehaviour{ walk.centerRotation = rotation < 0.5f && rotation > -0.5f ? 0 : rotation; walk.walkDirection = (-1 * ConvertRadiansToDegrees((float) Math.Atan2(b2, b1))); + + float rotationabs = Math.Abs(walk.centerRotation); + float speed2 = ((6 / 3) * walk.walkspeed) + ((6/5) * rotationabs); + speed2 = speed2 < 6 ? speed2 : 6; + walk.speed2 = (int)(10 - speed2); } } }