From d0036d11f3d52f93e7935bf0fdbbd69a7551151a Mon Sep 17 00:00:00 2001
From: odri <odri@furano.laas.fr>
Date: Mon, 18 Oct 2021 10:49:05 +0200
Subject: [PATCH] Tweak joystick references

---
 include/qrw/Joystick.hpp | 8 ++++----
 scripts/Controller.py    | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/qrw/Joystick.hpp b/include/qrw/Joystick.hpp
index e2ffd787..ff95e8c7 100644
--- a/include/qrw/Joystick.hpp
+++ b/include/qrw/Joystick.hpp
@@ -116,14 +116,14 @@ class Joystick {
 
   // Maximum velocity values
   double vXScale = 0.3;  // Lateral
-  double vYScale = 0.6;  // Forward
+  double vYScale = 0.5;  // Forward
   double vYawScale = 1.0;  // Rotation
 
   // Maximum position values
-  double pRollScale = 0.32;  // Lateral
-  double pPitchScale = 0.28;  // Forward
+  double pRollScale = -0.32;  // Lateral
+  double pPitchScale = -0.28;  // Forward
   double pHeightScale = 0.025;  // Forward
-  double pYawScale = 0.25;  // Rotation
+  double pYawScale = -0.35;  // Rotation
 
   // Variable to handle the automatic static/trot switching
   bool switch_static = false;
diff --git a/scripts/Controller.py b/scripts/Controller.py
index 714f1ef1..c7070ec4 100644
--- a/scripts/Controller.py
+++ b/scripts/Controller.py
@@ -361,7 +361,7 @@ class Controller:
                 # self.p_ref[3, 0] = np.clip((self.k - 2000) / 2000, 0.0, 1.0)
                 self.xgoals[[3, 4], 0] = self.p_ref[[3, 4], 0]
                 self.h_ref = self.p_ref[2, 0]
-                hRb = pin.rpy.rpyToMatrix(0.0, 0.0, self.p_ref[3, 0] * 0.35)
+                hRb = pin.rpy.rpyToMatrix(0.0, 0.0, self.p_ref[5, 0])
                 # print(self.joystick.getPRef())
                 # print(self.p_ref[2])
             else:
-- 
GitLab