Main Content

constraintAiming class

Create aiming constraint for pointing at a target location

Description

The constraintAiming object describes a constraint that requires the z-axis of one body (the end effector) to aim at a target point on another body (the reference body). This constraint is satisfied if the z-axis of the end-effector frame is within an angular tolerance in any direction of the line connecting the end-effector origin and the target point. The position of the target point is defined relative to the reference body.

Constraint objects are used in generalizedInverseKinematics objects to specify multiple kinematic constraints on a robot.

For an example that uses multiple constraint objects, see Plan a Reaching Trajectory With Multiple Kinematic Constraints.

Construction

aimConst = constraintAiming(endeffector) returns an aiming constraint object that represents a constraint on a body specified by endeffector.

aimConst = constraintAiming(endeffector,Name,Value) returns an aiming constraint object with each specified property name set to the specified value by one or more Name,Value pair arguments.

Input Arguments

expand all

End-effector name, specified as a string scalar or character vector. When using this constraint with generalizedInverseKinematics, the name must match a body specified in the robot model (rigidBodyTree).

Example: "left_palm"

Data Types: char | string

Properties

expand all

Name of the end effector, specified as a string scalar or character vector. When using this constraint with generalizedInverseKinematics, the name must match a body specified in the robot model (rigidBodyTree).

Example: "left_palm"

Data Types: char | string

Name of the reference body frame, specified as a string scalar or character vector. The default '' indicates that the constraint is relative to the base of the robot model. When using this constraint with generalizedInverseKinematics, the name must match a body specified in the robot model (rigidBodyTree).

Data Types: char | string

Position of the target relative to the reference body, specified as an [x y z] vector. The constraint uses the line between the origin of the EndEffector body frame and this target point for maintaining the specified AngularTolerance.

Maximum allowed angle between the z-axis of the end-effector frame and the line connecting the end-effector origin to the target point, specified as a numeric scalar in radians.

Weight of the constraint, specified as a numeric scalar. This weight is used with the Weights property of all the constraints specified in generalizedInverseKinematics to properly balance each constraint.

Compatibility Considerations

expand all

Behavior change in future release

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Introduced in R2017a