add_constraints()
- 1 Minute to read
add_constraints()
- 1 Minute to read
Article summary
Did you find this summary helpful?
Thank you for your feedback
Add a constraint to the arm.
Reference
Arguments
Arguments | Type | Default value | Description |
---|---|---|---|
arm | str | The arm to add constraints for. | |
joint_constraints | list | [] | List of joint constraints. |
orientation_constraints | list | [] | List of orientation constraints. |
position_constraints | list | [] | List of position constraints. |
units | ANG_UNIT | ANG_UNIT.DEG | Unit for angles (DEG or RAD). |
Return
None
Exceptions
RayaWrongArgument
See the complete list of arms exceptions
Usage Example
async def setup(self):
self.arms: ArmsController = await self.enable_controller('arms')
self.constraints_1 = {
'joint_constraints': [
{
'position': 0,
'joint_name': 'arm_right_shoulder_FR_joint',
'tolerance_above': 15,
'tolerance_below': 15,
'weight': 1.0,
},
{
'position': 0,
'joint_name': 'arm_right_shoulder_rail_joint',
'tolerance_above': 0.1,
'tolerance_below': 0,
'weight': 1.0,
}
],
'orientation_constraints': [
{
'orientation': {'roll': 90},
'weight': 1.0,
'absolute_x_axis_tolerance': 20.0,
'absolute_y_axis_tolerance': 20.0,
'absolute_z_axis_tolerance': 180.0
}
],
'position_constraints': [
{
'constraint_region': {
'types': [SHAPE_TYPE.BOX],
'shapes_poses': [{'position': {'x': 0,
'y': -1.02,
'z': 0.5},
'orientation': {'pitch': 90}}],
'dimensions': [[2.0,
1.0,
0.95]]
},
'target_point_offset': {'x': 0.1, 'y': 0, 'z': 0},
'weight': 1.0,
}
],
}
...
async def loop(self):
await self.arms.add_constraints(arm='right_arm', **self.constraints_1)
See the add constraints Example to see how to use this function.
Was this article helpful?