\n \n

\n\nThe topological information of a robot is to be specified by using its robot-topology matrix, as defined [here](./misc/Robot_Topology_Matrix.md). For a planar 2R serial manipulator (as shown in the above figure), the robot topology matrix is given by\n\n$$\\left[\\begin{matrix}\n9 & 1 & 0 \\\\\\\\\n1 & 9 & 1 \\\\\\\\\n0 & 1 & 9\n\\end{matrix}\\right]$$\n\nThe corresponding Jacobian function can be formulated as follows.\n\nFirstly, the required functions are imported as shown below.\n```py\nfrom acrod.jacobian import Jacobian\nfrom numpy import array\n```\n\n\nThe robot-topology matrix for 3R planar serial manipulator is defined and jacobian information is processed via the imported jacobian class as follows.\n```py\nM = array(\n [[9, 1, 0],\n [1, 9, 1],\n [0, 1, 9]]\n )\njac = Jacobian(M, robot_type = 'planar')\n```\n\n\nJacobian function is generated as shown below.\n```py\njacobian_function = jac.get_jacobian_function()\n```\n\n\nIn the process of generating the above jacobian function, other attributes of the jacobian object also are updated. Symbolic Jacobian matrices can be extracted from the attributes. Since this is a serial robot, the matrix $J_a$ itself would be the Jacobian matrix of the manipulator. The matrix $J_a$ is extracted from `Ja` attribute of the jacobian object as follows.\n```py\nsymbolic_jacobian = jac.Ja\nsymbolic_jacobian\n```\n\nIn an ipynb file of JupyterLab, the above code would produce the following output.\n\n$$\\left[\\begin{matrix}- a\\_{y} + r\\_{(1,2)y} & - a\\_{y} + r\\_{(2,3)y} \\\\\\\\ a\\_{x} - r\\_{(1,2)x} & a\\_{x} - r\\_{(2,3)x} \\\\\\\\ 1 & 1\\end{matrix}\\right]$$\n\nThe above Jacobian is based on the notations defined and described [here](./misc/Notation_and_Nomenclature.md).\n\nActive joint velocities, in the corresponding order, can be viewed by running the following lines.\n```py\nactive_joint_velocities = jac.active_joint_velocities_symbolic\nactive_joint_velocities\n```\n\nIn an ipynb file of JupyterLab, the above code would produce the following output.\n\n$$\\left[\\begin{matrix}\\dot{\\theta}\\_{(1,2)} \\\\\\\\ \\dot{\\theta}\\_{(2,3)}\\end{matrix}\\right]$$\n\nRobot dimensional parameters can be viewed by running the below line.\n```py\nrobot_dimensional_parameters = jac.parameters_symbolic\nrobot_dimensional_parameters\n```\n\nIn an ipynb file of JupyterLab, the above code would produce the following output.\n\n$$\\left[\\begin{matrix}r_{(1,2)x} \\\\\\\\ r_{(1,2)y} \\\\\\\\ r_{(2,3)x} \\\\\\\\ r_{(2,3)y}\\end{matrix}\\right]$$\n\n\nRobot end-effector parameters can be viewed by running the below line.\n```py\nrobot_endeffector_parameters = jac.endeffector_variables_symbolic\nrobot_endeffector_parameters\n```\n\nIn an ipynb file of JupyterLab, the above code would produce the following output.\n\n$$\\left[\\begin{matrix}a_{x} \\\\\\\\ a_{y}\\end{matrix}\\right]$$\n\n#### Sample computation of Jacobian for the configuration corresponding to the parameters shown below:\n\n- End-effector point: $\\textbf{a}=\\hat{i}+2\\hat{j}$\n- Locations of joints: $\\textbf{r}\\_{(1,2)}=3\\hat{i}+4\\hat{j}$ and $\\textbf{r}\\_{(2,3)}=5\\hat{i}+6\\hat{j}$\n\nFor the given set of dimensional parameters of the robot, the numerical Jacobian can be computed as follows. Firstly, we need to gather the configuration parameters in Python list format, in a particular order. The robot dimensional parameters from `jac.parameters_symbolic` are found (as shown earlier) to be in the order of $r_{(1,2)x}$, $r_{(1,2)y}$, $r_{(2,3)x}$ and $r_{(2,3)y}$. Hence the configuration parameters are to be supplied in the same order, as a list. Thus, the computation can be performed as shown below.\n```py\nend_effector_point = [1,2]\nconfiguration_parameters = [3,4,5,6]\njacobian_at_the_given_configuration = jacobian_function(end_effector_point, configuration_parameters)\njacobian_at_the_given_configuration\n```\n\nThe output produced by running the above code, is shown below.\n```py\narray([[ 2, 4],\n [-2, -4],\n [ 1, 1]])\n```\n\nMathematical concepts behind formulating the Jacobian can be found [here](./misc/Mathematics_behind_Jacobian_formulation.md).\n\n#### Dimensional Synthesis\n\nFor dimensional synthesis, at least a performance parameter is required. One commonly used performance parameter in dimensional synthesis is the condition number. From the above Jacobian function, the condition number can be found by computing the ratio of maximum singular value and minimum singular value. This condition number has the bounds $(1,\\infty)$. When the condition number is 1, that signifies the best performance in the context of condition number. The computation of condition number from a given Jacobian can be achieved by the code shown below:\n\n```py\nfrom numpy.linalg import svd\n\ndef condition_number_func(jacobian_matrix):\n _, singular_values, _ = svd(jacobian_matrix)\n condition_number = singular_values.max()/singular_values.min()\n return condition_number\n```\n\nFor reference if we take the joint at the fixed link to be at the origin, the dimensional synthesis for optimal performance around the end-effector point $\\textbf{a}=\\hat{i}+2\\hat{j}$ can be performed by the code shown below:\n\n```py\nfrom scipy.optimize import minimize\nfrom numpy import hstack, ones\n\nend_effector_point = [1,2]\nbase_reference_point = [0,0]\nr12 = base_reference_point\njac_fun = lambda y: jacobian_function(end_effector_point, hstack((base_reference_point,y)))\ncondition_number = lambda z: condition_number_func(jac_fun(z))\ninitial_guess = ones(len(jac.parameters)-len(base_reference_point))\nres = minimize(condition_number, initial_guess)\nr23 = res.x\n```\n\nThe link lengths $l_2$ and $l_3$ are given by $l_2 = \\lVert \\textbf{r}\\_{12}-\\textbf{r}\\_{23} \\rVert$ and $l_3 = \\lVert\\textbf{r}\\_{23}-\\textbf{a}\\rVert$. By using the code below, the link lengths of 2R robot can be computed.\n\n```py\nfrom numpy.linalg import norm\n\nl2 = norm(r23-r12)\nl3 = norm(r23-end_effector_point)\nprint(l2,l3,res.fun)\n```\nOutput:\n```py\n3.4641016153289317 2.236067976155377 1.0000000007904777\n```\nThe above output shows that for $l_2=3.464$ and $l_3=2.236$, the robot has the condition number approximately equal to $1.0$, which signifies optimal performance.\n\n## Examples\n\nSome examples (along with their mathematical derivations) can be found [here](./examples/Jacobian).\n\n## Full Documentation\n\nFor full documentation, visit the documentation page [here](https://acrod.readthedocs.io/en/latest/).\n\n## Community Guidelines\n\n- For contribution to the software:\n - In order to contribute to the software, please consider using the [pull request feature](https://github.com/suneeshjacob/ACRoD/pulls) of GitHub.\n- For reporting issues with the software:\n - For reporting issues or problems, please use [issues](https://github.com/suneeshjacob/ACRoD/issues).\n- For support:\n - For any further support (including installation, usage, etc.), feel free to contact via suneeshjacob-at-gmail-dot-com.\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "dynamic": null, "home_page": "", "keywords": "jacobian,robotics,kinematics", "license": "GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc.