From 4977252456eb1c1a569aca3fdda34d0e3b99e4c9 Mon Sep 17 00:00:00 2001
From: m-guberina <gubi.guberina@gmail.com>
Date: Wed, 2 Oct 2024 15:35:40 +0200
Subject: [PATCH] small changes, hopefully fixed point_impedance_control, will
 verify soon

---
 Dockerfile                                    |   1 +
 docs/bash_cli_basics.md                       |  14 +++++++++++---
 docs/installing_ubuntu.md                     |   2 +-
 .../convenience_tool_box/frame_validation.py  |   2 +-
 .../convenience_tool_box/measuring_stick.py   |   2 +-
 .../planar_dragging_via_top_contact_force.py  |   1 -
 python/examples/point_impedance_control.py    |   6 +++---
 .../__pycache__/managers.cpython-312.pyc      | Bin 26575 -> 26575 bytes
 .../basics/__pycache__/basics.cpython-312.pyc | Bin 1657 -> 1657 bytes
 .../clik_point_to_point.cpython-312.pyc       | Bin 14530 -> 14413 bytes
 .../clik_trajectory_following.cpython-312.pyc | Bin 3739 -> 3739 bytes
 .../clik/clik_point_to_point.py               |   2 --
 .../calib_board_hacks.cpython-312.pyc         | Bin 14357 -> 14342 bytes
 .../__pycache__/draw_path.cpython-312.pyc     | Bin 3528 -> 3532 bytes
 .../__pycache__/get_model.cpython-312.pyc     | Bin 4144 -> 4144 bytes
 .../__pycache__/logging_utils.cpython-312.pyc | Bin 2237 -> 2225 bytes
 .../util/calib_board_hacks.py                 |   8 ++++----
 .../__pycache__/visualize.cpython-312.pyc     | Bin 9494 -> 9494 bytes
 18 files changed, 22 insertions(+), 16 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index 7d92c81..955ab22 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -10,6 +10,7 @@ RUN apt install -y python3  \
                 python3-pip \
                 python3-tk \
                 ipython3 \
+                git \
                 sudo \
                 vim \
                 vim-youcompleteme \
diff --git a/docs/bash_cli_basics.md b/docs/bash_cli_basics.md
index d45c95e..5b4d330 100644
--- a/docs/bash_cli_basics.md
+++ b/docs/bash_cli_basics.md
@@ -1,10 +1,18 @@
 ## most basic CLI commands
-1. sudo - run the actual command after it as administrator (need to ex. install stuff)
-2. apt - this is Ubuntu's package manager. It allows you to install nearly everything you'll ever need and manages (nearly) all installed programs in general. Note: on Linux you go to your package manager to install most things, you very rarely need to go to websites and download things (apt does all of it for you from Ubuntu's servers)
+1. sudo - run the actual command after it as administrator 
+   (need to ex. install stuff)
+2. apt - this is Ubuntu's package manager. 
+   It allows you to install nearly everything you'll ever need and manages (nearly) 
+   all installed programs in general. Note: on Linux you go to your package manager 
+   to install most things, you very rarely need to go to websites and download things 
+   (apt does all of it for you from Ubuntu's servers)
 3. apt update - update your machine to programs (also called packages) from Ubuntu's serves
 4. apt install [package_name] - installs [package_name]
 5. ls - list stuff in a folder (also known as directory)
-6. cd - change directory (i.e. change folder). Sometimes you need to run commands from specific folders (you need to pass a file as input for example). It's like clicking on folders' icons, but in the terminal
+6. cd - change directory (i.e. change folder). 
+   Sometimes you need to run commands from specific folders 
+   (you need to pass a file as input for example). 
+   It's like clicking on folders' icons, but in the terminal
 7. python [python_scripy.py] - run a python script
 8. man [command] - open manual for command [command]
 9. [command] --help - get the help text for command [command]
diff --git a/docs/installing_ubuntu.md b/docs/installing_ubuntu.md
index 50489a7..2a94884 100644
--- a/docs/installing_ubuntu.md
+++ b/docs/installing_ubuntu.md
@@ -97,7 +97,7 @@ which will help you avoid headaches in the future.
 #### option 2) Native installation
 1. Either create a disk partition for Ubuntu on your hard drive, or use an external hard drive. In the first case, you might need to shrink your existing partition. Searching for "how to create a disk partition [your_OS]" or "install ubuntu on [your_OS]" will get you all the information you need. Ideally, back up your data before any of this (you should be doing this in general as it's good practice).
 2. Download an Ubuntu 22 LTH iso (file which contains everything needed for installation), available at official Ubuntu websites
-3. Create a bootable USB. In short, you can't just copy an iso file to a USB and boot from it. Just google how to do it on your OS.
+3. Create a bootable USB. In short, you can't just copy an iso file to a USB and boot from it. Just google how to do it on your OS (use rufus if on windows).
 4. Enter BIOS to ensure you can boot from your USB. Ideally this step should just be to enable Boot menu, but this step is dependent to a specific computer. Any reasonable Ubuntu (or any Linux) installation guide should have detailed steps, but also consult your laptop manufacturer websites for BIOS steps if the steps won't be obvious/easy to follow.
 5. Boot from the Ubuntu USB and install it to the partition/external disk from step 1. MAKE SURE you are installing to the right partition. To select the partition, select the "Advanced installation" option (selecting the partition is the only advanced thing you need). Otherwise just follow the installation instructions you get once you boot into the USB, they are quite well done.
 
diff --git a/python/convenience_tool_box/frame_validation.py b/python/convenience_tool_box/frame_validation.py
index b7bb55d..df3b100 100644
--- a/python/convenience_tool_box/frame_validation.py
+++ b/python/convenience_tool_box/frame_validation.py
@@ -26,7 +26,7 @@ for i in range(5000):
     current = robot.rtde_receive.getActualCurrent()
     q.append(0.0)
     q.append(0.0)
-    pinMtool = robot.getMtool()
+    pinMtool = robot.getT_w_e()
     
     if i % 25 == 0:
         print("ur5:", *np.array(robot.rtde_receive.getActualTCPPose()).round(4))
diff --git a/python/convenience_tool_box/measuring_stick.py b/python/convenience_tool_box/measuring_stick.py
index c410bf2..ede2b40 100644
--- a/python/convenience_tool_box/measuring_stick.py
+++ b/python/convenience_tool_box/measuring_stick.py
@@ -26,7 +26,7 @@ signal.signal(signal.SIGINT, handler)
 
 
 while True:
-    Mtool = robot.getMtool() 
+    Mtool = robot.getT_w_e() 
     print(Mtool)
     print("pin:", *Mtool.translation.round(4), *pin.rpy.matrixToRpy(Mtool.rotation).round(4))
     print("ur5:", *np.array(robot.rtde_receive.getActualTCPPose()).round(4))
diff --git a/python/examples/planar_dragging_via_top_contact_force.py b/python/examples/planar_dragging_via_top_contact_force.py
index 9724481..8e7a824 100644
--- a/python/examples/planar_dragging_via_top_contact_force.py
+++ b/python/examples/planar_dragging_via_top_contact_force.py
@@ -179,7 +179,6 @@ def controlLoopPlanarDragging(dmp, tc, controller, robot, i, past_data):
     # rolling average
     if i % 100 == 0:
         print(wrench)
-    pin.forwardKinematics(robot.model, robot.data, q)
     J = pin.computeJointJacobian(robot.model, robot.data, q, robot.JOINT_ID)
     dq = robot.getQd()[:6].reshape((6,1))
     # get joitn 
diff --git a/python/examples/point_impedance_control.py b/python/examples/point_impedance_control.py
index 10d5de6..58ac4d7 100644
--- a/python/examples/point_impedance_control.py
+++ b/python/examples/point_impedance_control.py
@@ -169,7 +169,7 @@ def controlLoopPointImpedance(q_init, controller, robot : RobotManager, i, past_
     save_past_dict = {}
     log_item = {}
     q = robot.getQ()
-    Mtool = robot.getMtool()
+    Mtool = robot.getT_w_e()
     wrench = robot.getWrench()
     log_item['wrench_raw'] = wrench.reshape((6,))
     # deepcopy for good coding practise (and correctness here)
@@ -229,7 +229,7 @@ def controlLoopCartesianPointImpedance(Mtool_init, clik_controller, robot, i, pa
     save_past_dict = {}
     log_item = {}
     q = robot.getQ()
-    Mtool = robot.getMtool()
+    Mtool = robot.getT_w_e()
     wrench = robot.getWrench()
     log_item['wrench_raw'] = wrench.reshape((6,))
     save_past_dict['wrench'] = copy.deepcopy(wrench)
@@ -307,7 +307,7 @@ if __name__ == "__main__":
             'wrench_used' : np.zeros(6),
         }
     q_init = robot.getQ()
-    Mtool_init = robot.getMtool()
+    Mtool_init = robot.getT_w_e()
 
     if not args.cartesian_space_impedance:
         controlLoop = partial(controlLoopPointImpedance, q_init, controller, robot)
diff --git a/python/ur_simple_control/__pycache__/managers.cpython-312.pyc b/python/ur_simple_control/__pycache__/managers.cpython-312.pyc
index bbcd15e78148acd5a796424e5d1111dd7a2a731e..b114db404caacd1a1e229e1b371bca3af042ebdc 100644
GIT binary patch
delta 22
ecmX?qp7H#7M()$Ryj%<n3=D5?|JulXBpm=`stDo$

delta 22
ecmX?qp7H#7M()$Ryj%<n3=E%lzuU-tBpm=_*a*A;

diff --git a/python/ur_simple_control/basics/__pycache__/basics.cpython-312.pyc b/python/ur_simple_control/basics/__pycache__/basics.cpython-312.pyc
index 5fa0086f49e4281f9eeaeae9db7e5d7d99c70bcf..03f3f9a372b4970f16339d4e5aedf8edfc824b6a 100644
GIT binary patch
delta 20
ccmey#^OJ}BG%qg~0|NuY+uOf3a_6xD07+~H_W%F@

delta 20
bcmey#^OJ}BG%qg~0|NsC_XN?6+<9yOJp%;g

diff --git a/python/ur_simple_control/clik/__pycache__/clik_point_to_point.cpython-312.pyc b/python/ur_simple_control/clik/__pycache__/clik_point_to_point.cpython-312.pyc
index 8ae2b48b1fa2da019eb463d43cf61b3ecfed7067..a300f6887915c8835819f530df29d28673262313 100644
GIT binary patch
delta 560
zcmX?9c(#D=G%qg~0|Ns?lHK35^Y$D0eyTBsP3BNHWT|1yVxD}SRhpHfhB1p3#A4<w
zVVgXWS!VJ?b&<*W8r+ka6-7C+nHU&~L`&Ewdl}12ext(0Qp;H)IQfr}%;bCx(aAz`
zA{?AmtPBh(EH#q@Bt$1~)sSU`sC}=&KiNn_c(S0TIGDE96rWrqA<R|7S;fM@P|I1u
zK3PCThO>kn<T?fhhRF*wL?^G*RArQ(d{Iku@*@f1$rFq@SZaAnlqdIU%1oBm;-0)j
zQkbQd7vV~l8s626lW%LvFlA{?=GPDxWJ=+xWhqgH8p)8Q12T(I4@6F$q$SK&!(PLf
zWi<J}mORKUOc0ZpvP>rjYJ*)T0CF4LNeo$LlLNIyn6fM;FVvQ11d$RvtC=9C*Dz#R
zO@63t2r`Hd>M4O5{u+iXo5_u`!js)}_!#ZMtPCAKMn{kn81*JkloV!kn!Hd)ozZpj
zc~&W=EOZI^$$GjRjE<8HnS>{M>55=zl%Kppw~|@8$aS)XUW1Ao0|P^mABgY=5%M4+
z5JUul2oDh9Ir*&K9mbl;tMug=Z)|>|e}k1Vbn{-*1|}XoM*S5wpBeNR^*_W-_Oz%3
E03$Y&;{X5v

delta 606
zcmX?GaHx>)G%qg~0|Ntt+{Sllx(*xpeyTC9narVXI9XGId-59@5k|(zjIyGPjFTsd
zi%!;&<zZ&b;+{OwNO*F9Iu9c+m{p+8#mxsY1B9~#CQp<UW)z;>C@Va9jXKZdAPM2g
z{#vZuq9yzwc@Um_QA1?%dv#t$$;kpLGLu)UbF;9eFxyOCAR)<9!&$}3z>vaH!;mF2
z*;hlK6IItt4Sq&Bu-SVw#GtHa8e)?lNr+4q(Bxp`pL{_@hN*;q@>)%q$-$bcjOvpW
zbwnp?XbDf2m*C{(DPaaV0EDx&z{Z@?<eHqKCCpdLTY}vWGFm*7tF(lfvJ58MYRPgV
z^c#UqW|9R3(L`}kR`wdkEE8~m?9t+x{76EW2g5{jkd@4QHGGpFN{9$lu`n<o0wv1=
zBAI11*^o(ia-22?BZO6@Ex>3qxm(*1?8yt-JdAcAm6Jbc^D#PtSp58}89_c`U|?jZ
zVb5}gx=WZT%Vn~+jyj_|*ijE8IT+ET<T-h47#J98IJ2B5Kh#mjke(c*Tgj+0`LvwW
z<V(6WlY{jnCzt8nV4ODDUtfOm6lv+r`T93l8N)Ywm^Lu+7%=Luu=&hjz^MNrY4R2G
FN&quAlVkt@

diff --git a/python/ur_simple_control/clik/__pycache__/clik_trajectory_following.cpython-312.pyc b/python/ur_simple_control/clik/__pycache__/clik_trajectory_following.cpython-312.pyc
index 4239e1bd51ab18db826e0888d6072ac43e223e4d..d900eed3d1c0b5d9a5e328f65abf299bf57f1759 100644
GIT binary patch
delta 20
ccmbO&J6o3fG%qg~0|NuY+uOf3a!=p`06r)NhX4Qo

delta 20
ccmbO&J6o3fG%qg~0|Ntt_QrP`xhL=e05_rqj{pDw

diff --git a/python/ur_simple_control/clik/clik_point_to_point.py b/python/ur_simple_control/clik/clik_point_to_point.py
index 9f43931..838a917 100644
--- a/python/ur_simple_control/clik/clik_point_to_point.py
+++ b/python/ur_simple_control/clik/clik_point_to_point.py
@@ -288,8 +288,6 @@ def controlLoopCompliantClik(args, robot : RobotManager, i, past_data):
     save_past_dict = {}
     # know where you are, i.e. do forward kinematics
     q = robot.getQ()
-    pin.forwardKinematics(robot.model, robot.data, q)
-    # this has forward kinematics in it
     T_w_e = robot.getT_w_e()
     wrench = robot.getWrench()
     # we need to overcome noise if we want to converge
diff --git a/python/ur_simple_control/util/__pycache__/calib_board_hacks.cpython-312.pyc b/python/ur_simple_control/util/__pycache__/calib_board_hacks.cpython-312.pyc
index 7b4b291aa60caab7194c0c5f1e450a8f939c1e4f..f3cb936ccba20349b062a79f7f3ea0bac9108256 100644
GIT binary patch
delta 121
zcmbPQ&{n{GnwOW0fq{YHi{0Oi+?s5RQIk#C5+rZ)ighsF;o$Aao?$qn?xM8rRSvxm
z%nW?ulQ*-?k-9A?)!}%DM{t7f0>KNa78eyQuJTxZU}g}K-kitYp}`swUml;j`L}))
cBV+00FvFEh{c)SwjBYV8G4O4EWMa$=0B`pw0ssI2

delta 136
zcmZoGm|DPnnwOW0fq{WxLyOo(ZcR4El*y)S334}h#Xd1Gvg&s*-r?Zw$ev+1qwb=#
z?o|%G56q0L`jgkO&5^$$DD{bfk<+Tf@eYsR1l<LK7gQ}SDq39SvHZZy$Z54Xg}p<A
r)wd)+KWFnt{U}Dps>wcvE7`l_J~QaE%545_c#DZipLO$P6JuroLP{(7

diff --git a/python/ur_simple_control/util/__pycache__/draw_path.cpython-312.pyc b/python/ur_simple_control/util/__pycache__/draw_path.cpython-312.pyc
index 0dd487ca465ce8e1c0086017be6f1b5e777f2293..71e35875b7d8a6176729a24085e21d5e5618c2b2 100644
GIT binary patch
delta 65
zcmX>heMXx5G%qg~0|NuY+uOf3axY?4H(+33Xkd6EA~xM)qQ}P6%W}3GQ#S}M5L{rm
XP-H>j3c-aXi+DDqUfg_v^#?lu;g=ZG

delta 61
zcmX>jeL|Z1G%qg~0|Ntt%2CFR+>2P1br={J8W^64h)wsH=&>R7nw;$h!3BZ~3>S(l
TC|n`9uw)U>rOj7Zf3O1pCD|0u

diff --git a/python/ur_simple_control/util/__pycache__/get_model.cpython-312.pyc b/python/ur_simple_control/util/__pycache__/get_model.cpython-312.pyc
index f71d31d1b099ad31d391d763413e725c2b8b077c..4f3cd82c660184ddd923df726a18a1539e1dba3b 100644
GIT binary patch
delta 21
dcmdm>ut9<6G%qg~0|NuY+uOg=Hu9(l002l!2DJbH

delta 21
dcmdm>ut9<6G%qg~0|NuY<a_^8H}a?m002d!24MgI

diff --git a/python/ur_simple_control/util/__pycache__/logging_utils.cpython-312.pyc b/python/ur_simple_control/util/__pycache__/logging_utils.cpython-312.pyc
index a5640ca76c535f04142b1d71d8fbba1556478f46..1557c6d021d3fe0b591b7bf92ae68a47a0777933 100644
GIT binary patch
delta 128
zcmdlhxKWVjG%qg~0|NuY+uOg=Hu5ZF=3L0Yz|g?(m|uMIZe~el1_6o1*O{3(r=W{Y
zW@M8#ykg>YS=9TYiPwt435hebC+4pZyey`5!NjYB>w>8F7d8fA(dlXv)n-Ut7E<Y8
Vzb!01*`G~}nL$Kma|T-|69A6%CJX=o

delta 179
zcmdlexL1(pG%qg~0|NuYzJLExH}WiG=3B<Vz|g?(fM5I*10$=&<lC&0%#5rSi!U)V
z@y*7N%3@@-_`t!yA$~zp?-IM-4KdXVnsyh(>^ivbm{{)6zii@lP1Jiu;e^B)+7t6v
z2woP`x*+P^!F55@`wJU`u;_HPiE1;XE(@u2u-_1t{=~q@Y1ZL<Lq=sm@J!zoS{G$Z
VJ3J-?clmx`X5=*69K#mM1ORErIl2G<

diff --git a/python/ur_simple_control/util/calib_board_hacks.py b/python/ur_simple_control/util/calib_board_hacks.py
index f1f5e2a..63bce31 100644
--- a/python/ur_simple_control/util/calib_board_hacks.py
+++ b/python/ur_simple_control/util/calib_board_hacks.py
@@ -219,7 +219,7 @@ def calibratePlane(args, robot, plane_width, plane_height, n_tests):
     handleUserToHandleTCPPose(robot)
     q_init = copy.deepcopy(robot.getQ())
     # GET TCP
-    Mtool = robot.getMtool()
+    Mtool = robot.getT_w_e()
 
     init_pose = copy.deepcopy(Mtool)
     new_pose = copy.deepcopy(init_pose)
@@ -259,7 +259,7 @@ def calibratePlane(args, robot, plane_width, plane_height, n_tests):
 
         positions.append(copy.deepcopy(robot.data.oMi[robot.JOINT_ID].translation))
         if i < n_tests -1:
-            current_pose = robot.getMtool()
+            current_pose = robot.getT_w_e()
             new_pose = copy.deepcopy(current_pose)
             # go back up (assuming top-left is highest incline)
             # TODO: make this assumption an argument, or print it at least
@@ -296,7 +296,7 @@ def calibratePlane(args, robot, plane_width, plane_height, n_tests):
 
     print("finished estimating R")
 
-    current_pose = robot.getMtool()
+    current_pose = robot.getT_w_e()
     new_pose = copy.deepcopy(current_pose)
     # go back up
     # Z
@@ -332,7 +332,7 @@ def calibratePlane(args, robot, plane_width, plane_height, n_tests):
     # TODO: get rid of all movels, just your own stuff,
     # or at least shove them avait to the RobotManager
     # and now go back up
-    current_pose = robot.getMtool()
+    current_pose = robot.getT_w_e()
     new_pose = copy.deepcopy(current_pose)
     new_pose.translation[2] = init_pose.translation[2]
     moveL(args, robot, new_pose)
diff --git a/python/ur_simple_control/visualize/__pycache__/visualize.cpython-312.pyc b/python/ur_simple_control/visualize/__pycache__/visualize.cpython-312.pyc
index 82688cdec6204a4d6ea856a59f397797cb95e1e8..8a1adf2f8db4ef94087d08a06981bcfb331508e7 100644
GIT binary patch
delta 20
ccmbQ{HO-6rG%qg~0|NuY+uOf3a&xN!07A<KX#fBK

delta 20
bcmbQ{HO-6rG%qg~0|Ns?Z}q#4+}x@FJ+B3w

-- 
GitLab