robotics-toolbox-matlab
robotics-toolbox-matlab copied to clipboard
SerialLink.double and Link.double
Link.double converts link parameters to numeric (double) type
dl = l.double is a Link object in which all the parameters are numeric ('double') type.
Useful when you are using Pi=sym('pi') to avoid round off errors (e.g in sin(Pi/2)), but later you want to pass the link object to a method (e.g. ikine) which only supports real numbers.
Will give an error if a symbolic variable is not convertible to double number.
See also SerialLink.double
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SerialLink.double converts SerialLink object parameters to numeric (double) type
dr = r.double is a SerialLink object in which all the parameters are numeric ('double') type.
Useful when you are using Pi=sym('pi') to avoid round off errors (e.g in sin(Pi/2)), but later you want to pass the SerialLink object to a method (e.g. ikine) which only supports real numbers.
Will give an error if a symbolic variable is not convertible to double number.
See also Link.double
Author: Amin Yahyaabadi ([email protected])
@petercorke I added two methods to Link and Serial Link which convert the parameters of both object to double.
I'm not sure double() is the right name for this. Generally double() converts some representation to a native vector/matrix representation. Perhaps simplify() or symeval() or something.
I'm not sure double() is the right name for this. Generally double() converts some representation to a native vector/matrix representation. Perhaps simplify() or symeval() or something.
From Matlab document: double(s)
converts symbolic values to MATLAB double precision. It is part of the symbolic toolbox.
But as you said double()
is also the name for another function that just converts other numeric types to double type. double
simplify
is different from the double
function. double
function converts numbers that are defined as symbolic to double. Such as sym(
pi)