(sec-module-robotics.mobile)= # Module: robotics.mobile The utilities contains functionality for mobile robots based on the EXUDYN example MecanumWheel RollingDiscPenality specific friction angle of rolling disc is used to model rolls of mecanum wheels - **Author**: Martin Sereinig, Peter Manzl and Johannes Gerstmayr - **Date**: 2021-10-01 Updated: 2023-09-15 - **Notes**: formulation is still under development (sec-mobile-mobilerobot2mbs)= ## Function: MobileRobot2MBS [`MobileRobot2MBS(mbs, mobileRobot, markerGround, flagGraphicsRollers = True, *args, **kwargs)`](https://github.com/jgerstmayr/EXUDYN/blob/master/python/exudyn/robotics/mobile.py#L36) - **function description**: add items to existing mbs to build up a mobile robot platform, there are options that can be passed as args / kwargs, which can contains options as described below. The robot platform is built out of rigid bodies where the wheels can be modeled as rolling discs (mecanum wheel x/o configuration) or with a detailed mecanum wheel simulation approach - **input**: - `mbs`: the multibody system which will be extended - `markerGround`: a rigid body marker, at which the robot will be placed (usually ground) - `mobileRobot`: a dictionary including all information about the mobile robot platform - **output**: the function returns a dictionary containing nodes, body, object and marker numbers of individual mobile robot parts nPlatformList, bPlatformList, oPlatformList, mPlatformList; nodes, bodies, objects and marker of the platform [nPlattform] [bPlattform] [oPlattform] [] oAxisList, mAxlesList; objects and marker of the axles [a1, a2, a3, a4] nWheelsList, bWheelsList, oRollingDiscsList, mWheelsList; nodes, bodys, objects and markers of the four wheels [w1, w2, w3, w4] - **notes**: for coordinate system, see Python function definition Relevant Examples (Ex) and TestModels (TM) with weblink to github: [`ROSMobileManipulator.py`](https://github.com/jgerstmayr/EXUDYN/blob/master/python/Examples/ROSMobileManipulator.py) (Ex) (sec-mobile-generatrix2polynomial)= ## Function: Generatrix2Polynomial [`Generatrix2Polynomial(param, GeneratrixFunction, tol = 1e-14, nFit = 101, nTest = 1001)`](https://github.com/jgerstmayr/EXUDYN/blob/master/python/exudyn/robotics/mobile.py#L415) - **function description**: create a polynomial describing a generatrix function - **input**: - `param`: list containing data (lRoll, aPoly, ...) - **author**: Peter Manzl - **notes**: create and fit a polynomial of an order high enough to approximate the given GeneratrixFunction with a given tolerance. The error is measured as the Chebyshev distance. (sec-mobile-generatrixroll)= ## Function: GeneratrixRoll [`GeneratrixRoll(u, param)`](https://github.com/jgerstmayr/EXUDYN/blob/master/python/exudyn/robotics/mobile.py#L485) - **function description**: generatrix function for a roll of a Mecanum wheel - **input**: - `u`: parameter, max. +- pi/2 param['r']: radius of the associated Mecanum wheel param['delta']: angle of the rolls rotation axis to the wheels rotation axis param['dRoll']: smallest distance of roll axis to the wheel axis - **output**: x and y values for the function in the local frame. The rotation around the local x-yxis creates the surface of the roll. - **author**: Peter Manzl - **notes**: parametric equation, x,y are the generatrix of the roll in its local frame with the axis of rotation x, see [Gfrerrer2008]. (sec-mobile-fundiffpoly)= ## Function: FunDiffPoly [`FunDiffPoly(x, a)`](https://github.com/jgerstmayr/EXUDYN/blob/master/python/exudyn/robotics/mobile.py#L507) - **function description**: calculates the derivative of the polynomial $a0*x^n + ... $ - **input**: - `x`: value at which the polynomial is evaluated - `a`: coefficients - **output**: f: - **author**: Peter Manzl - **notes**: helper function polynomial describing a generatrix function (sec-mobile-funddiffpoly)= ## Function: FunDDiffPoly [`FunDDiffPoly(x, a)`](https://github.com/jgerstmayr/EXUDYN/blob/master/python/exudyn/robotics/mobile.py#L527) - **function description**: calculates the second derivative of a polynomial - **input**: - `x`: value at which the polynomial is evaluated - `a`: coefficients - **output**: f: - **author**: Peter Manzl - **notes**: helper function polynomial describing a generatrix function (sec-mobile-mecanumxyphi2wheelvelocities)= ## Function: MecanumXYphi2WheelVelocities [`MecanumXYphi2WheelVelocities(xVel, yVel, angVel, R, Lx, Ly, wheeltype)`](https://github.com/jgerstmayr/EXUDYN/blob/master/python/exudyn/robotics/mobile.py#L553) - **function description**: DEPRECATED: the wheel velocities of a mecanum platform for the velocities [xVel, yVel, angVel]; use MobileKinematics Relevant Examples (Ex) and TestModels (TM) with weblink to github: [`mobileMecanumWheelRobotWithLidar.py`](https://github.com/jgerstmayr/EXUDYN/blob/master/python/Examples/mobileMecanumWheelRobotWithLidar.py) (Ex), [`laserScannerTest.py`](https://github.com/jgerstmayr/EXUDYN/blob/master/python/TestModels/laserScannerTest.py) (TM), [`mecanumWheelRollingDiscTest.py`](https://github.com/jgerstmayr/EXUDYN/blob/master/python/TestModels/mecanumWheelRollingDiscTest.py) (TM) (sec-mobile-mecanumwheelvelocity2xyphi)= ## Function: MecanumWheelVelocity2XYphi [`MecanumWheelVelocity2XYphi(w, R, Lx, Ly, wheeltype)`](https://github.com/jgerstmayr/EXUDYN/blob/master/python/exudyn/robotics/mobile.py#L578) - **function description**: DEPRECATED: the platform velocities [xVel, yVel, angVel] of a mecanum platform for the wheel velocities w; use MobileKinematics (sec-module-robotics.mobile-class-mobilekinematics)= ## CLASS MobileKinematics (in module robotics.mobile) **class description**: calculate 4 wheel velocities for a mecanum wheel driven platform with given platform velocities - **author**: Peter Manzl, Johannes Gerstmayr - **notes**: still under development; wheel axis is mounted at y-axis; positive angVel rotates CCW in x/y plane viewed from top; for coordinate system, see Python class definition (sec-mobile-mobilekinematics---init--)= ### Class function: __init__ [`__init__(self, R, lx, ly, flagAdjusted = False, lcx = 0, lcy = 0, wheeltype = 0)`](https://github.com/jgerstmayr/EXUDYN/blob/master/python/exudyn/robotics/mobile.py#L325) - **class function description**: initialize mobileKinematics class - **input**: - `R`: wheel radius - `lx`: wheel track width - `ly`: wheel base - `wheeltype`: 1=x-config (bad), 0=o-config (good) - **author**: Peter Manzl (sec-mobile-mobilekinematics-getwheelvelocities)= ### Class function: GetWheelVelocities [`GetWheelVelocities(self, vDes)`](https://github.com/jgerstmayr/EXUDYN/blob/master/python/exudyn/robotics/mobile.py#L361) - **class function description**: calculate wheel velocities from Cartesian velocities - **input**: - `vDes`: desired velocity [vx, vy, omega] in the robot's local frame - `vx`: platform translational velocity in local x direction - `vy`: platform translational velocity in local y direction - `omega`: platform rotational velocity around local z axis - **output**: w: wheel velocities w=[w0,w1,w2,w3] - **author**: Peter Manzl (sec-mobile-mobilekinematics-getcartesianvelocities)= ### Class function: GetCartesianVelocities [`GetCartesianVelocities(self, w)`](https://github.com/jgerstmayr/EXUDYN/blob/master/python/exudyn/robotics/mobile.py#L388) - **class function description**: calculate Cartesian velocities from wheel velocities - **input**: - `w`: wheel velocities w=[w0,w1,w2,w3] - **output**: v: Cartesian velocity [vx, vy, omega] in the robot's local frame vx: platform translational velocity in local x direction vy: platform translational velocity in local y direction omega: platform rotational velocity around local z axis - **author**: Peter Manzl Relevant Examples (Ex) and TestModels (TM) with weblink to github: [`ROSMobileManipulator.py`](https://github.com/jgerstmayr/EXUDYN/blob/master/python/Examples/ROSMobileManipulator.py) (Ex)