From 3ee06d856e7b4b4e20ef3ee2aaa4cd4a2e8a13cf Mon Sep 17 00:00:00 2001
From: m-guberina <gubi.guberina@gmail.com>
Date: Fri, 24 Jan 2025 13:02:07 +0100
Subject: [PATCH] fixed a thing or two

---
 python/examples/clik.py                       |  4 +-
 python/examples/drawing_from_input_drawing.py |  4 +-
 python/examples/graz/joint_copier_client.py   |  4 +-
 python/examples/joint_trajectory.csv          | 70 +++++++++++++++----
 python/examples/path_in_pixels.csv            | 70 +++++++++++++++----
 5 files changed, 122 insertions(+), 30 deletions(-)

diff --git a/python/examples/clik.py b/python/examples/clik.py
index e6d2587..e16f1ed 100644
--- a/python/examples/clik.py
+++ b/python/examples/clik.py
@@ -35,7 +35,7 @@ if __name__ == "__main__":
     robot = RobotManager(args)
     if args.randomly_generate_goal:
         Mgoal = getRandomlyGeneratedGoal(args)
-        if args.visualize_manipulator:
+        if args.visualizer:
             robot.visualizer_manager.sendCommand({"Mgoal": Mgoal})
     else:
         Mgoal = robot.defineGoalPointCLI()
@@ -52,7 +52,7 @@ if __name__ == "__main__":
     if not args.pinocchio_only:
         robot.stopRobot()
 
-    if args.visualize_manipulator:
+    if args.visualizer:
         robot.killManipulatorVisualizer()
 
     if args.save_log:
diff --git a/python/examples/drawing_from_input_drawing.py b/python/examples/drawing_from_input_drawing.py
index 612c145..e8f8302 100644
--- a/python/examples/drawing_from_input_drawing.py
+++ b/python/examples/drawing_from_input_drawing.py
@@ -254,7 +254,6 @@ if __name__ == "__main__":
     args.mm_into_board = args.mm_into_board / 1000
     print(args)
     robot = RobotManager(args)
-    clikController = getClikController(args, robot)
     if args.pinocchio_only:
         rand_pertb = np.zeros(8)
         rand_pertb[:6] = np.random.random(6) * 0.1
@@ -334,6 +333,7 @@ if __name__ == "__main__":
         it has to look reasonable, otherwise we can't run it!
         """
                   )
+        clikController = getClikController(args, robot)
         joint_trajectory = clikCartesianPathIntoJointPath(args, robot, path, \
             clikController, q_init, plane_pose)
         if args.viz_test_path:
@@ -358,7 +358,7 @@ if __name__ == "__main__":
     if args.save_log:
         robot.log_manager.saveLog()
 
-    if args.visualize_manipulator:
+    if args.visualizer:
         robot.killManipulatorVisualizer()
 
     if args.save_log:
diff --git a/python/examples/graz/joint_copier_client.py b/python/examples/graz/joint_copier_client.py
index cd95e82..0ed3acb 100644
--- a/python/examples/graz/joint_copier_client.py
+++ b/python/examples/graz/joint_copier_client.py
@@ -34,8 +34,8 @@ def controlLoopExternalQ(robot: RobotManager, receiver: ProcessManager, i, past_
 
     q_desired = receiver.getData()["q"]
     q_error = q_desired - q
-    K = 120
-    qd_cmd = K * q_error * robot.dt
+    K = 10
+    qd_cmd = K * q_error
 
     robot.sendQd(qd_cmd)
 
diff --git a/python/examples/joint_trajectory.csv b/python/examples/joint_trajectory.csv
index 50e963a..c91cde2 100644
--- a/python/examples/joint_trajectory.csv
+++ b/python/examples/joint_trajectory.csv
@@ -1,12 +1,58 @@
-0.00000,0.89399,-1.14443,-1.59870,-1.19904,2.09084,-0.46538
-0.90909,0.85737,-1.15854,-1.59128,-1.20634,2.11545,-0.49549
-1.81818,0.78072,-1.22087,-1.54384,-1.22630,2.16669,-0.56226
-2.72727,0.72981,-1.29410,-1.47091,-1.25266,2.19980,-0.60946
-3.63636,0.72173,-1.30816,-1.45575,-1.25825,2.20497,-0.61719
-4.54545,0.71453,-1.32044,-1.44268,-1.26311,2.20956,-0.62412
-5.45455,0.70929,-1.32971,-1.43271,-1.26682,2.21288,-0.62919
-6.36364,0.70645,-1.33502,-1.42687,-1.26899,2.21468,-0.63196
-7.27273,0.70331,-1.34106,-1.42016,-1.27147,2.21666,-0.63503
-8.18182,0.70057,-1.34709,-1.41319,-1.27403,2.21839,-0.63772
-9.09091,0.69463,-1.36301,-1.39376,-1.28104,2.22213,-0.64359
-10.00000,0.69461,-1.36306,-1.39370,-1.28106,2.22214,-0.64361
+0.00000,0.45874,-1.08962,-1.51206,-1.38620,2.51445,-0.74052
+0.17544,0.45868,-1.08964,-1.51205,-1.38626,2.51449,-0.74058
+0.35088,0.45863,-1.08965,-1.51202,-1.38631,2.51452,-0.74064
+0.52632,0.45858,-1.08968,-1.51198,-1.38637,2.51455,-0.74069
+0.70175,0.45686,-1.09130,-1.50949,-1.38873,2.51552,-0.74237
+0.87719,0.45058,-1.10155,-1.49463,-1.39887,2.51904,-0.74852
+1.05263,0.44612,-1.11303,-1.47853,-1.40748,2.52153,-0.75295
+1.22807,0.44362,-1.12180,-1.46649,-1.41303,2.52293,-0.75549
+1.40351,0.44026,-1.13670,-1.44704,-1.42079,2.52487,-0.75917
+1.57895,0.43214,-1.16746,-1.41083,-1.43467,2.52992,-0.76930
+1.75439,0.42839,-1.18095,-1.39531,-1.44074,2.53228,-0.77417
+1.92982,0.42411,-1.19552,-1.37897,-1.44719,2.53499,-0.77985
+2.10526,0.41083,-1.23371,-1.33875,-1.46409,2.54336,-0.79793
+2.28070,0.40583,-1.24716,-1.32481,-1.47033,2.54649,-0.80489
+2.45614,0.39519,-1.27190,-1.30087,-1.48194,2.55307,-0.81990
+2.63158,0.38707,-1.28820,-1.28629,-1.48988,2.55803,-0.83154
+2.80702,0.38140,-1.29800,-1.27840,-1.49482,2.56145,-0.83976
+2.98246,0.37530,-1.30762,-1.27132,-1.49974,2.56510,-0.84870
+3.15789,0.36691,-1.31857,-1.26498,-1.50553,2.57007,-0.86114
+3.33333,0.35977,-1.32735,-1.26050,-1.51023,2.57424,-0.87187
+3.50877,0.35378,-1.33423,-1.25755,-1.51397,2.57770,-0.88098
+3.68421,0.35062,-1.33768,-1.25627,-1.51588,2.57950,-0.88582
+3.85965,0.34475,-1.34349,-1.25486,-1.51913,2.58284,-0.89488
+4.03509,0.33688,-1.34930,-1.25589,-1.52268,2.58725,-0.90716
+4.21053,0.32958,-1.35313,-1.25916,-1.52537,2.59128,-0.91869
+4.38596,0.32489,-1.35510,-1.26201,-1.52692,2.59384,-0.92618
+4.56140,0.32055,-1.35637,-1.26544,-1.52815,2.59619,-0.93315
+4.73684,0.31739,-1.35676,-1.26869,-1.52887,2.59788,-0.93826
+4.91228,0.30875,-1.35517,-1.28132,-1.52988,2.60246,-0.95237
+5.08772,0.29881,-1.34908,-1.30161,-1.52978,2.60762,-0.96883
+5.26316,0.29288,-1.34447,-1.31500,-1.52956,2.61064,-0.97878
+5.43860,0.28492,-1.33645,-1.33529,-1.52889,2.61462,-0.99227
+5.61404,0.27574,-1.32443,-1.36209,-1.52773,2.61913,-1.00807
+5.78947,0.27105,-1.31721,-1.37700,-1.52708,2.62138,-1.01621
+5.96491,0.26772,-1.31006,-1.38999,-1.52627,2.62297,-1.02203
+6.14035,0.26371,-1.29429,-1.41418,-1.52396,2.62487,-1.02907
+6.31579,0.26195,-1.28166,-1.43150,-1.52193,2.62570,-1.03215
+6.49123,0.26203,-1.25338,-1.46478,-1.51674,2.62568,-1.03192
+6.66667,0.26378,-1.23798,-1.48068,-1.51351,2.62488,-1.02876
+6.84211,0.26788,-1.22076,-1.49587,-1.50920,2.62296,-1.02146
+7.01754,0.27556,-1.19947,-1.51183,-1.50286,2.61931,-1.00795
+7.19298,0.28437,-1.18268,-1.52173,-1.49658,2.61502,-0.99267
+7.36842,0.29389,-1.16823,-1.52857,-1.49020,2.61026,-0.97642
+7.54386,0.31292,-1.14531,-1.53637,-1.47819,2.60042,-0.94472
+7.71930,0.31820,-1.13976,-1.53792,-1.47482,2.59761,-0.93609
+7.89474,0.32985,-1.13120,-1.53730,-1.46807,2.59129,-0.91737
+8.07018,0.33983,-1.12633,-1.53425,-1.46265,2.58576,-0.90162
+8.24561,0.35186,-1.12401,-1.52673,-1.45678,2.57894,-0.88302
+8.42105,0.37319,-1.12681,-1.50568,-1.44819,2.56649,-0.85105
+8.59649,0.38315,-1.12948,-1.49441,-1.44468,2.56051,-0.83653
+8.77193,0.39544,-1.13475,-1.47806,-1.44118,2.55301,-0.81898
+8.94737,0.40970,-1.14329,-1.45598,-1.43833,2.54413,-0.79913
+9.12281,0.41767,-1.14866,-1.44282,-1.43718,2.53909,-0.78826
+9.29825,0.42642,-1.15734,-1.42472,-1.43699,2.53349,-0.77652
+9.47368,0.43304,-1.16672,-1.40726,-1.43793,2.52921,-0.76778
+9.64912,0.43800,-1.17945,-1.38656,-1.44064,2.52598,-0.76133
+9.82456,0.43939,-1.18667,-1.37587,-1.44265,2.52506,-0.75953
+10.00000,0.43940,-1.18671,-1.37581,-1.44267,2.52506,-0.75952
diff --git a/python/examples/path_in_pixels.csv b/python/examples/path_in_pixels.csv
index fd83f22..e556fcf 100644
--- a/python/examples/path_in_pixels.csv
+++ b/python/examples/path_in_pixels.csv
@@ -1,12 +1,58 @@
-0.20381,0.36380
-0.25473,0.36700
-0.35332,0.38197
-0.44758,0.42152
-0.46491,0.43007
-0.48116,0.43434
-0.49308,0.43862
-0.49958,0.44183
-0.50716,0.44503
-0.51366,0.45038
-0.53100,0.46320
-0.53100,0.46320
+0.27487,0.52681
+0.27191,0.53469
+0.27191,0.53863
+0.27487,0.54651
+0.28226,0.55964
+0.29409,0.57409
+0.30592,0.58722
+0.31479,0.59641
+0.33105,0.60955
+0.36802,0.62924
+0.38428,0.63712
+0.40202,0.64500
+0.45081,0.66076
+0.46856,0.66470
+0.50256,0.66864
+0.52622,0.66733
+0.54100,0.66339
+0.55579,0.65945
+0.57353,0.65026
+0.58831,0.64369
+0.60014,0.63712
+0.60606,0.63318
+0.61641,0.62530
+0.62676,0.61086
+0.63415,0.59641
+0.63858,0.58722
+0.64154,0.57803
+0.64154,0.57015
+0.64154,0.54914
+0.63563,0.52287
+0.63267,0.50712
+0.62676,0.48479
+0.61641,0.45721
+0.60901,0.44277
+0.59866,0.43226
+0.57649,0.41650
+0.55874,0.40731
+0.52030,0.39287
+0.49813,0.39024
+0.47299,0.39155
+0.44194,0.39549
+0.41681,0.40468
+0.39463,0.41388
+0.35767,0.43095
+0.34880,0.43620
+0.33549,0.45327
+0.32810,0.46903
+0.32514,0.49004
+0.32366,0.52681
+0.32366,0.54389
+0.32514,0.56621
+0.32810,0.59379
+0.32958,0.60955
+0.33697,0.62924
+0.34584,0.64632
+0.36062,0.66339
+0.37097,0.66995
+0.37097,0.66995
-- 
GitLab