OpTaS  1.0.7
An optimization-based task specification library for trajectory optimization and model predictive control.
Public Member Functions | Public Attributes | List of all members
optas.models.RobotModel Class Reference

A class that defines a robot model. More...

Inheritance diagram for optas.models.RobotModel:
Inheritance graph
[legend]
Collaboration diagram for optas.models.RobotModel:
Collaboration graph
[legend]

Public Member Functions

def __init__ (self, Union[None, str] urdf_filename=None, Union[None, str] urdf_string=None, Union[None, str] xacro_filename=None, Union[None, str] name=None, List[int] time_derivs=[0], Union[None, ArrayType] qddlim=None, Union[None, int] T=None, List[str] param_joints=[])
 Initializer for the robot model class. More...
 
def get_urdf (self)
 
def get_urdf_dirname (self)
 
List[str] joint_names (self)
 Property that gives the list of joint names. More...
 
List[str] link_names (self)
 Property that gives the list of link names. More...
 
List[str] actuated_joint_names (self)
 Property that gives the names of the actuated joints. More...
 
List[str] parameter_joint_names (self)
 Property that gives the names of the parameterized joints. More...
 
List[int] optimized_joint_indexes (self)
 Property that gives the indexes of the optimized joints. More...
 
List[str] optimized_joint_names (self)
 Property that gives the names of the optimized joints names. More...
 
List[int] parameter_joint_indexes (self)
 Property that gives the indexes of the parameterized joints. More...
 
ArrayType extract_parameter_dimensions (self, ArrayType values)
 Return the elements that correspond to the model dimensions. More...
 
ArrayType extract_optimized_dimensions (self, ArrayType values)
 Return the elements that correspond to the model optimized dimensions. More...
 
int ndof (self)
 Number of degrees of freedom. More...
 
int num_opt_joints (self)
 Number of optimized joints. More...
 
int num_param_joints (self)
 Number of parameterized joints. More...
 
float get_joint_lower_limit (self, Joint joint)
 Return the lower limit for a given joint. More...
 
float get_joint_upper_limit (self, Joint joint)
 Return the upper limit for a given joint. More...
 
float get_velocity_joint_limit (self, Joint joint)
 Return the velocity limit for a given joint. More...
 
cs.DM lower_actuated_joint_limits (self)
 Property that defines the lower actuated joint limits. More...
 
cs.DM upper_actuated_joint_limits (self)
 Property that defines the upper actuated joint limits. More...
 
cs.DM velocity_actuated_joint_limits (self)
 Property that defines the velocity actuated joint limits. More...
 
cs.DM lower_optimized_joint_limits (self)
 Property that defines the lower optimized joint limits. More...
 
cs.DM upper_optimized_joint_limits (self)
 Property that defines the upper optimized joint limits. More...
 
cs.DM velocity_optimized_joint_limits (self)
 Property that defines the velocity limits for the optimized joints. More...
 
None add_base_frame (self, str base_link, Union[None, List[float]] xyz=None, Union[None, List[float]] rpy=None, str joint_name=None)
 Add new base frame, note this changes the root link. More...
 
str get_root_link (self)
 The root link name. More...
 
Tuple[cs.DM] get_link_visual_origin (self, Link link)
 Get the link position and orientation for the link visual. More...
 
Tuple[cs.DM] get_joint_origin (self, Joint joint)
 Get the origin for the joint. More...
 
cs.DM get_joint_axis (self, Joint joint)
 Get the axis of a joint. More...
 
int get_actuated_joint_index (self, str joint_name)
 Get the joint index for a given joint name. More...
 
cs.DM get_random_joint_positions (self, int n=1, Union[None, Tuple[ArrayType]] xlim=None, Union[None, Tuple[ArrayType]] ylim=None, Union[None, Tuple[ArrayType]] zlim=None, Union[None, str] base_link=None)
 Random joint positions within actuator limits and optionally within a box for a given base link. More...
 
cs.DM get_random_pose_in_global_link (self, str link_name)
 
def make_function (self, str label, str link, Callable method, int n=1, Union[None, str] base_link=None, Union[None, cs.DM] axis=None, numpy_output=False)
 Automate function generation. More...
 
CasADiArrayType get_global_link_transform (self, str link, ArrayType q)
 Get the link transform in the global frame for a given joint state q. More...
 
cs.Function get_global_link_transform_function (self, str link, int n=1, bool numpy_output=False)
 Get the function which computes the link transform in the global frame. More...
 
CasADiArrayType get_link_transform (self, str link, ArrayType q, str base_link)
 Get the link transform in a given base frame. More...
 
CasADiArrayType get_link_transform_function (self, str link, str base_link, int n=1, bool numpy_output=False)
 Get the function that computes the transform in a given base frame. More...
 
CasADiArrayType get_global_link_position (self, str link, ArrayType q)
 Get the link position in the global frame for a given joint state q. More...
 
cs.Function get_global_link_position_function (self, str link, int n=1, bool numpy_output=False)
 Get the function that computes the global position of a given link. More...
 
CasADiArrayType get_link_position (self, str link, ArrayType q, str base_link)
 Get the link position in a given base frame. More...
 
cs.Function get_link_position_function (self, str link, str base_link, int n=1, bool numpy_output=False)
 Get the function that computes the position of a link in a given base frame. More...
 
CasADiArrayType get_global_link_rotation (self, str link, ArrayType q)
 Get the link rotation in the global frame for a given joint state q. More...
 
cs.Function get_global_link_rotation_function (self, str link, int n=1, bool numpy_output=False)
 Get the function that computes a rotation matrix in the global link. More...
 
CasADiArrayType get_link_rotation (self, str link, ArrayType q, str base_link)
 Get the rotation matrix for a link in a given base frame. More...
 
cs.Function get_link_rotation_function (self, str link, str base_link, int n=1, bool numpy_output=False)
 Get the function that computes the rotation matrix for a link in a given base frame. More...
 
CasADiArrayType get_global_link_quaternion (self, str link, ArrayType q)
 Get a quaternion in the global frame. More...
 
cs.Function get_global_link_quaternion_function (self, str link, int n=1, bool numpy_output=False)
 Get the function that computes a quaternion in the global frame. More...
 
CasADiArrayType get_link_quaternion (self, str link, ArrayType q, str base_link)
 Get the quaternion defined in a given base frame. More...
 
cs.Function get_link_quaternion_function (self, str link, str base_link, int n=1, bool numpy_output=False)
 Get the function that computes a quaternion defined in a given base frame. More...
 
CasADiArrayType get_global_link_rpy (self, str link, ArrayType q)
 Get the Roll-Pitch-Yaw angles in the global frame. More...
 
def get_global_link_rpy_function (self, str link, int n=1, bool numpy_output=False)
 Get the function that computes the Roll-Pitch-Yaw angles in the global frame. More...
 
CasADiArrayType get_link_rpy (self, str link, ArrayType q, str base_link)
 Get the the Roll-Pitch-Yaw angles defined in a given base frame. More...
 
cs.Function get_link_rpy_function (self, str link, str base_link, int n=1, bool numpy_output=False)
 Get the function that computes the Roll-Pitch-Yaw angles defined in a given base frame. More...
 
CasADiArrayType get_global_link_geometric_jacobian (self, str link, ArrayType q)
 Compute the geometric Jacobian matrix in the global frame. More...
 
cs.Function get_global_link_geometric_jacobian_function (self, str link, int n=1, bool numpy_output=False)
 Get the function that computes the geometric jacobian in the global frame. More...
 
CasADiArrayType get_global_link_analytical_jacobian (self, str link, ArrayType q)
 Compute the analytical Jacobian matrix in the global frame. More...
 
cs.Function get_global_link_analytical_jacobian_function (self, str link, int n=1, bool numpy_output=False)
 Get the function that computes the analytical jacobian in the global frame. More...
 
CasADiArrayType get_link_geometric_jacobian (self, str link, ArrayType q, str base_link)
 Get the geometric jacobian in a given base link. More...
 
cs.Function get_link_geometric_jacobian_function (self, str link, str base_link, int n=1, bool numpy_output=False)
 
CasADiArrayType get_link_analytical_jacobian (self, str link, ArrayType q, str base_link)
 Compute the analytical Jacobian matrix in a given base link. More...
 
cs.Function get_link_analytical_jacobian_function (self, str link, str base_link, int n=1, bool numpy_output=False)
 Get the function that computes the analytical jacobian in a given base frame. More...
 
CasADiArrayType get_global_link_linear_jacobian (self, str link, ArrayType q)
 Compute the linear part of the geometric jacobian in the global frame. More...
 
cs.Function get_global_link_linear_jacobian_function (self, str link, int n=1, bool numpy_output=False)
 Get the function that computes the linear part of the geometric jacobian in the global frame. More...
 
CasADiArrayType get_link_linear_jacobian (self, str link, ArrayType q, str base_link)
 Get the linear part of the geometric jacobian in a given base frame. More...
 
cs.Function get_link_linear_jacobian_function (self, str link, str base_link, int n=1, bool numpy_output=False)
 Get the function that computes the linear part of the geometric jacobian in a given base frame. More...
 
CasADiArrayType get_global_link_angular_geometric_jacobian (self, str link, ArrayType q)
 Compute the angular part of the geometric jacobian in the global frame. More...
 
cs.Function get_global_link_angular_geometric_jacobian_function (self, str link, int n=1, bool numpy_output=False)
 Get the function that computes the angular part of the geometric jacobian in the global frame. More...
 
CasADiArrayType get_global_link_angular_analytical_jacobian (self, str link, ArrayType q)
 Compute the angular part of the analytical Jacobian matrix in the global frame. More...
 
cs.Function get_global_link_angular_analytical_jacobian_function (self, str link, int n=1, bool numpy_output=False)
 Get the function that computes the angular part of the analytical jacobian in the global frame. More...
 
CasADiArrayType get_link_angular_geometric_jacobian (self, str link, ArrayType q, str base_link)
 Get the angular part of the geometric jacobian in a given base frame. More...
 
cs.Function get_link_angular_geometric_jacobian_function (self, str link, str base_link, int n=1, bool numpy_output=False)
 Get the function that computes the angular part of the geometric jacobian in a given base frame. More...
 
CasADiArrayType get_link_angular_analytical_jacobian (self, str link, ArrayType q, str base_link)
 Compute the angular part of the analytical Jacobian matrix in a given base frame. More...
 
cs.Function get_link_angular_analytical_jacobian_function (self, str link, str base_link, int n=1, bool numpy_output=False)
 Get the function that computes the angular part of the analytical jacobian in a given base frame. More...
 
CasADiArrayType get_link_axis (self, str link, ArrayType q, Union[str, ArrayType] axis, str base_link)
 Compute the link axis, this is a direction vector defined in the end-effector frame (e.g. More...
 
cs.Function get_link_axis_function (self, str link, Union[str, ArrayType] axis, str base_link, int n=1, bool numpy_output=False)
 Get function for computing the link axis. More...
 
CasADiArrayType get_global_link_axis (self, str link, ArrayType q, Union[str, ArrayType] axis)
 Compute the link axis, this is a direction vector defined in the end-effector frame (e.g. More...
 
cs.Function get_global_link_axis_function (self, str link, Union[str, ArrayType] axis, int n=1, bool numpy_output=False)
 Get function for computing the link axis in the global frame. More...
 
ArrayType rnea (self, ArrayType q, ArrayType qd, ArrayType qdd)
 Compute inverse dynamics with RNEA. More...
 
- Public Member Functions inherited from optas.models.Model
def __init__ (self, str name, int dim, List[int] time_derivs, str symbol, Dict[int, Tuple[List[float]]] dlim, Union[None, int] T)
 The Model base class initializer. More...
 
str get_name (self)
 Return the name of the model. More...
 
str state_name (self, int time_deriv)
 Return the state name. More...
 
str state_parameter_name (self, int time_deriv)
 Return the parameter name. More...
 
str state_optimized_name (self, int time_deriv)
 Return the sate optimized name. More...
 
Tuple[ArrayType] get_limits (self, int time_deriv)
 Return the model limits. More...
 
cs.DM in_limit (self, ArrayType x, int time_deriv)
 Check if array is within model limits. More...
 

Public Attributes

 xacro_filename
 Filename for xacro file. More...
 
 urdf
 URDF instance. More...
 
 urdf_filename
 Filename for URDF file. More...
 
 urdf_string
 URDF string. More...
 
 param_joints
 List of parameterized joints. More...
 
 F
 
 n
 
 call
 
- Public Attributes inherited from optas.models.Model
 name
 The name of the model. More...
 
 dim
 Model dimension. More...
 
 time_derivs
 Time derivatives required for the model. More...
 
 symbol
 A short symbol to represent the model. More...
 
 dlim
 Model limits. More...
 
 T
 Number of time steps. More...
 

Detailed Description

A class that defines a robot model.

Many methods here model the robot kinematics.

Constructor & Destructor Documentation

◆ __init__()

def optas.models.RobotModel.__init__ (   self,
Union[None, str]   urdf_filename = None,
Union[None, str]   urdf_string = None,
Union[None, str]   xacro_filename = None,
Union[None, str]   name = None,
List[int]   time_derivs = [0],
Union[None, ArrayType]   qddlim = None,
Union[None, int]   T = None,
List[str]   param_joints = [] 
)

Initializer for the robot model class.

           Note, at least one of the parameters urdf_filename, urdf_string, or xacro_filename must be specified.

   @param urdf_filename Filename for a URDF.
   @param urdf_string URDF as a string.
   @param xacro_filename Filename for a xacro file.
   @param name Name of the robot model.
   @param time_derivs Time derivatives required for model, 0 means not time derivative, 1 means first derivative wrt to time is required, etc.
   @param qddlim Optionally specify limits on the joint acceleration.
   @param T Optionally use this to override the number of time-steps given in the OptimizationBuilder constructor.
   @param param_joints A list of joints that are considered parameters.

Member Function Documentation

◆ actuated_joint_names()

List[str] optas.models.RobotModel.actuated_joint_names (   self)

Property that gives the names of the actuated joints.

   @return List of actuated joint names.

◆ add_base_frame()

None optas.models.RobotModel.add_base_frame (   self,
str  base_link,
Union[None, List[float]]   xyz = None,
Union[None, List[float]]   rpy = None,
str   joint_name = None 
)

Add new base frame, note this changes the root link.

   @param base_link The name for the new root link.
   @param xyz The position of the new link with respect to the current root link. Defaults to [0.0, 0.0, 0.0].
   @param rpy The orientation as Euler (RPY) angles, defined in radians, with respect to the current root link. Defaults to [0.0, 0.0, 0.0].
   @param joint_name The name for the joint that connects the current root link with the new base frame. Defaults to "{base_link}_and_{current_root_link}_joint".

◆ extract_optimized_dimensions()

ArrayType optas.models.RobotModel.extract_optimized_dimensions (   self,
ArrayType  values 
)

Return the elements that correspond to the model optimized dimensions.

   @param values The values to extract elements from.
   @return A sub-array of the given values corresponding to the model optimized dimensions.

◆ extract_parameter_dimensions()

ArrayType optas.models.RobotModel.extract_parameter_dimensions (   self,
ArrayType  values 
)

Return the elements that correspond to the model dimensions.

   @param values The values to extract elements from.
   @return A sub-array of the given values corresponding to the model parameterized dimension.

◆ get_actuated_joint_index()

int optas.models.RobotModel.get_actuated_joint_index (   self,
str  joint_name 
)

Get the joint index for a given joint name.

   @param The name of the joint.
   @return Index for the joint.

◆ get_global_link_analytical_jacobian()

CasADiArrayType optas.models.RobotModel.get_global_link_analytical_jacobian (   self,
str  link,
ArrayType   q 
)

Compute the analytical Jacobian matrix in the global frame.

   @param link Name of the end-effector link.
   @param q Joint position array.
   @return Analytic Jacobian.

◆ get_global_link_analytical_jacobian_function()

cs.Function optas.models.RobotModel.get_global_link_analytical_jacobian_function (   self,
str  link,
int   n = 1,
bool   numpy_output = False 
)

Get the function that computes the analytical jacobian in the global frame.

   @param link Name of the end-effector link.
   @param n Number of joint states to expect when the function is called. Default is 1.
   @param numpy_output When true, the output will be a NumPy array.
   @return A CasADi function that computes the analytic jacobian for a given joint state. If n > 1 then a list of arrays are computed whose corresponding to the respective joint state in the input.

◆ get_global_link_angular_analytical_jacobian()

CasADiArrayType optas.models.RobotModel.get_global_link_angular_analytical_jacobian (   self,
str  link,
ArrayType   q 
)

Compute the angular part of the analytical Jacobian matrix in the global frame.

   @param link Name of the end-effector link.
   @param q Joint position array.
   @return Angular part of the analytical Jacobian.

◆ get_global_link_angular_analytical_jacobian_function()

cs.Function optas.models.RobotModel.get_global_link_angular_analytical_jacobian_function (   self,
str  link,
int   n = 1,
bool   numpy_output = False 
)

Get the function that computes the angular part of the analytical jacobian in the global frame.

   @param link Name of the end-effector link.
   @param n Number of joint states to expect when the function is called. Default is 1.
   @param numpy_output When true, the output will be a NumPy array.
   @return A CasADi function that computes the angular part of the geometric Jacobian for a given joint state. If n > 1 then a list of arrays are computed whose corresponding to the respective joint state in the input.

◆ get_global_link_angular_geometric_jacobian()

CasADiArrayType optas.models.RobotModel.get_global_link_angular_geometric_jacobian (   self,
str  link,
ArrayType   q 
)

Compute the angular part of the geometric jacobian in the global frame.

   @param link Name of the end-effector link.
   @param q Joint position array.
   @param base_link Name of the base frame link.
   @return Angular part of the geometric Jacobian.

◆ get_global_link_angular_geometric_jacobian_function()

cs.Function optas.models.RobotModel.get_global_link_angular_geometric_jacobian_function (   self,
str  link,
int   n = 1,
bool   numpy_output = False 
)

Get the function that computes the angular part of the geometric jacobian in the global frame.

   @param link Name of the end-effector link.
   @param n Number of joint states to expect when the function is called. Default is 1.
   @param numpy_output When true, the output will be a NumPy array.
   @return A CasADi function that computes the angular part of the geometric Jacobian for a given joint state. If n > 1 then a list of arrays are computed whose corresponding to the respective joint state in the input.

◆ get_global_link_axis()

CasADiArrayType optas.models.RobotModel.get_global_link_axis (   self,
str  link,
ArrayType  q,
Union[str, ArrayType]   axis 
)

Compute the link axis, this is a direction vector defined in the end-effector frame (e.g.

the x/y/z link axis) in the global frame.

   @param link Name of the end-effector link.
   @param q Joint position array.
   @param axis The axis (direction vector) defined in the end-effector frame. If 'x', 'y', 'z' is passed then the corresponding sub-array of the homogenous transform is used.
   @return Axis defined in the end-effector frame as function of the joint angles.

◆ get_global_link_axis_function()

cs.Function optas.models.RobotModel.get_global_link_axis_function (   self,
str  link,
Union[str, ArrayType]  axis,
int   n = 1,
bool   numpy_output = False 
)

Get function for computing the link axis in the global frame.

   @param link Name of the end-effector link.
   @param axis The axis (direction vector) defined in the end-effector frame. If 'x', 'y', 'z' is passed then the corresponding sub-array of the homogenous transform is used.
   @param numpy_output When true, the output will be a NumPy array.
   @return A CasADi function that computes the link axis for a given joint state. If n > 1 then an array is computed whose columns correspond to the respective joint state in the input.

◆ get_global_link_geometric_jacobian()

CasADiArrayType optas.models.RobotModel.get_global_link_geometric_jacobian (   self,
str  link,
ArrayType   q 
)

Compute the geometric Jacobian matrix in the global frame.

   @param link Name of the end-effector link.
   @param q Joint position array.
   @return Geometric Jacobian.

◆ get_global_link_geometric_jacobian_function()

cs.Function optas.models.RobotModel.get_global_link_geometric_jacobian_function (   self,
str  link,
int   n = 1,
bool   numpy_output = False 
)

Get the function that computes the geometric jacobian in the global frame.

   @param link Name of the end-effector link.
   @param n Number of joint states to expect when the function is called. Default is 1.
   @param numpy_output When true, the output will be a NumPy array.
   @return A CasADi function that computes the geometric jacobian for a given joint state. If n > 1 then a list of arrays are computed whose corresponding to the respective joint state in the input.

◆ get_global_link_linear_jacobian()

CasADiArrayType optas.models.RobotModel.get_global_link_linear_jacobian (   self,
str  link,
ArrayType   q 
)

Compute the linear part of the geometric jacobian in the global frame.

   @param link Name of the end-effector link.
   @param q Joint position array.
   @return Linear part of the Jacobian.

◆ get_global_link_linear_jacobian_function()

cs.Function optas.models.RobotModel.get_global_link_linear_jacobian_function (   self,
str  link,
int   n = 1,
bool   numpy_output = False 
)

Get the function that computes the linear part of the geometric jacobian in the global frame.

   @param link Name of the end-effector link.
   @param n Number of joint states to expect when the function is called. Default is 1.
   @param numpy_output When true, the output will be a NumPy array.
   @return A CasADi function that computes the linear part of the Jacobian for a given joint state. If n > 1 then a list of arrays are computed whose corresponding to the respective joint state in the input.

◆ get_global_link_position()

CasADiArrayType optas.models.RobotModel.get_global_link_position (   self,
str  link,
ArrayType  q 
)

Get the link position in the global frame for a given joint state q.

   @param link Name of the end-effector link.
   @param q Joint position array.
   @return Position array.

◆ get_global_link_position_function()

cs.Function optas.models.RobotModel.get_global_link_position_function (   self,
str  link,
int   n = 1,
bool   numpy_output = False 
)

Get the function that computes the global position of a given link.

   @param link Name of the end-effector link.
   @param n Number of joint states to expect when the function is called. Default is 1.
   @param numpy_output When true, the output will be a NumPy array.
   @return A CasADi function that computes the position for a given joint state. If n > 1 then an array is computed whose columns each correspond to the respective joint state in the input.

◆ get_global_link_quaternion()

CasADiArrayType optas.models.RobotModel.get_global_link_quaternion (   self,
str  link,
ArrayType  q 
)

Get a quaternion in the global frame.

   @param link Name of the end-effector link.
   @param q Joint position array.
   @return Quaternion array.

◆ get_global_link_quaternion_function()

cs.Function optas.models.RobotModel.get_global_link_quaternion_function (   self,
str  link,
int   n = 1,
bool   numpy_output = False 
)

Get the function that computes a quaternion in the global frame.

   @param link Name of the end-effector link.
   @param n Number of joint states to expect when the function is called. Default is 1.
   @param numpy_output When true, the output will be a NumPy array.
   @return A CasADi function that computes the quaternion for a given joint state. If n > 1 then an array is computed whose columns correspond to the respective joint state in the input.

◆ get_global_link_rotation()

CasADiArrayType optas.models.RobotModel.get_global_link_rotation (   self,
str  link,
ArrayType  q 
)

Get the link rotation in the global frame for a given joint state q.

   @param link Name of the end-effector link.
   @param q Joint position array.
   @return Rotation array.

◆ get_global_link_rotation_function()

cs.Function optas.models.RobotModel.get_global_link_rotation_function (   self,
str  link,
int   n = 1,
bool   numpy_output = False 
)

Get the function that computes a rotation matrix in the global link.

   @param link Name of the end-effector link.
   @param n Number of joint states to expect when the function is called. Default is 1.
   @param numpy_output When true, the output will be a NumPy array.
   @return A CasADi function that computes the rotation for a given joint state. If n > 1 then a list of arrays are computed whose corresponding to the respective joint state in the input.

◆ get_global_link_rpy()

CasADiArrayType optas.models.RobotModel.get_global_link_rpy (   self,
str  link,
ArrayType  q 
)

Get the Roll-Pitch-Yaw angles in the global frame.

   @param link Name of the end-effector link.
   @param q Joint position array.
   @return RPY euler angles in radians.

◆ get_global_link_rpy_function()

def optas.models.RobotModel.get_global_link_rpy_function (   self,
str  link,
int   n = 1,
bool   numpy_output = False 
)

Get the function that computes the Roll-Pitch-Yaw angles in the global frame.

◆ get_global_link_transform()

CasADiArrayType optas.models.RobotModel.get_global_link_transform (   self,
str  link,
ArrayType  q 
)

Get the link transform in the global frame for a given joint state q.

   @param link Name of the end-effector link.
   @param q Joint position array.
   @return Homogeneous transform array.

◆ get_global_link_transform_function()

cs.Function optas.models.RobotModel.get_global_link_transform_function (   self,
str  link,
int   n = 1,
bool   numpy_output = False 
)

Get the function which computes the link transform in the global frame.

   @param link Name of the end-effector link.
   @param n Number of joint states to expect when the function is called. Default is 1.
   @param numpy_output When true, the output will be a NumPy array.
   @return A CasADi function that computes the transform for a given joint state. If n > 1 then a list of transform are given for each corresponding joint state.

◆ get_joint_axis()

cs.DM optas.models.RobotModel.get_joint_axis (   self,
Joint  joint 
)

Get the axis of a joint.

   @param The joint of interest.
   @return The normalized joint axis.

◆ get_joint_lower_limit()

float optas.models.RobotModel.get_joint_lower_limit (   self,
Joint  joint 
)

Return the lower limit for a given joint.

   @param joint The joint instance from the URDF.
   @return The lower limit, when undefined the value -1e9 is returned.

◆ get_joint_origin()

Tuple[cs.DM] optas.models.RobotModel.get_joint_origin (   self,
Joint  joint 
)

Get the origin for the joint.

   @param The joint of interest.
   @return The position and orientation of the joint.

◆ get_joint_upper_limit()

float optas.models.RobotModel.get_joint_upper_limit (   self,
Joint  joint 
)

Return the upper limit for a given joint.

   @param joint The joint instance from the URDF.
   @return The upper limit, when undefined the value 1e9 is returned.

◆ get_link_analytical_jacobian()

CasADiArrayType optas.models.RobotModel.get_link_analytical_jacobian (   self,
str  link,
ArrayType  q,
str   base_link 
)

Compute the analytical Jacobian matrix in a given base link.

   @param link Name of the end-effector link.
   @param q Joint position array.
   @param base_link Name of the base frame link.
   @return Analytic Jacobian.

◆ get_link_analytical_jacobian_function()

cs.Function optas.models.RobotModel.get_link_analytical_jacobian_function (   self,
str  link,
str  base_link,
int   n = 1,
bool   numpy_output = False 
)

Get the function that computes the analytical jacobian in a given base frame.

   @param link Name of the end-effector link.
   @param base_link Name of the base frame link.
   @param n Number of joint states to expect when the function is called. Default is 1.
   @param numpy_output When true, the output will be a NumPy array.
   @return A CasADi function that computes the analytic jacobian for a given joint state. If n > 1 then a list of arrays are computed whose corresponding to the respective joint state in the input.

◆ get_link_angular_analytical_jacobian()

CasADiArrayType optas.models.RobotModel.get_link_angular_analytical_jacobian (   self,
str  link,
ArrayType  q,
str   base_link 
)

Compute the angular part of the analytical Jacobian matrix in a given base frame.

   @param link Name of the end-effector link.
   @param q Joint position array.
   @param base_link Name of the base frame link.
   @return Angular part of the analytical Jacobian.

◆ get_link_angular_analytical_jacobian_function()

cs.Function optas.models.RobotModel.get_link_angular_analytical_jacobian_function (   self,
str  link,
str  base_link,
int   n = 1,
bool   numpy_output = False 
)

Get the function that computes the angular part of the analytical jacobian in a given base frame.

   @param link Name of the end-effector link.
   @param base_link Name of the base frame link.
   @param n Number of joint states to expect when the function is called. Default is 1.
   @param numpy_output When true, the output will be a NumPy array.
   @return A CasADi function that computes the angular part of the analytical Jacobian for a given joint state. If n > 1 then a list of arrays are computed whose corresponding to the respective joint state in the input.

◆ get_link_angular_geometric_jacobian()

CasADiArrayType optas.models.RobotModel.get_link_angular_geometric_jacobian (   self,
str  link,
ArrayType  q,
str   base_link 
)

Get the angular part of the geometric jacobian in a given base frame.

   @param link Name of the end-effector link.
   @param q Joint position array.
   @param base_link Name of the base frame link.
   @return Angular part of the geometric Jacobian.

◆ get_link_angular_geometric_jacobian_function()

cs.Function optas.models.RobotModel.get_link_angular_geometric_jacobian_function (   self,
str  link,
str  base_link,
int   n = 1,
bool   numpy_output = False 
)

Get the function that computes the angular part of the geometric jacobian in a given base frame.

   @param link Name of the end-effector link.
   @param base_link Name of the base frame link.
   @param n Number of joint states to expect when the function is called. Default is 1.
   @param numpy_output When true, the output will be a NumPy array.
   @return A CasADi function that computes the angular part of the geometric Jacobian for a given joint state. If n > 1 then a list of arrays are computed whose corresponding to the respective joint state in the input.

◆ get_link_axis()

CasADiArrayType optas.models.RobotModel.get_link_axis (   self,
str  link,
ArrayType  q,
Union[str, ArrayType]  axis,
str   base_link 
)

Compute the link axis, this is a direction vector defined in the end-effector frame (e.g.

the x/y/z link axis).

   @param link Name of the end-effector link.
   @param q Joint position array.
   @param axis The axis (direction vector) defined in the end-effector frame. If 'x', 'y', 'z' is passed then the corresponding sub-array of the homogenous transform is used.
   @param base_link Name of the base frame link.
   @return Axis defined in the end-effector frame as function of the joint angles.

◆ get_link_axis_function()

cs.Function optas.models.RobotModel.get_link_axis_function (   self,
str  link,
Union[str, ArrayType]  axis,
str  base_link,
int   n = 1,
bool   numpy_output = False 
)

Get function for computing the link axis.

   @param link Name of the end-effector link.
   @param axis The axis (direction vector) defined in the end-effector frame. If 'x', 'y', 'z' is passed then the corresponding sub-array of the homogenous transform is used.
   @param base_link Name of the base frame link.
   @param numpy_output When true, the output will be a NumPy array.
   @return A CasADi function that computes the link axis for a given joint state. If n > 1 then an array is computed whose columns correspond to the respective joint state in the input.

◆ get_link_geometric_jacobian()

CasADiArrayType optas.models.RobotModel.get_link_geometric_jacobian (   self,
str  link,
ArrayType  q,
str   base_link 
)

Get the geometric jacobian in a given base link.

   @param link Name of the end-effector link.
   @param q Joint position array.
   @param base_link Name of the base frame link.
   @return Geometric Jacobian.

◆ get_link_geometric_jacobian_function()

cs.Function optas.models.RobotModel.get_link_geometric_jacobian_function (   self,
str  link,
str  base_link,
int   n = 1,
bool   numpy_output = False 
)
Get the function that computes the geometric jacobian in a given base frame.

@param link Name of the end-effector link.
@param base_link Name of the base frame link.
@param n Number of joint states to expect when the function is called. Default is 1.
@param numpy_output When true, the output will be a NumPy array.
@return A CasADi function that computes the geometric jacobian for a given joint state. If n > 1 then a list of arrays are computed whose corresponding to the respective joint state in the input.

◆ get_link_linear_jacobian()

CasADiArrayType optas.models.RobotModel.get_link_linear_jacobian (   self,
str  link,
ArrayType  q,
str   base_link 
)

Get the linear part of the geometric jacobian in a given base frame.

   @param link Name of the end-effector link.
   @param q Joint position array.
   @param base_link Name of the base frame link.
   @return Linear part of the Jacobian.

◆ get_link_linear_jacobian_function()

cs.Function optas.models.RobotModel.get_link_linear_jacobian_function (   self,
str  link,
str  base_link,
int   n = 1,
bool   numpy_output = False 
)

Get the function that computes the linear part of the geometric jacobian in a given base frame.

   @param link Name of the end-effector link.
   @param base_link Name of the base frame link.
   @param n Number of joint states to expect when the function is called. Default is 1.
   @param numpy_output When true, the output will be a NumPy array.
   @return A CasADi function that computes the linear part of the Jacobian for a given joint state. If n > 1 then a list of arrays are computed whose corresponding to the respective joint state in the input.

◆ get_link_position()

CasADiArrayType optas.models.RobotModel.get_link_position (   self,
str  link,
ArrayType  q,
str   base_link 
)

Get the link position in a given base frame.

   @param link Name of the end-effector link.
   @param q Joint position array.
   @return Position array.

◆ get_link_position_function()

cs.Function optas.models.RobotModel.get_link_position_function (   self,
str  link,
str  base_link,
int   n = 1,
bool   numpy_output = False 
)

Get the function that computes the position of a link in a given base frame.

   @param link Name of the end-effector link.
   @param base_link Name of the base frame link.
   @param n Number of joint states to expect when the function is called. Default is 1.
   @param numpy_output When true, the output will be a NumPy array.
   @return A CasADi function that computes the position for a given joint state. If n > 1 then an array is computed whose columns each correspond to the respective joint state in the input.

◆ get_link_quaternion()

CasADiArrayType optas.models.RobotModel.get_link_quaternion (   self,
str  link,
ArrayType  q,
str   base_link 
)

Get the quaternion defined in a given base frame.

   @param link Name of the end-effector link.
   @param q Joint position array.
   @param base_link Name of the base frame link.
   @return Quaternion array.

◆ get_link_quaternion_function()

cs.Function optas.models.RobotModel.get_link_quaternion_function (   self,
str  link,
str  base_link,
int   n = 1,
bool   numpy_output = False 
)

Get the function that computes a quaternion defined in a given base frame.

   @param link Name of the end-effector link.
   @param base_link Name of the base frame link.
   @param n Number of joint states to expect when the function is called. Default is 1.
   @param numpy_output When true, the output will be a NumPy array.
   @return A CasADi function that computes the quaternion for a given joint state. If n > 1 then an array is computed whose columns correspond to the respective joint state in the input.

◆ get_link_rotation()

CasADiArrayType optas.models.RobotModel.get_link_rotation (   self,
str  link,
ArrayType  q,
str   base_link 
)

Get the rotation matrix for a link in a given base frame.

   @param link Name of the end-effector link.
   @param q Joint position array.
   @param base_link Name of the base frame link.
   @return Rotation array.

◆ get_link_rotation_function()

cs.Function optas.models.RobotModel.get_link_rotation_function (   self,
str  link,
str  base_link,
int   n = 1,
bool   numpy_output = False 
)

Get the function that computes the rotation matrix for a link in a given base frame.

   @param link Name of the end-effector link.
   @param base_link Name of the base frame link.
   @param n Number of joint states to expect when the function is called. Default is 1.
   @param numpy_output When true, the output will be a NumPy array.
   @return A CasADi function that computes the rotation for a given joint state. If n > 1 then a list of arrays are computed whose corresponding to the respective joint state in the input.

◆ get_link_rpy()

CasADiArrayType optas.models.RobotModel.get_link_rpy (   self,
str  link,
ArrayType  q,
str  base_link 
)

Get the the Roll-Pitch-Yaw angles defined in a given base frame.

   @param link Name of the end-effector link.
   @param q Joint position array.
   @param base_link Name of the base frame link.
   @return RPY euler angles in radians.

◆ get_link_rpy_function()

cs.Function optas.models.RobotModel.get_link_rpy_function (   self,
str  link,
str  base_link,
int   n = 1,
bool   numpy_output = False 
)

Get the function that computes the Roll-Pitch-Yaw angles defined in a given base frame.

   @param link Name of the end-effector link.
   @param base_link Name of the base frame link.
   @param n Number of joint states to expect when the function is called. Default is 1.
   @param numpy_output When true, the output will be a NumPy array.
   @return A CasADi function that computes the RPY angles for a given joint state. If n > 1 then an array is computed whose columns correspond to the respective joint state in the input.

◆ get_link_transform()

CasADiArrayType optas.models.RobotModel.get_link_transform (   self,
str  link,
ArrayType  q,
str   base_link 
)

Get the link transform in a given base frame.

   @param link Name of the end-effector link.
   @param q Joint position array.
   @param base_link Name of the base frame link.
   @return Homogeneous transform array.

◆ get_link_transform_function()

CasADiArrayType optas.models.RobotModel.get_link_transform_function (   self,
str  link,
str  base_link,
int   n = 1,
bool   numpy_output = False 
)

Get the function that computes the transform in a given base frame.

   @param link Name of the end-effector link.
   @param base_link Name of the base frame link.
   @param n Number of joint states to expect when the function is called. Default is 1.
   @param numpy_output When true, the output will be a NumPy array.
   @return A CasADi function that computes the transform for a given joint state. If n > 1 then a list of transform are given for each corresponding joint state.

◆ get_link_visual_origin()

Tuple[cs.DM] optas.models.RobotModel.get_link_visual_origin (   self,
Link  link 
)

Get the link position and orientation for the link visual.

   @param link The link of interest.
   @return The position and orientation.

◆ get_random_joint_positions()

cs.DM optas.models.RobotModel.get_random_joint_positions (   self,
int   n = 1,
Union[None, Tuple[ArrayType]]   xlim = None,
Union[None, Tuple[ArrayType]]   ylim = None,
Union[None, Tuple[ArrayType]]   zlim = None,
Union[None, str]   base_link = None 
)

Random joint positions within actuator limits and optionally within a box for a given base link.

   @param n Number of joint positions. Default is 1.
   @param xlim Limit the robot link positions in the x axis for the base frame. None means there are no limits.
   @param ylim Limit the robot link positions in the y axis for the base frame. None means there are no limits.
   @param zlim Limit the robot link positions in the z axis for the base frame. None means there are no limits.
   @param base_link The link to define the x, y, z limits. None means the root link is used.
   @return Random joint positions with dimension ndof-by-n.

◆ get_random_pose_in_global_link()

cs.DM optas.models.RobotModel.get_random_pose_in_global_link (   self,
str  link_name 
)
Random end-effector pose within robot limits.

@param link_name Name of the end-effector link.
@return Random homogeneous transformation array within robot limits defined in the global link frame.

◆ get_root_link()

str optas.models.RobotModel.get_root_link (   self)

The root link name.

   @return The name of the root link.

◆ get_urdf()

def optas.models.RobotModel.get_urdf (   self)

◆ get_urdf_dirname()

def optas.models.RobotModel.get_urdf_dirname (   self)

◆ get_velocity_joint_limit()

float optas.models.RobotModel.get_velocity_joint_limit (   self,
Joint  joint 
)

Return the velocity limit for a given joint.

   @param joint The joint instance from the URDF.
   @return The velocity limit, when undefined the value 1e9 is returned.

◆ joint_names()

List[str] optas.models.RobotModel.joint_names (   self)

Property that gives the list of joint names.

   @return List of joint names.

◆ link_names()

List[str] optas.models.RobotModel.link_names (   self)

Property that gives the list of link names.

   @return List of link names.

◆ lower_actuated_joint_limits()

cs.DM optas.models.RobotModel.lower_actuated_joint_limits (   self)

Property that defines the lower actuated joint limits.

   @return The lower joint position limits.

◆ lower_optimized_joint_limits()

cs.DM optas.models.RobotModel.lower_optimized_joint_limits (   self)

Property that defines the lower optimized joint limits.

   @return The lower joint position limits.

◆ make_function()

def optas.models.RobotModel.make_function (   self,
str  label,
str  link,
Callable  method,
int   n = 1,
Union[None, str]   base_link = None,
Union[None, cs.DM]   axis = None,
  numpy_output = False 
)

Automate function generation.

This is an internal function for the RobotModel class and SHOULD NOT be used.

◆ ndof()

int optas.models.RobotModel.ndof (   self)

Number of degrees of freedom.

   @return The number of degrees of freedom for the robot.

◆ num_opt_joints()

int optas.models.RobotModel.num_opt_joints (   self)

Number of optimized joints.

   @return The number of optimized joints.

◆ num_param_joints()

int optas.models.RobotModel.num_param_joints (   self)

Number of parameterized joints.

   @return The number of parameterized joints.

◆ optimized_joint_indexes()

List[int] optas.models.RobotModel.optimized_joint_indexes (   self)

Property that gives the indexes of the optimized joints.

   @return List of the optimized joint indexes.

◆ optimized_joint_names()

List[str] optas.models.RobotModel.optimized_joint_names (   self)

Property that gives the names of the optimized joints names.

   @return List of the optimized joint names.

◆ parameter_joint_indexes()

List[int] optas.models.RobotModel.parameter_joint_indexes (   self)

Property that gives the indexes of the parameterized joints.

   @return List of the parameterized joint indexes.

◆ parameter_joint_names()

List[str] optas.models.RobotModel.parameter_joint_names (   self)

Property that gives the names of the parameterized joints.

   @return List of the parameterized joint names.

◆ rnea()

ArrayType optas.models.RobotModel.rnea (   self,
ArrayType  q,
ArrayType  qd,
ArrayType  qdd 
)

Compute inverse dynamics with RNEA.

   NOTE, currently this method only supports revolute/continuous joints.
   The first joint should be fixed and there is no fixed joints except the first joint and the last joint.

   @ param  q: Joint position (unit rad).
   @ param  qd: Joint velocity.
   @ param  qdd: Joint accerleration.

◆ upper_actuated_joint_limits()

cs.DM optas.models.RobotModel.upper_actuated_joint_limits (   self)

Property that defines the upper actuated joint limits.

   @return The upper joint position limits.

◆ upper_optimized_joint_limits()

cs.DM optas.models.RobotModel.upper_optimized_joint_limits (   self)

Property that defines the upper optimized joint limits.

   @return The upper joint position limits.

◆ velocity_actuated_joint_limits()

cs.DM optas.models.RobotModel.velocity_actuated_joint_limits (   self)

Property that defines the velocity actuated joint limits.

   @return The velocity joint limits.

◆ velocity_optimized_joint_limits()

cs.DM optas.models.RobotModel.velocity_optimized_joint_limits (   self)

Property that defines the velocity limits for the optimized joints.

   @return The joint velocity limits.

Member Data Documentation

◆ call

optas.models.RobotModel.call

◆ F

optas.models.RobotModel.F

◆ n

optas.models.RobotModel.n

◆ param_joints

optas.models.RobotModel.param_joints

List of parameterized joints.

◆ urdf

optas.models.RobotModel.urdf

URDF instance.

◆ urdf_filename

optas.models.RobotModel.urdf_filename

Filename for URDF file.

◆ urdf_string

optas.models.RobotModel.urdf_string

URDF string.

◆ xacro_filename

optas.models.RobotModel.xacro_filename

Filename for xacro file.


The documentation for this class was generated from the following file: